OR flags with CRYPT_SILENT to really make sure no UI pops up
authorJoey Yandle <dragon@dancingdragon.be>
Wed, 23 Dec 2015 18:39:09 +0000 (10:39 -0800)
committerRich Salz <rsalz@openssl.org>
Sun, 29 May 2016 17:36:59 +0000 (13:36 -0400)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1079)

crypto/rand/rand_win.c

index d4398ec244f88fc0290736b207756dcf9c40f223..812ca9d2c881f9c415e7dabda64760aea7a1bc50 100644 (file)
@@ -68,7 +68,7 @@ int RAND_poll(void)
 
     /* poll the CryptoAPI PRNG */
     /* The CryptoAPI returns sizeof(buf) bytes of randomness */
-    if (CryptAcquireContextW(&hProvider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
+    if (CryptAcquireContextW(&hProvider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) {
         if (CryptGenRandom(hProvider, sizeof(buf), buf) != 0) {
             RAND_add(buf, sizeof(buf), sizeof(buf));
         }
@@ -76,7 +76,7 @@ int RAND_poll(void)
     }
 
     /* poll the Pentium PRG with CryptoAPI */
-    if (CryptAcquireContextW(&hProvider, NULL, INTEL_DEF_PROV, PROV_INTEL_SEC, CRYPT_VERIFYCONTEXT)) {
+    if (CryptAcquireContextW(&hProvider, NULL, INTEL_DEF_PROV, PROV_INTEL_SEC, CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) {
         if (CryptGenRandom(hProvider, sizeof(buf), buf) != 0) {
             RAND_add(buf, sizeof(buf), sizeof(buf));
         }