From: Pauli Date: Tue, 3 Sep 2019 04:28:47 +0000 (+1000) Subject: Clear collected_seed after freeing it X-Git-Tag: openssl-3.0.0-alpha1~1459 X-Git-Url: https://git.openssl.org/?a=commitdiff_plain;h=f575bd2af73e19b8f317a2a857ba6d1eb0ca0c14;p=openssl.git Clear collected_seed after freeing it Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/9662) --- 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;