]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
gnutls_x509_crt_get_signature() will return the correct signature size rather than...
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 16 May 2014 22:26:25 +0000 (00:26 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 16 May 2014 22:55:23 +0000 (00:55 +0200)
lib/x509/x509.c

index 48d874846fdeea0e0958dccd6bedb1b26f2c1942..2a75bf97539a77ab8b1d5df8dbf5243487769e96 100644 (file)
@@ -596,7 +596,7 @@ gnutls_x509_crt_get_signature(gnutls_x509_crt_t cert,
        }
 
        bits = len;
-       if (bits % 8 != 0) {
+       if (bits % 8 != 0 || bits == 0) {
                gnutls_assert();
                return GNUTLS_E_CERTIFICATE_ERROR;
        }
@@ -613,6 +613,7 @@ gnutls_x509_crt_get_signature(gnutls_x509_crt_t cert,
                gnutls_assert();
                return _gnutls_asn2err(result);
        }
+       *sizeof_sig = (unsigned)(len/8);
 
        return 0;
 }