From 04511bafa6087918d0d72576d4acf3a2c1bc323d Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 26 Aug 2020 10:38:36 -0600 Subject: [PATCH] add guard on file system use in example client --- examples/client/client.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/examples/client/client.c b/examples/client/client.c index 759a9a2..c1e5752 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -894,10 +894,15 @@ THREAD_RETURN WOLFSSH_THREAD client_test(void* args) if (ret != 0) err_sys("Couldn't load private key buffer."); } else { + #ifndef NO_FILESYSTEM ret = wolfSSH_ReadKey_file(privKeyName, (byte**)&userPrivateKey, &userPrivateKeySz, (const byte**)&userPrivateKeyType, &userPrivateKeyTypeSz, &isPrivate, NULL); + #else + printf("file system not compiled in!\n"); + ret = -1; + #endif if (ret != 0) err_sys("Couldn't load private key file."); } @@ -922,6 +927,7 @@ THREAD_RETURN WOLFSSH_THREAD client_test(void* args) if (ret != 0) err_sys("Couldn't load public key buffer."); } else { + #ifndef NO_FILESYSTEM byte* p = userPublicKey; userPublicKeySz = sizeof(userPublicKey); @@ -929,6 +935,10 @@ THREAD_RETURN WOLFSSH_THREAD client_test(void* args) &p, &userPublicKeySz, (const byte**)&userPublicKeyType, &userPublicKeyTypeSz, &isPrivate, NULL); + #else + printf("file system not compiled in!\n"); + ret = -1; + #endif if (ret != 0) err_sys("Couldn't load public key file."); }