diff options
author | tb <> | 2024-07-09 16:59:07 +0000 |
---|---|---|
committer | tb <> | 2024-07-09 16:59:07 +0000 |
commit | a40b844655778ae5793e6af85703f143dca3cbe0 (patch) | |
tree | 4aaa77a5d4229b34d40b38fb877f346c5f3aba4d /src | |
parent | e9ac2106683e76d66e5ee97b3b96b8c2d55c4e2b (diff) | |
download | openbsd-a40b844655778ae5793e6af85703f143dca3cbe0.tar.gz openbsd-a40b844655778ae5793e6af85703f143dca3cbe0.tar.bz2 openbsd-a40b844655778ae5793e6af85703f143dca3cbe0.zip |
Test and assign in tls1_prf_P_hash()
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/kdf/tls1_prf.c | 13 |
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) |