Fixes for building with WC_NO_RNG.

This commit is contained in:
David Garske
2018-09-13 13:23:55 -07:00
parent 66dc735454
commit 77cd361bca
4 changed files with 7 additions and 0 deletions

View File

@ -510,6 +510,7 @@ static int ClientBenchmarkThroughput(WOLFSSL_CTX* ctx, char* host, word16 port,
else {
err_sys("wc_InitRng failed");
}
(void)rng; /* for WC_NO_RNG case */
}
else {
err_sys("Client buffer malloc failed");

View File

@ -20611,6 +20611,9 @@ static int test_wc_RNG_GenerateBlock(void)
wc_FreeRng(&rng);
(void)rng; /* for WC_NO_RNG case */
(void)key;
return ret;
}
#endif

View File

@ -2858,6 +2858,7 @@ static WC_INLINE const char* mymktemp(char *tempfn, int len, int num)
tempfn[len] = '\0';
wc_FreeRng(&rng);
(void)rng; /* for WC_NO_RNG case */
return tempfn;
}
@ -2973,6 +2974,7 @@ static WC_INLINE word16 GetRandomPort(void)
port |= 0xC000; /* Make sure its in the 49152 - 65535 range */
wc_FreeRng(&rng);
}
(void)rng; /* for WC_NO_RNG case */
return port;
}

View File

@ -188,6 +188,7 @@ WOLFSSL_API int wc_RNG_GenerateBlock(WC_RNG*, byte*, word32 sz);
WOLFSSL_API int wc_RNG_GenerateByte(WC_RNG*, byte*);
WOLFSSL_API int wc_FreeRng(WC_RNG*);
#else
#include <wolfssl/wolfcrypt/error-crypt.h>
#define wc_InitRng(rng) NOT_COMPILED_IN
#define wc_InitRng_ex(rng, h, d) NOT_COMPILED_IN
#define wc_InitRngNonce(rng, n, s) NOT_COMPILED_IN