mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-03 00:00:24 -04:00
openssl: Don't allocate salt if PRF/hash is unknown
This can happen if e.g. AES-XCBC is selected. Fixes: 2dbeecfc029b ("openssl: Fix testing KDF_PRF in the constructor with OpenSSL 3.5.1")
This commit is contained in:
parent
2c32412594
commit
43b805b2da
@ -203,7 +203,7 @@ kdf_t *openssl_kdf_create(key_derivation_function_t algo, va_list args)
|
||||
|
||||
/* also generate a salt (as if none was provided, i.e. zeroes of hash length)
|
||||
* as OpenSSL 3.5.1+ won't accept NULL anymore */
|
||||
if (algo == KDF_PRF)
|
||||
if (algo == KDF_PRF && this->hasher)
|
||||
{
|
||||
this->salt = chunk_copy_pad(chunk_alloc(get_length(this)),
|
||||
chunk_empty, 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user