From 6c70e3233d92314031d5d54c990d8588efb0fd78 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Sat, 5 Dec 2015 13:14:29 -0800 Subject: [PATCH] fix bug where unknown OIDs were treated as parsing errors rather than ignored --- wolfcrypt/src/asn.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index ff73f69dd..a23190005 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -1144,9 +1144,9 @@ WOLFSSL_LOCAL int GetObjectId(const byte* input, word32* inOutIdx, word32* oid, if (oidType != ignoreType) { checkOid = OidFromId(*oid, oidType, &checkOidSz); - if (checkOid == NULL || - checkOidSz != actualOidSz || - XMEMCMP(actualOid, checkOid, checkOidSz) != 0) { + if (checkOid != NULL && + (checkOidSz != actualOidSz || + XMEMCMP(actualOid, checkOid, checkOidSz) != 0)) { WOLFSSL_MSG("OID Check Failed"); return ASN_UNKNOWN_OID_E;