]> git.ipfire.org Git - thirdparty/hostap.git/commit
OpenSSL: Fix HPKE in some corner cases
authorJouni Malinen <quic_jouni@quicinc.com>
Wed, 24 Aug 2022 20:28:20 +0000 (23:28 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 24 Aug 2022 20:32:23 +0000 (23:32 +0300)
commit820211245bf005040afbc8c3c9a0a1b67f8f56ac
tree97cd521c65f5d85f350a402df85674ef98a7a628
parent57968faea5b87ab5f6d43e50276bd047bd07c168
OpenSSL: Fix HPKE in some corner cases

EVP_PKEY_derive() might report a larger maximum size of the output than
HPKE_MAX_SHARED_SECRET_LEN under some conditions. That should be allowed
as long as the real final length is within the maximum limit.
Furthermore, since we are using a fixed length buffer for this, there is
no need to call EVP_PKEY_derive() twice to first learn the maximum
length. Use a bit longer buffer and allow OpenSSL to take care of the
update to the final length internally with than single call.

This showed up using the following test case sequence:
dbus_pkcs11 dpp_private_peer_introduction

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/crypto/crypto_openssl.c