]> git.ipfire.org Git - thirdparty/strongswan.git/commit
openssl: Allow squeezing multiple times from SHAKE128/256 XOFs
authorTobias Brunner <tobias@strongswan.org>
Thu, 26 Mar 2020 12:52:47 +0000 (13:52 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Sun, 29 Mar 2020 10:49:52 +0000 (12:49 +0200)
commitc5c1898d73dd2fa01d601f0ef1878e57c2872678
tree43ad221fe4c1f760f1ebcb71d110118bd17fa562
parent6c98164f60f82967dd003b5d08652df70edb29a4
openssl: Allow squeezing multiple times from SHAKE128/256 XOFs

OpenSSL currently doesn't support squeezing bytes out of an XOF multiple
times.  Unfortunately, EVP_DigestFinalXOF() completely resets the context
and later calls not simply fail, they cause a null-pointer dereference in
libcrypto.  This fixes the crash at the cost of repeating initializing
the whole state and allocating too much data for subsequent calls.

There is an open issue and PR that might add a function that allows
squeezing more data from an XOF in a future version of OpenSSL.
src/libstrongswan/plugins/openssl/openssl_xof.c