summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorjsing <>2022-05-04 10:53:26 +0000
committerjsing <>2022-05-04 10:53:26 +0000
commit4096043004608f6bad789eab9e69b90ceb934318 (patch)
tree6b01362199dc829e226b2f77f2b24a63c5d07b94 /src/lib
parent21dee9e3c2d2e581999b77acb23abe71d3e4fc4f (diff)
downloadopenbsd-4096043004608f6bad789eab9e69b90ceb934318.tar.gz
openbsd-4096043004608f6bad789eab9e69b90ceb934318.tar.bz2
openbsd-4096043004608f6bad789eab9e69b90ceb934318.zip
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 'src/lib')
-rw-r--r--src/lib/libcrypto/asn1/tasn_dec.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/lib/libcrypto/asn1/tasn_dec.c b/src/lib/libcrypto/asn1/tasn_dec.c
index a6614f174e..7e416719e0 100644
--- a/src/lib/libcrypto/asn1/tasn_dec.c
+++ b/src/lib/libcrypto/asn1/tasn_dec.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tasn_dec.c,v 1.55 2022/05/04 10:47:36 jsing Exp $ */ 1/* $OpenBSD: tasn_dec.c,v 1.56 2022/05/04 10:53:26 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -716,15 +716,9 @@ asn1_d2i_ex_primitive(ASN1_VALUE **pval, const unsigned char **in, long inlen,
716 } 716 }
717 717
718 content = *in; 718 content = *in;
719 /* If indefinite length constructed find the real end */ 719 if (!asn1_find_end(&p, plen, inf))
720 if (inf) { 720 goto err;
721 if (!asn1_find_end(&p, plen, inf)) 721 len = p - content;
722 goto err;
723 len = p - content;
724 } else {
725 len = p - content + plen;
726 p += plen;
727 }
728 } else if (cst) { 722 } else if (cst) {
729 /* 723 /*
730 * Should really check the internal tags are correct but 724 * Should really check the internal tags are correct but