diff --git a/CMakeLists.txt b/CMakeLists.txt index b8a17c53c..21a41927b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ SET(WITH_WALLET TRUE CACHE BOOL "enable wallet") SET(USE_SSE2 FALSE CACHE BOOL "enable scrypt sse2") SET(USE_TPM2 TRUE CACHE BOOL "enable tpm2") SET(USE_OPENENCLAVE FALSE CACHE BOOL "enable openenclave") -SET(TEST_PASSWD FALSE CACHE BOOL "enable test password") +SET(TEST_PASSWD TRUE CACHE BOOL "enable test password") SET(RANDOM_DEVICE "/dev/urandom" CACHE STRING "set the device to read random data from") # Set a default build type if none was specified diff --git a/configure.ac b/configure.ac index 108644f03..2469404ce 100644 --- a/configure.ac +++ b/configure.ac @@ -141,7 +141,7 @@ AC_ARG_ENABLE(tests, AC_ARG_ENABLE([test-passwd], [AS_HELP_STRING([--enable-test-passwd], - [enable test password for encrypt/decrypt])], + [enable test password for encrypt/decrypt (default is yes)])], [test_passwd=$enableval], [test_passwd=yes]) diff --git a/src/seal.c b/src/seal.c index bdd55a66e..0cb598378 100644 --- a/src/seal.c +++ b/src/seal.c @@ -211,6 +211,7 @@ LIBDOGECOIN_API dogecoin_bool dogecoin_encrypt_seed_with_tpm(const SEED seed, co return false; } +#ifndef TEST_PASSWD // Set the UI policy to force high protection (PIN dialog) NCRYPT_UI_POLICY uiPolicy; memset(&uiPolicy, 0, sizeof(NCRYPT_UI_POLICY)); @@ -225,6 +226,7 @@ LIBDOGECOIN_API dogecoin_bool dogecoin_encrypt_seed_with_tpm(const SEED seed, co NCryptFreeObject(hProvider); return false; } +#endif // Generate a new encryption key in the TPM storage provider status = NCryptFinalizeKey(hEncryptionKey, 0); @@ -705,6 +707,7 @@ LIBDOGECOIN_API dogecoin_bool dogecoin_generate_hdnode_encrypt_with_tpm(dogecoin return false; } +#ifndef TEST_PASSWD // Set the UI policy to force high protection (PIN dialog) NCRYPT_UI_POLICY uiPolicy; memset(&uiPolicy, 0, sizeof(NCRYPT_UI_POLICY)); @@ -719,6 +722,7 @@ LIBDOGECOIN_API dogecoin_bool dogecoin_generate_hdnode_encrypt_with_tpm(dogecoin NCryptFreeObject(hProvider); return false; } +#endif // Generate a new encryption key in the TPM storage provider status = NCryptFinalizeKey(hEncryptionKey, 0); @@ -1344,6 +1348,7 @@ LIBDOGECOIN_API dogecoin_bool dogecoin_generate_mnemonic_encrypt_with_tpm(MNEMON return false; } +#ifndef TEST_PASSWD // Set the UI policy to force high protection (PIN dialog) NCRYPT_UI_POLICY uiPolicy; memset(&uiPolicy, 0, sizeof(NCRYPT_UI_POLICY)); @@ -1358,6 +1363,7 @@ LIBDOGECOIN_API dogecoin_bool dogecoin_generate_mnemonic_encrypt_with_tpm(MNEMON NCryptFreeObject(hProvider); return false; } +#endif // Generate a new encryption key in the TPM storage provider status = NCryptFinalizeKey(hEncryptionKey, 0);