Merge pull request #4627 from cconlon/fipsOsSeed

This commit is contained in:
John Safranek 2021-12-06 16:06:46 -08:00 committed by GitHub
commit 261d305b32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 11 deletions

View File

@ -64,9 +64,9 @@ This library defines the interface APIs for X509 certificates.
#define WC_RSAKEY_TYPE_DEFINED
#endif
#ifndef WC_RNG_TYPE_DEFINED
typedef struct OS_Seed OS_Seed;
typedef struct WC_RNG WC_RNG;
#ifdef WC_RNG_SEED_CB
typedef struct OS_Seed OS_Seed;
typedef int (*wc_RngSeed_Cb)(OS_Seed* os, byte* seed, word32 sz);
#endif
#define WC_RNG_TYPE_DEFINED

View File

@ -130,9 +130,17 @@
#endif
#endif
#ifndef WC_RNG_TYPE_DEFINED /* guard on redeclaration */
typedef struct OS_Seed OS_Seed;
typedef struct WC_RNG WC_RNG;
#ifdef WC_RNG_SEED_CB
typedef int (*wc_RngSeed_Cb)(OS_Seed* os, byte* seed, word32 sz);
#endif
#define WC_RNG_TYPE_DEFINED
#endif
/* OS specific seeder */
typedef struct OS_Seed {
struct OS_Seed {
#if defined(USE_WINDOWS_API)
ProviderHandle handle;
#else
@ -141,13 +149,7 @@ typedef struct OS_Seed {
#if defined(WOLF_CRYPTO_CB)
int devId;
#endif
} OS_Seed;
#ifndef WC_RNG_TYPE_DEFINED /* guard on redeclaration */
typedef struct WC_RNG WC_RNG;
#define WC_RNG_TYPE_DEFINED
#endif
};
#ifdef HAVE_HASHDRBG
struct DRBG_internal {
@ -168,7 +170,7 @@ struct DRBG_internal {
/* RNG context */
struct WC_RNG {
OS_Seed seed;
struct OS_Seed seed;
void* heap;
#ifdef HAVE_HASHDRBG
/* Hash-based Deterministic Random Bit Generator */
@ -234,7 +236,6 @@ WOLFSSL_API int wc_FreeRng(WC_RNG*);
#endif
#ifdef WC_RNG_SEED_CB
typedef int (*wc_RngSeed_Cb)(OS_Seed* os, byte* seed, word32 sz);
WOLFSSL_API int wc_SetSeed_Cb(wc_RngSeed_Cb cb);
#endif