diff options
author | kenjiro <> | 2025-05-21 03:53:20 +0000 |
---|---|---|
committer | kenjiro <> | 2025-05-21 03:53:20 +0000 |
commit | 18e1dba89cc7fe8fb5c145d47d93bef24f4caa35 (patch) | |
tree | 780bf80ce8f6bacfb3f6997c28e6a7d1f82cf725 /src/regress/lib/libcrypto | |
parent | a2c4e19629c138b7c4c868e4ddecb2717254f869 (diff) | |
download | openbsd-18e1dba89cc7fe8fb5c145d47d93bef24f4caa35.tar.gz openbsd-18e1dba89cc7fe8fb5c145d47d93bef24f4caa35.tar.bz2 openbsd-18e1dba89cc7fe8fb5c145d47d93bef24f4caa35.zip |
Add NULL checks to HKDF and TLS1-PRF EVP_PKEY cleanup functions
Check if ctx->data is NULL before calling freezero(). Also add
HKDF and TLS1-PRF to the EVP_PKEY cleanup regression test, as
they no longer crash with this change.
ok tb@
Diffstat (limited to 'src/regress/lib/libcrypto')
-rw-r--r-- | src/regress/lib/libcrypto/evp/evp_pkey_cleanup.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/regress/lib/libcrypto/evp/evp_pkey_cleanup.c b/src/regress/lib/libcrypto/evp/evp_pkey_cleanup.c index d4825f68e8..1d2fa60be7 100644 --- a/src/regress/lib/libcrypto/evp/evp_pkey_cleanup.c +++ b/src/regress/lib/libcrypto/evp/evp_pkey_cleanup.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: evp_pkey_cleanup.c,v 1.5 2024/02/29 20:02:00 tb Exp $ */ | 1 | /* $OpenBSD: evp_pkey_cleanup.c,v 1.6 2025/05/21 03:53:20 kenjiro Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> | 4 | * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> |
@@ -38,6 +38,8 @@ int pkey_ids[] = { | |||
38 | EVP_PKEY_RSA, | 38 | EVP_PKEY_RSA, |
39 | EVP_PKEY_RSA_PSS, | 39 | EVP_PKEY_RSA_PSS, |
40 | EVP_PKEY_X25519, | 40 | EVP_PKEY_X25519, |
41 | EVP_PKEY_HKDF, | ||
42 | EVP_PKEY_TLS1_PRF, | ||
41 | }; | 43 | }; |
42 | 44 | ||
43 | static const size_t N_PKEY_IDS = sizeof(pkey_ids) / sizeof(pkey_ids[0]); | 45 | static const size_t N_PKEY_IDS = sizeof(pkey_ids) / sizeof(pkey_ids[0]); |