diff --git a/src/tpm2/TpmBuildSwitches.h b/src/tpm2/TpmBuildSwitches.h index 8d3901ef..d52856d9 100644 --- a/src/tpm2/TpmBuildSwitches.h +++ b/src/tpm2/TpmBuildSwitches.h @@ -121,9 +121,12 @@ //# define RSA_INSTRUMENT #endif /* This switch enables the RNG state save and restore */ -#ifndef _DRBG_STATE_SAVE -# define _DRBG_STATE_SAVE // Comment this out if no state save is wanted +#if !(defined _DRBG_STATE_SAVE) \ + || ((_DRBG_STATE_SAVE != NO) && (_DRBG_STATE_SAVE != YES)) +# undef _DRBG_STATE_SAVE +# define _DRBG_STATE_SAVE YES // Default: Either YES or NO #endif + /* Switch added to support packed lists that leave out space associated with unimplemented commands. Comment this out to use linear lists. */ /* NOTE: if vendor specific commands are present, the associated list is always in compressed diff --git a/src/tpm2/crypto/openssl/CryptRand.c b/src/tpm2/crypto/openssl/CryptRand.c index 0363dafe..54eb18bf 100644 --- a/src/tpm2/crypto/openssl/CryptRand.c +++ b/src/tpm2/crypto/openssl/CryptRand.c @@ -626,7 +626,7 @@ CryptRandStartup( void ) { -#ifndef _DRBG_STATE_SAVE +#if !_DRBG_STATE_SAVE // If not saved in NV, re-instantiate on each startup DRBG_Instantiate(&drbgDefault, 0, NULL); #else