summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2024-01-05 21:22:01 +0000
committertb <>2024-01-05 21:22:01 +0000
commitc75f680fbdc8f13b45b60c1e3502617bea21071d (patch)
tree46f6dc335a372324005920e45fc5940e164130fe
parent7753cbaaa386f7f0506a56f490f809a7db3cf639 (diff)
downloadopenbsd-c75f680fbdc8f13b45b60c1e3502617bea21071d.tar.gz
openbsd-c75f680fbdc8f13b45b60c1e3502617bea21071d.tar.bz2
openbsd-c75f680fbdc8f13b45b60c1e3502617bea21071d.zip
EVP_PKEY_asn1_find_str() tweaks
Switch i to a size_t and improve a flag check. Part of an earlier diff that was ok jsing but were lost when I reworked the diff.
-rw-r--r--src/lib/libcrypto/evp/p_lib.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/libcrypto/evp/p_lib.c b/src/lib/libcrypto/evp/p_lib.c
index de87220315..558c89d427 100644
--- a/src/lib/libcrypto/evp/p_lib.c
+++ b/src/lib/libcrypto/evp/p_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_lib.c,v 1.57 2024/01/04 17:22:29 tb Exp $ */ 1/* $OpenBSD: p_lib.c,v 1.58 2024/01/05 21:22:01 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -208,8 +208,7 @@ const EVP_PKEY_ASN1_METHOD *
208EVP_PKEY_asn1_find_str(ENGINE **engine, const char *str, int len) 208EVP_PKEY_asn1_find_str(ENGINE **engine, const char *str, int len)
209{ 209{
210 const EVP_PKEY_ASN1_METHOD *ameth; 210 const EVP_PKEY_ASN1_METHOD *ameth;
211 size_t str_len; 211 size_t i, str_len;
212 int i;
213 212
214 if (engine != NULL) 213 if (engine != NULL)
215 *engine = NULL; 214 *engine = NULL;
@@ -223,7 +222,7 @@ EVP_PKEY_asn1_find_str(ENGINE **engine, const char *str, int len)
223 222
224 for (i = 0; i < N_ASN1_METHODS; i++) { 223 for (i = 0; i < N_ASN1_METHODS; i++) {
225 ameth = asn1_methods[i]; 224 ameth = asn1_methods[i];
226 if (ameth->pkey_flags & ASN1_PKEY_ALIAS) 225 if ((ameth->pkey_flags & ASN1_PKEY_ALIAS) != 0)
227 continue; 226 continue;
228 if (strlen(ameth->pem_str) != str_len) 227 if (strlen(ameth->pem_str) != str_len)
229 continue; 228 continue;