From: Greg Hudson Date: Tue, 4 Oct 2011 15:11:45 +0000 (+0000) Subject: Improve k5_get_os_entropy for Windows X-Git-Tag: krb5-1.10-alpha1~78 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a046e6135690f97adfa6bb4065d7367cf6142c40;p=krb5.git Improve k5_get_os_entropy for Windows When acquiring a crypto context for CryptGenRandom, pass CRYPT_VERIFYCONTEXT to indicate that we don't need access to private keys. Appears to make OS entropy work on Windows XP. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25297 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/crypto/krb/prng.c b/src/lib/crypto/krb/prng.c index bed2a46b9..e478b198d 100644 --- a/src/lib/crypto/krb/prng.c +++ b/src/lib/crypto/krb/prng.c @@ -41,7 +41,8 @@ k5_get_os_entropy(unsigned char *buf, size_t len) krb5_boolean result; HCRYPTPROV provider; - if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, 0)) + if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, + CRYPT_VERIFYCONTEXT)) return FALSE; result = CryptGenRandom(provider, len, buf); (void)CryptReleaseContext(provider, 0);