diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2009-07-24 11:15:55 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2009-07-24 11:15:55 +0000 |
commit | b4c81fb6dbd1ee884dff681a94bab4ab9ec59377 (patch) | |
tree | 4d90340447edb648e8abaa0767677542c6d1ead1 /crypto/asn1/a_object.c | |
parent | 0f566bda2bed59baf056f337e59a8ed88f08e351 (diff) |
Update from 0.9.8-stable
Diffstat (limited to 'crypto/asn1/a_object.c')
-rw-r--r-- | crypto/asn1/a_object.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/crypto/asn1/a_object.c b/crypto/asn1/a_object.c index f1a5a1e31e..bd2d5a2d82 100644 --- a/crypto/asn1/a_object.c +++ b/crypto/asn1/a_object.c @@ -290,6 +290,17 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, const unsigned char *p; unsigned char *data; int i; + /* Sanity check OID encoding: can't have 0x80 in subidentifiers, see: + * X.690 8.19.2 + */ + for (i = 0, p = *pp + 1; i < len - 1; i++, p++) + { + if (*p == 0x80) + { + ASN1err(ASN1_F_C2I_ASN1_OBJECT,ASN1_R_INVALID_OBJECT_ENCODING); + return NULL; + } + } /* only the ASN1_OBJECTs from the 'table' will have values * for ->sn or ->ln */ |