summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/kdf/hkdf_evp.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/kdf/hkdf_evp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libcrypto/kdf/hkdf_evp.c b/src/lib/libcrypto/kdf/hkdf_evp.c
index b33e2e0a26..dee6e35d82 100644
--- a/src/lib/libcrypto/kdf/hkdf_evp.c
+++ b/src/lib/libcrypto/kdf/hkdf_evp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: hkdf_evp.c,v 1.20 2023/06/26 08:57:17 tb Exp $ */ 1/* $OpenBSD: hkdf_evp.c,v 1.22 2025/05/21 03:53:20 kenjiro Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2016-2018 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2016-2018 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -50,12 +50,11 @@
50#include <stdlib.h> 50#include <stdlib.h>
51#include <string.h> 51#include <string.h>
52 52
53#include <openssl/err.h>
54#include <openssl/evp.h>
55#include <openssl/hmac.h> 53#include <openssl/hmac.h>
56#include <openssl/hkdf.h> 54#include <openssl/hkdf.h>
57#include <openssl/kdf.h> 55#include <openssl/kdf.h>
58 56
57#include "err_local.h"
59#include "evp_local.h" 58#include "evp_local.h"
60 59
61#define HKDF_MAXBUF 1024 60#define HKDF_MAXBUF 1024
@@ -91,6 +90,9 @@ pkey_hkdf_cleanup(EVP_PKEY_CTX *ctx)
91{ 90{
92 HKDF_PKEY_CTX *kctx = ctx->data; 91 HKDF_PKEY_CTX *kctx = ctx->data;
93 92
93 if (kctx == NULL)
94 return;
95
94 freezero(kctx->salt, kctx->salt_len); 96 freezero(kctx->salt, kctx->salt_len);
95 freezero(kctx->key, kctx->key_len); 97 freezero(kctx->key, kctx->key_len);
96 freezero(kctx, sizeof(*kctx)); 98 freezero(kctx, sizeof(*kctx));