summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2024-01-04 17:22:29 +0000
committertb <>2024-01-04 17:22:29 +0000
commit258a2014e5e6da7d7bc8516cdeb2ebb5a5c9d042 (patch)
tree2a6641c596638b1c425422c58ae68f89d6ca1bd8 /src
parentd0e416b67fcb7e23e0f7e1a276beb5d08487dbcd (diff)
downloadopenbsd-258a2014e5e6da7d7bc8516cdeb2ebb5a5c9d042.tar.gz
openbsd-258a2014e5e6da7d7bc8516cdeb2ebb5a5c9d042.tar.bz2
openbsd-258a2014e5e6da7d7bc8516cdeb2ebb5a5c9d042.zip
Clean up EVP_PKEY_asn1_get0_info() a bit
Use better variable names without silly p prefix and use explicit checks against NULL.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/evp/p_lib.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/lib/libcrypto/evp/p_lib.c b/src/lib/libcrypto/evp/p_lib.c
index fdddc49b00..de87220315 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.56 2024/01/04 17:17:40 tb Exp $ */ 1/* $OpenBSD: p_lib.c,v 1.57 2024/01/04 17:22:29 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 *
@@ -235,22 +235,24 @@ EVP_PKEY_asn1_find_str(ENGINE **engine, const char *str, int len)
235} 235}
236 236
237int 237int
238EVP_PKEY_asn1_get0_info(int *ppkey_id, int *ppkey_base_id, int *ppkey_flags, 238EVP_PKEY_asn1_get0_info(int *pkey_id, int *pkey_base_id, int *pkey_flags,
239 const char **pinfo, const char **ppem_str, 239 const char **info, const char **pem_str,
240 const EVP_PKEY_ASN1_METHOD *ameth) 240 const EVP_PKEY_ASN1_METHOD *ameth)
241{ 241{
242 if (!ameth) 242 if (ameth == NULL)
243 return 0; 243 return 0;
244 if (ppkey_id) 244
245 *ppkey_id = ameth->pkey_id; 245 if (pkey_id != NULL)
246 if (ppkey_base_id) 246 *pkey_id = ameth->pkey_id;
247 *ppkey_base_id = ameth->base_method->pkey_id; 247 if (pkey_base_id != NULL)
248 if (ppkey_flags) 248 *pkey_base_id = ameth->base_method->pkey_id;
249 *ppkey_flags = ameth->pkey_flags; 249 if (pkey_flags != NULL)
250 if (pinfo) 250 *pkey_flags = ameth->pkey_flags;
251 *pinfo = ameth->info; 251 if (info != NULL)
252 if (ppem_str) 252 *info = ameth->info;
253 *ppem_str = ameth->pem_str; 253 if (pem_str != NULL)
254 *pem_str = ameth->pem_str;
255
254 return 1; 256 return 1;
255} 257}
256 258