Skip to content

Commit 6393a6c

Browse files
committed
KDF Fix
1. While checking the version of wolfSSL used with wolfSSH, also check that wolfSSL has the wolfSSH required options configured. This clears up a guard issue around the function `wc_SSH_KDF()`. The change makes sure wolfSSH falls back on its own version of the function if wolfSSL's isn't present.
1 parent 967d6c5 commit 6393a6c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/internal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
#include <wolfssl/wolfcrypt/hmac.h>
4949
#include <wolfssl/wolfcrypt/signature.h>
5050

51-
#if (LIBWOLFSSL_VERSION_HEX >= WOLFSSL_V5_0_0) \
51+
#if (LIBWOLFSSL_VERSION_HEX >= WOLFSSL_V5_0_0) && defined(WOLFSSL_WOLFSSH) \
5252
&& ((defined(HAVE_FIPS) && FIPS_VERSION_GE(5,2)) \
5353
|| defined(WOLFSSH_NO_NISTP256_MLKEM768_SHA256))
5454
#include <wolfssl/wolfcrypt/kdf.h>
@@ -2330,7 +2330,7 @@ int GenerateKey(byte hashId, byte keyId,
23302330
const byte* h, word32 hSz,
23312331
const byte* sessionId, word32 sessionIdSz,
23322332
byte doKeyPad)
2333-
#if (LIBWOLFSSL_VERSION_HEX >= WOLFSSL_V5_0_0) \
2333+
#if (LIBWOLFSSL_VERSION_HEX >= WOLFSSL_V5_0_0) && defined(WOLFSSL_WOLFSSH) \
23342334
&& ((defined(HAVE_FIPS) && FIPS_VERSION_GE(5,2)) \
23352335
|| defined(WOLFSSH_NO_NISTP256_MLKEM768_SHA256))
23362336
/* Cannot use the SSH KDF with ML-KEM. With ML-KEM, doKeyPad must be false,

0 commit comments

Comments
 (0)