summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2022-05-05 19:46:36 +0000
committertb <>2022-05-05 19:46:36 +0000
commit2420189943cc348e3b4c12e7cfe70a92af395fdd (patch)
tree2dce61104b777095c046513ebc5c0b268d17ddc5 /src/lib
parente239b384c274bbb6164577a84ba7007abcae93c6 (diff)
downloadopenbsd-2420189943cc348e3b4c12e7cfe70a92af395fdd.tar.gz
openbsd-2420189943cc348e3b4c12e7cfe70a92af395fdd.tar.bz2
openbsd-2420189943cc348e3b4c12e7cfe70a92af395fdd.zip
Avoid malloc(0) in EVP_PKEY_CTX_set1_hkdf_key()
ok jsing
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/kdf/hkdf_evp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/kdf/hkdf_evp.c b/src/lib/libcrypto/kdf/hkdf_evp.c
index b334c4a32d..dd79665778 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.16 2022/05/05 19:44:23 tb Exp $ */ 1/* $OpenBSD: hkdf_evp.c,v 1.17 2022/05/05 19:46:36 tb 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 *
@@ -132,7 +132,7 @@ pkey_hkdf_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
132 return 1; 132 return 1;
133 133
134 case EVP_PKEY_CTRL_HKDF_KEY: 134 case EVP_PKEY_CTRL_HKDF_KEY:
135 if (p1 < 0) 135 if (p1 <= 0)
136 return 0; 136 return 0;
137 137
138 if (kctx->key != NULL) 138 if (kctx->key != NULL)