- Allowed X509 key usage parsing to accept 4 byte values instead of the standard 1 byte version sometimes used by Microsoft. (Closes ticket #38)
diff --git a/library/x509parse.c b/library/x509parse.c
index 9fc8831..ceb3db2 100644
--- a/library/x509parse.c
+++ b/library/x509parse.c
@@ -749,7 +749,7 @@
if( ( ret = asn1_get_bitstring( p, end, &bs ) ) != 0 )
return( POLARSSL_ERR_X509_CERT_INVALID_EXTENSIONS + ret );
- if( bs.len != 1 )
+ if( bs.len > 1 )
return( POLARSSL_ERR_X509_CERT_INVALID_EXTENSIONS +
POLARSSL_ERR_ASN1_INVALID_LENGTH );