Skip to content

Commit 10ba02f

Browse files
committed
linuxkm/lkcapi_sha_glue.c: add -wolfentropy and/or -rdseed to WOLFKM_STDRNG_DRIVER to advertise the seed source.
1 parent f84377e commit 10ba02f

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

linuxkm/lkcapi_sha_glue.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,29 @@
110110
* exhaustion. A caller that really needs PR can pass in seed data in its call
111111
* to our rng_alg.generate() implementation.
112112
*/
113+
114+
#ifdef HAVE_ENTROPY_MEMUSE
115+
#define WOLFKM_STDRNG_WOLFENTROPY "-wolfentropy"
116+
#else
117+
#define WOLFKM_STDRNG_WOLFENTROPY ""
118+
#endif
119+
120+
#if defined(HAVE_INTEL_RDSEED) || defined(HAVE_AMD_RDSEED)
121+
#define WOLFKM_STDRNG_RDSEED "-rdseed"
122+
#else
123+
#define WOLFKM_STDRNG_RDSEED ""
124+
#endif
125+
113126
#ifdef LINUXKM_DRBG_GET_RANDOM_BYTES
114127
#define WOLFKM_STDRNG_DRIVER ("sha2-256-drbg-nopr" \
128+
WOLFKM_STDRNG_WOLFENTROPY \
129+
WOLFKM_STDRNG_RDSEED \
115130
WOLFKM_DRIVER_SUFFIX_BASE \
116131
"-with-global-replace")
117132
#else
118133
#define WOLFKM_STDRNG_DRIVER ("sha2-256-drbg-nopr" \
134+
WOLFKM_STDRNG_WOLFENTROPY \
135+
WOLFKM_STDRNG_RDSEED \
119136
WOLFKM_DRIVER_SUFFIX_BASE)
120137
#endif
121138

0 commit comments

Comments
 (0)