From 18e1dba89cc7fe8fb5c145d47d93bef24f4caa35 Mon Sep 17 00:00:00 2001 From: kenjiro <> Date: Wed, 21 May 2025 03:53:20 +0000 Subject: 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@ --- src/regress/lib/libcrypto/evp/evp_pkey_cleanup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/regress') 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 @@ -/* $OpenBSD: evp_pkey_cleanup.c,v 1.5 2024/02/29 20:02:00 tb Exp $ */ +/* $OpenBSD: evp_pkey_cleanup.c,v 1.6 2025/05/21 03:53:20 kenjiro Exp $ */ /* * Copyright (c) 2022 Theo Buehler @@ -38,6 +38,8 @@ int pkey_ids[] = { EVP_PKEY_RSA, EVP_PKEY_RSA_PSS, EVP_PKEY_X25519, + EVP_PKEY_HKDF, + EVP_PKEY_TLS1_PRF, }; static const size_t N_PKEY_IDS = sizeof(pkey_ids) / sizeof(pkey_ids[0]); -- cgit v1.2.3-55-g6feb