gnutls-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU gnutls branch, ocsp, updated. gnutls_3_0_3-25-gdc8bb50


From: Simon Josefsson
Subject: [SCM] GNU gnutls branch, ocsp, updated. gnutls_3_0_3-25-gdc8bb50
Date: Mon, 31 Oct 2011 13:57:52 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=dc8bb5088a76e0b8399624c78a34f7b9207b56ff

The branch, ocsp has been updated
       via  dc8bb5088a76e0b8399624c78a34f7b9207b56ff (commit)
      from  df2118081823b7995b0c35cafbd93af293d79e26 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit dc8bb5088a76e0b8399624c78a34f7b9207b56ff
Author: Simon Josefsson <address@hidden>
Date:   Mon Oct 31 14:55:46 2011 +0100

    Simplify.  Suggested by Nikos.

-----------------------------------------------------------------------

Summary of changes:
 lib/x509/ocsp.c |   29 +++--------------------------
 1 files changed, 3 insertions(+), 26 deletions(-)

diff --git a/lib/x509/ocsp.c b/lib/x509/ocsp.c
index 244a6c4..a50fa93 100644
--- a/lib/x509/ocsp.c
+++ b/lib/x509/ocsp.c
@@ -1605,7 +1605,6 @@ gnutls_ocsp_resp_get_signature (gnutls_ocsp_resp_t resp,
                                gnutls_datum_t *sig)
 {
   int ret;
-  int bits, len;
 
   if (resp == NULL || sig == NULL)
     {
@@ -1613,33 +1612,11 @@ gnutls_ocsp_resp_get_signature (gnutls_ocsp_resp_t resp,
       return GNUTLS_E_INVALID_REQUEST;
     }
 
-  bits = 0;
-  ret = asn1_read_value (resp->basicresp, "signature", NULL, &bits);
-  if (ret != ASN1_MEM_ERROR)
-    {
-      gnutls_assert ();
-      return _gnutls_asn2err (ret);
-    }
-
-  if (bits % 8 != 0)
-    {
-      gnutls_assert ();
-      return GNUTLS_E_CERTIFICATE_ERROR;
-    }
-
-  sig->size = len = bits / 8;
-  sig->data = gnutls_malloc (sig->size);
-  if (sig->data == NULL)
-    {
-      gnutls_assert ();
-      return GNUTLS_E_MEMORY_ERROR;
-    }
-
-  ret = asn1_read_value (resp->basicresp, "signature", sig->data, &len);
-  if (ret != ASN1_SUCCESS)
+  ret = _gnutls_x509_read_value (resp->basicresp, "signature", sig, 2);
+  if (ret != GNUTLS_E_SUCCESS)
     {
       gnutls_assert ();
-      return _gnutls_asn2err (ret);
+      return ret;
     }
 
   return GNUTLS_E_SUCCESS;


hooks/post-receive
-- 
GNU gnutls



reply via email to

[Prev in Thread] Current Thread [Next in Thread]