summaryrefslogtreecommitdiff
path: root/lib/libcrypto
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2022-05-04 10:53:27 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2022-05-04 10:53:27 +0000
commit4c09b2dc00ad38dafbab52187c48fcf0e61b706c (patch)
tree6ef5ea2180f3f38ddd01771e17504f4492fe7992 /lib/libcrypto
parentb70e5c8e7c34039dc6c6b4be461f24bbc93aa5e7 (diff)
Avoid special handling of definite length before calling asn1_find_end().
The asn1_find_end() function handles definite length ASN.1, which means that there is no point in the only caller having code to explicitly handle definite length - it can just call the function. ok tb@
Diffstat (limited to 'lib/libcrypto')
-rw-r--r--lib/libcrypto/asn1/tasn_dec.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/libcrypto/asn1/tasn_dec.c b/lib/libcrypto/asn1/tasn_dec.c
index a6614f174ed..7e416719e02 100644
--- a/lib/libcrypto/asn1/tasn_dec.c
+++ b/lib/libcrypto/asn1/tasn_dec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tasn_dec.c,v 1.55 2022/05/04 10:47:36 jsing Exp $ */
+/* $OpenBSD: tasn_dec.c,v 1.56 2022/05/04 10:53:26 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000.
*/
@@ -716,15 +716,9 @@ asn1_d2i_ex_primitive(ASN1_VALUE **pval, const unsigned char **in, long inlen,
}
content = *in;
- /* If indefinite length constructed find the real end */
- if (inf) {
- if (!asn1_find_end(&p, plen, inf))
- goto err;
- len = p - content;
- } else {
- len = p - content + plen;
- p += plen;
- }
+ if (!asn1_find_end(&p, plen, inf))
+ goto err;
+ len = p - content;
} else if (cst) {
/*
* Should really check the internal tags are correct but