Skip to content

Commit 91d5c0a

Browse files
authored
fix error: implicit declaration of function 'wc_SSH_KDF'
hopefully resolves #781 when compiling with ./configure --enable-static --disable-shared --enable-scp --enable-sftp --enable-shell --enable-cryptonly --with-wolfssl=wolfssl/install/ I got: $ make -j20 make -j17 all-am make[1]: warning: -j17 forced in submake: resetting jobserver mode. make[1]: Entering directory '/home/hans/projects/wolfssh' CC src/libwolfssh_la-internal.lo src/internal.c: In function 'GenerateKey': src/internal.c:2348:15: error: implicit declaration of function 'wc_SSH_KDF'; did you mean 'wc_HKDF'? [-Werror=implicit-function-declaration] 2348 | ret = wc_SSH_KDF(hashId, keyId, key, keySz, | ^~~~~~~~~~ | wc_HKDF src/internal.c:2348:15: error: nested extern declaration of 'wc_SSH_KDF' [-Werror=nested-externs] cc1: all warnings being treated as errors make[1]: *** [Makefile:1483: src/libwolfssh_la-internal.lo] Error 1 make[1]: Leaving directory '/home/hans/projects/wolfssh' make: *** [Makefile:1020: all] Error 2
1 parent 967d6c5 commit 91d5c0a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/internal.c

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

51-
#if (LIBWOLFSSL_VERSION_HEX >= WOLFSSL_V5_0_0) \
51+
#if defined(WOLFSSL_WOLFSSH) \
52+
&& (LIBWOLFSSL_VERSION_HEX >= WOLFSSL_V5_0_0) \
5253
&& ((defined(HAVE_FIPS) && FIPS_VERSION_GE(5,2)) \
5354
|| defined(WOLFSSH_NO_NISTP256_MLKEM768_SHA256))
5455
#include <wolfssl/wolfcrypt/kdf.h>
@@ -2330,7 +2331,8 @@ int GenerateKey(byte hashId, byte keyId,
23302331
const byte* h, word32 hSz,
23312332
const byte* sessionId, word32 sessionIdSz,
23322333
byte doKeyPad)
2333-
#if (LIBWOLFSSL_VERSION_HEX >= WOLFSSL_V5_0_0) \
2334+
#if defined(WOLFSSL_WOLFSSH) \
2335+
&& (LIBWOLFSSL_VERSION_HEX >= WOLFSSL_V5_0_0) \
23342336
&& ((defined(HAVE_FIPS) && FIPS_VERSION_GE(5,2)) \
23352337
|| defined(WOLFSSH_NO_NISTP256_MLKEM768_SHA256))
23362338
/* Cannot use the SSH KDF with ML-KEM. With ML-KEM, doKeyPad must be false,

0 commit comments

Comments
 (0)