Fix a problem with OBJECT IDENTIFIER encoding: need to check the

second subid to be less than 40, not the first when the first
subid is 0 or 1.
This commit is contained in:
Hartmut Brandt 2014-01-21 16:49:54 +00:00
parent 2656b5237b
commit 30b5118d51

View File

@ -652,7 +652,7 @@ asn_put_objid(struct asn_buf *b, const struct asn_oid *oid)
err = ASN_ERR_RANGE;
}
if (oid->subs[0] > 2 ||
(oid->subs[0] < 2 && oid->subs[0] >= 40)) {
(oid->subs[0] < 2 && oid->subs[1] >= 40)) {
asn_error(NULL, "oid out of range (%u,%u)",
oid->subs[0], oid->subs[1]);
err = ASN_ERR_RANGE;