summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authortrinity-1686a <trinity@deuxfleurs.fr>2024-04-15 11:13:14 +0200
committerTomas Mraz <tomas@openssl.org>2024-04-17 08:53:21 +0200
commit1c95d96411de59379a043fa4e60f15f7862433d3 (patch)
treef9fa35cacbd707b11512270acd7949d2e18d8ac5 /crypto
parentdfeaa1aa4e8849509e5472e9f197a48d46ace63c (diff)
Handle empty param in EVP_PKEY_CTX_add1_hkdf_info
Fixes #24130 The regression was introduced in PR #23456. Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/24141) (cherry picked from commit 299996fb1fcd76eeadfd547958de2a1b822f37f5)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/evp/pmeth_lib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c
index 65f5fcb804..0a561323f1 100644
--- a/crypto/evp/pmeth_lib.c
+++ b/crypto/evp/pmeth_lib.c
@@ -1027,6 +1027,8 @@ static int evp_pkey_ctx_add1_octet_string(EVP_PKEY_CTX *ctx, int fallback,
if (datalen < 0) {
ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_LENGTH);
return 0;
+ } else if (datalen == 0) {
+ return 1;
}
/* Get the original value length */