From 5e8e7054f76add84998f6133fb324116b4e811b9 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Sun, 7 Mar 2010 16:40:31 +0000 Subject: [PATCH] The OID sanity check was incorrect. It should only disallow *leading* 0x80 values. --- crypto/asn1/a_object.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto/asn1/a_object.c b/crypto/asn1/a_object.c index d169f8c147..365e4673a9 100644 --- a/crypto/asn1/a_object.c +++ b/crypto/asn1/a_object.c @@ -291,12 +291,12 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, ASN1_OBJECT *ret=NULL; const unsigned char *p; int i; - /* Sanity check OID encoding: can't have 0x80 in subidentifiers, see: - * X.690 8.19.2 + /* Sanity check OID encoding: can't have leading 0x80 in + * subidentifiers, see: X.690 8.19.2 */ for (i = 0, p = *pp + 1; i < len - 1; i++, p++) { - if (*p == 0x80) + if (*p == 0x80 && (!i || !(p[-1] & 0x80))) { ASN1err(ASN1_F_C2I_ASN1_OBJECT,ASN1_R_INVALID_OBJECT_ENCODING); return NULL; -- 2.25.1