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:52:51 +0200
commit299996fb1fcd76eeadfd547958de2a1b822f37f5 (patch)
treefa5c572b6c56c31d34bd9dab0d2cd405e8225542 /crypto
parentc062403abd71550057b3647b01cc8af4cc2fc18c (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)
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 */