summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2022-05-21 13:21:42 +0000
committerjsing <>2022-05-21 13:21:42 +0000
commitb5a93ad35d68150ca701f8aa7702c2117d870aaa (patch)
treeacc071dd6dc5fa4d3c14ec7b0d794d2085f780bd /src
parentfd516a5dacac2786a735408c981c7707af150287 (diff)
downloadopenbsd-b5a93ad35d68150ca701f8aa7702c2117d870aaa.tar.gz
openbsd-b5a93ad35d68150ca701f8aa7702c2117d870aaa.tar.bz2
openbsd-b5a93ad35d68150ca701f8aa7702c2117d870aaa.zip
Remove some unhelpful comments and spell NULL correctly.
Diffstat (limited to 'src')
-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 03a4d6313b..80e185563e 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.75 2022/05/21 13:16:19 jsing Exp $ */ 1/* $OpenBSD: tasn_dec.c,v 1.76 2022/05/21 13:21:42 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 */
@@ -80,14 +80,13 @@
80/* 80/*
81 * This determines how many levels of recursion are permitted in ASN.1 string 81 * This determines how many levels of recursion are permitted in ASN.1 string
82 * types. If it is not limited stack overflows can occur. If set to zero no 82 * types. If it is not limited stack overflows can occur. If set to zero no
83 * recursion is allowed at all. Although zero should be adequate examples exist 83 * recursion is allowed at all.
84 * that require a value of 1. So 5 should be more than enough.
85 */ 84 */
86#define ASN1_MAX_STRING_NEST 5 85#define ASN1_MAX_STRING_NEST 5
87#endif 86#endif
88 87
89static int asn1_template_d2i(ASN1_VALUE **pval, CBS *cbs, 88static int asn1_template_d2i(ASN1_VALUE **pval, CBS *cbs,
90 const ASN1_TEMPLATE *tt, char optional, int depth); 89 const ASN1_TEMPLATE *at, char optional, int depth);
91 90
92static int 91static int
93asn1_check_eoc(CBS *cbs) 92asn1_check_eoc(CBS *cbs)
@@ -932,10 +931,6 @@ asn1_item_d2i_extern(ASN1_VALUE **pval, CBS *cbs, const ASN1_ITEM *it,
932 return 0; 931 return 0;
933} 932}
934 933
935/*
936 * Decode an item, taking care of IMPLICIT tagging, if any.
937 * If 'opt' set and tag mismatch return -1 to handle OPTIONAL
938 */
939static int 934static int
940asn1_item_d2i(ASN1_VALUE **pval, CBS *cbs, const ASN1_ITEM *it, 935asn1_item_d2i(ASN1_VALUE **pval, CBS *cbs, const ASN1_ITEM *it,
941 int tag_number, int tag_class, char optional, int depth) 936 int tag_number, int tag_class, char optional, int depth)
@@ -1229,7 +1224,7 @@ ASN1_item_d2i(ASN1_VALUE **pval, const unsigned char **in, long inlen,
1229 1224
1230 if (pval == NULL) 1225 if (pval == NULL)
1231 pval = &ptmpval; 1226 pval = &ptmpval;
1232 if (ASN1_item_ex_d2i(pval, in, inlen, it, -1, 0, 0, 0) <= 0) 1227 if (ASN1_item_ex_d2i(pval, in, inlen, it, -1, 0, 0, NULL) <= 0)
1233 return NULL; 1228 return NULL;
1234 1229
1235 return *pval; 1230 return *pval;
@@ -1247,7 +1242,6 @@ ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long inlen,
1247 return 0; 1242 return 0;
1248 1243
1249 CBS_init(&cbs, *in, inlen); 1244 CBS_init(&cbs, *in, inlen);
1250
1251 if ((ret = asn1_item_d2i(pval, &cbs, it, tag_number, tag_class, 1245 if ((ret = asn1_item_d2i(pval, &cbs, it, tag_number, tag_class,
1252 optional, 0)) == 1) 1246 optional, 0)) == 1)
1253 *in = CBS_data(&cbs); 1247 *in = CBS_data(&cbs);