mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-03 04:34:41 +02:00
Merge pull request #279 from dgarske/CustRandGenSeed_OSArg
Added new CUSTOM_RAND_GENERATE_SEED_OS macro
This commit is contained in:
@@ -122,7 +122,7 @@ int wc_RNG_GenerateByte(WC_RNG* rng, byte* b)
|
||||
#ifdef HAVE_INTEL_RDGEN
|
||||
static int wc_InitRng_IntelRD(void) ;
|
||||
#if defined(HAVE_HASHDRBG) || defined(NO_RC4)
|
||||
static int wc_GenerateSeed_IntelRD(OS_Seed* os, byte* output, word32 sz) ;
|
||||
static int wc_GenerateSeed_IntelRD(OS_Seed* os, byte* output, word32 sz) ;
|
||||
#else
|
||||
static int wc_GenerateRand_IntelRD(OS_Seed* os, byte* output, word32 sz) ;
|
||||
#endif
|
||||
@@ -985,10 +985,23 @@ static int wc_GenerateRand_IntelRD(OS_Seed* os, byte* output, word32 sz)
|
||||
|
||||
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
||||
{
|
||||
(void)os;
|
||||
(void)os; /* Suppress unused arg warning */
|
||||
return CUSTOM_RAND_GENERATE_SEED(output, sz);
|
||||
}
|
||||
|
||||
#elif defined(CUSTOM_RAND_GENERATE_SEED_OS)
|
||||
|
||||
/* Implement your own random generation function,
|
||||
* which includes OS_Seed.
|
||||
* Return 0 to indicate success
|
||||
* int rand_gen_seed(OS_Seed* os, byte* output, word32 sz);
|
||||
* #define CUSTOM_RAND_GENERATE_SEED_OS rand_gen_seed */
|
||||
|
||||
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
||||
{
|
||||
return CUSTOM_RAND_GENERATE_SEED_OS(os, output, sz);
|
||||
}
|
||||
|
||||
|
||||
#elif defined(USE_WINDOWS_API)
|
||||
|
||||
|
Reference in New Issue
Block a user