summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2014-05-17 00:26:25 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2014-05-17 08:28:27 +0200
commit98d7529fd64d6ca9ec9fa4b2df0cf5ae757a78e9 (patch)
tree225cc2934eda459d2281b2dd7805c66f9cafc307
parent6d9ed14cfae0c0c47138c018e6d26220db72cbaf (diff)
downloadgnutls-98d7529fd64d6ca9ec9fa4b2df0cf5ae757a78e9.tar.gz
gnutls_x509_crt_get_signature() will return the correct signature size rather than the max.
-rw-r--r--lib/x509/x509.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/x509/x509.c b/lib/x509/x509.c
index e3715a1622..81c8846498 100644
--- a/lib/x509/x509.c
+++ b/lib/x509/x509.c
@@ -591,7 +591,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;
}
@@ -608,6 +608,7 @@ gnutls_x509_crt_get_signature(gnutls_x509_crt_t cert,
gnutls_assert();
return _gnutls_asn2err(result);
}
+ *sizeof_sig = (unsigned)(len/8);
return 0;
}