summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2024-07-09 16:59:07 +0000
committertb <>2024-07-09 16:59:07 +0000
commita40b844655778ae5793e6af85703f143dca3cbe0 (patch)
tree4aaa77a5d4229b34d40b38fb877f346c5f3aba4d
parente9ac2106683e76d66e5ee97b3b96b8c2d55c4e2b (diff)
downloadopenbsd-a40b844655778ae5793e6af85703f143dca3cbe0.tar.gz
openbsd-a40b844655778ae5793e6af85703f143dca3cbe0.tar.bz2
openbsd-a40b844655778ae5793e6af85703f143dca3cbe0.zip
Test and assign in tls1_prf_P_hash()
-rw-r--r--src/lib/libcrypto/kdf/tls1_prf.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/lib/libcrypto/kdf/tls1_prf.c b/src/lib/libcrypto/kdf/tls1_prf.c
index bb97b2f723..9fd7565c49 100644
--- a/src/lib/libcrypto/kdf/tls1_prf.c
+++ b/src/lib/libcrypto/kdf/tls1_prf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls1_prf.c,v 1.25 2024/07/09 16:58:13 tb Exp $ */ 1/* $OpenBSD: tls1_prf.c,v 1.26 2024/07/09 16:59:07 tb Exp $ */
2/* 2/*
3 * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project 3 * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
4 * 2016. 4 * 2016.
@@ -261,12 +261,15 @@ tls1_prf_P_hash(const EVP_MD *md,
261 if ((chunk = EVP_MD_size(md)) < 0) 261 if ((chunk = EVP_MD_size(md)) < 0)
262 goto err; 262 goto err;
263 263
264 ctx = EVP_MD_CTX_new(); 264 if ((ctx = EVP_MD_CTX_new()) == NULL)
265 ctx_tmp = EVP_MD_CTX_new();
266 ctx_init = EVP_MD_CTX_new();
267 if (ctx == NULL || ctx_tmp == NULL || ctx_init == NULL)
268 goto err; 265 goto err;
266 if ((ctx_tmp = EVP_MD_CTX_new()) == NULL)
267 goto err;
268 if ((ctx_init = EVP_MD_CTX_new()) == NULL)
269 goto err;
270
269 EVP_MD_CTX_set_flags(ctx_init, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); 271 EVP_MD_CTX_set_flags(ctx_init, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
272
270 mac_key = EVP_PKEY_new_raw_private_key(EVP_PKEY_HMAC, NULL, secret, 273 mac_key = EVP_PKEY_new_raw_private_key(EVP_PKEY_HMAC, NULL, secret,
271 sec_len); 274 sec_len);
272 if (mac_key == NULL) 275 if (mac_key == NULL)