Commit f4bcb738f4 for openssl.org
commit f4bcb738f45e293ae5bfe9c33e8b760c6bf2a3a3
Author: Igor Ustinov <igus@openssl.foundation>
Date: Thu Nov 19 15:19:26 2026 +0100
crypto/asn1/tasn_dec.c: removing redundant check in asn1_check_tlen()
The check is redundant; this condition is already checked
in ASN1_get_object().
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Bob Beck <beck@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Merge-date: Wed Dec 2 06:00:03 2026
Merged-from: https://github.com/openssl/openssl/pull/33846
diff --git a/crypto/asn1/tasn_dec.c b/crypto/asn1/tasn_dec.c
index f5a222c544..2f195a50e2 100644
--- a/crypto/asn1/tasn_dec.c
+++ b/crypto/asn1/tasn_dec.c
@@ -1215,14 +1215,6 @@ static int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass,
ctx->ptag = ptag;
ctx->hdrlen = (int)(p - q);
ctx->valid = 1;
- /*
- * If definite length, and no error, length + header can't exceed
- * total amount of data available.
- */
- if ((i & 0x81) == 0 && (plen + ctx->hdrlen) > len) {
- ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
- goto err;
- }
}
}