diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-01-30 11:15:13 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-01-30 12:14:42 +0100 |
commit | 7d3caedb8df9d04eee9513cb5b3b417ae29927f5 (patch) | |
tree | b6ae6c49ab8606c63ec3702164f3872517be9947 | |
parent | 1b9b122830164059f6cab90d330c62adae840353 (diff) | |
download | gnutls-7d3caedb8df9d04eee9513cb5b3b417ae29927f5.tar.gz |
Revert "Fix out-of-bounds read in gnutls_x509_ext_export_key_usage"
This was not really an out-of-bounds check. Added documentation
to make that clear.
This reverts commit ffbc9aaea7dcf29c03784d128b83f0682357858d.
-rw-r--r-- | lib/x509/x509_ext.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/x509/x509_ext.c b/lib/x509/x509_ext.c index ce1ce9b30c..b68ac75edd 100644 --- a/lib/x509/x509_ext.c +++ b/lib/x509/x509_ext.c @@ -1116,7 +1116,9 @@ int gnutls_x509_ext_export_key_usage(unsigned int usage, gnutls_datum_t * ext) str[0] = usage & 0xff; str[1] = usage >> 8; - result = asn1_write_value(c2, "", str, 2); + /* Since KeyUsage is a BIT STRING, the input to asn1_write_value + * is the number of bits to be read. */ + result = asn1_write_value(c2, "", str, 9); if (result != ASN1_SUCCESS) { gnutls_assert(); asn1_delete_structure(&c2); |