summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/ameth_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1/ameth_lib.c')
-rw-r--r--src/lib/libcrypto/asn1/ameth_lib.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libcrypto/asn1/ameth_lib.c b/src/lib/libcrypto/asn1/ameth_lib.c
index 42f2f6fd52..aa4bb87667 100644
--- a/src/lib/libcrypto/asn1/ameth_lib.c
+++ b/src/lib/libcrypto/asn1/ameth_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ameth_lib.c,v 1.33 2023/11/19 15:46:09 tb Exp $ */ 1/* $OpenBSD: ameth_lib.c,v 1.34 2023/11/29 21:35:57 tb 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 2006. 3 * project 2006.
4 */ 4 */
@@ -158,6 +158,9 @@ EVP_PKEY_asn1_find(ENGINE **pe, int type)
158{ 158{
159 const EVP_PKEY_ASN1_METHOD *mp; 159 const EVP_PKEY_ASN1_METHOD *mp;
160 160
161 if (pe != NULL)
162 *pe = NULL;
163
161 for (;;) { 164 for (;;) {
162 if ((mp = pkey_asn1_find(type)) == NULL) 165 if ((mp = pkey_asn1_find(type)) == NULL)
163 break; 166 break;
@@ -165,9 +168,7 @@ EVP_PKEY_asn1_find(ENGINE **pe, int type)
165 break; 168 break;
166 type = mp->pkey_base_id; 169 type = mp->pkey_base_id;
167 } 170 }
168 if (pe) { 171
169 *pe = NULL;
170 }
171 return mp; 172 return mp;
172} 173}
173 174
@@ -179,9 +180,8 @@ EVP_PKEY_asn1_find_str(ENGINE **pe, const char *str, int len)
179 180
180 if (len == -1) 181 if (len == -1)
181 len = strlen(str); 182 len = strlen(str);
182 if (pe) { 183 if (pe != NULL)
183 *pe = NULL; 184 *pe = NULL;
184 }
185 for (i = EVP_PKEY_asn1_get_count() - 1; i >= 0; i--) { 185 for (i = EVP_PKEY_asn1_get_count() - 1; i >= 0; i--) {
186 ameth = EVP_PKEY_asn1_get0(i); 186 ameth = EVP_PKEY_asn1_get0(i);
187 if (ameth->pkey_flags & ASN1_PKEY_ALIAS) 187 if (ameth->pkey_flags & ASN1_PKEY_ALIAS)