diff options
| author | tb <> | 2024-01-04 17:22:29 +0000 |
|---|---|---|
| committer | tb <> | 2024-01-04 17:22:29 +0000 |
| commit | 744f9b9df3bd01a4f216013bf31f8d1151043177 (patch) | |
| tree | 2a6641c596638b1c425422c58ae68f89d6ca1bd8 /src | |
| parent | 09c97e934e48b9980d4d7b55672f170e9e0c5a14 (diff) | |
| download | openbsd-744f9b9df3bd01a4f216013bf31f8d1151043177.tar.gz openbsd-744f9b9df3bd01a4f216013bf31f8d1151043177.tar.bz2 openbsd-744f9b9df3bd01a4f216013bf31f8d1151043177.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.c | 30 |
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 | ||
| 237 | int | 237 | int |
| 238 | EVP_PKEY_asn1_get0_info(int *ppkey_id, int *ppkey_base_id, int *ppkey_flags, | 238 | EVP_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 | ||
