From 5bb5887f8c5bd968cf9c4891a66aba4d44698f38 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Thu, 11 Mar 2021 09:12:43 -0600 Subject: [PATCH] asn1: Fix recent der_match_tag2() bug Recently introduced. --- lib/asn1/der_get.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/asn1/der_get.c b/lib/asn1/der_get.c index 8e9114ed1..264138e11 100644 --- a/lib/asn1/der_get.c +++ b/lib/asn1/der_get.c @@ -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;