From f575bd2af73e19b8f317a2a857ba6d1eb0ca0c14 Mon Sep 17 00:00:00 2001 From: Pauli Date: Tue, 3 Sep 2019 14:28:47 +1000 Subject: [PATCH] Clear collected_seed after freeing it Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/9662) --- crypto/evp/pkey_kdf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crypto/evp/pkey_kdf.c b/crypto/evp/pkey_kdf.c index f4cf40e6f4..c13bb203b3 100644 --- a/crypto/evp/pkey_kdf.c +++ b/crypto/evp/pkey_kdf.c @@ -127,8 +127,10 @@ static int pkey_kdf_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) * Perform the semantics described in * EVP_PKEY_CTX_add1_tls1_prf_seed(3) */ - if (ctx->pmeth->pkey_id == NID_tls1_prf) + if (ctx->pmeth->pkey_id == NID_tls1_prf) { BUF_MEM_free(pkctx->collected_seed); + pkctx->collected_seed = NULL; + } break; case EVP_PKEY_CTRL_TLS_SEED: cmd = T_OCTET_STRING; -- 2.39.2