asn1: Fix recent der_match_tag2() bug

Recently introduced.
This commit is contained in:
Nicolas Williams
2021-03-11 09:12:43 -06:00
parent 1b5fe4a35c
commit 5bb5887f8c

View File

@@ -636,7 +636,7 @@ der_match_tag2 (const unsigned char *p, size_t len,
*/
if (cls != thisclass && (cls == ASN1_C_APPL || thisclass == ASN1_C_APPL))
return ASN1_BAD_ID;
if (tag != thistag)
if (cls != thisclass || tag != thistag)
return ASN1_MISSING_FIELD;
if (size) *size = l;
return 0;