summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-02-12 21:03:37 +0000
committerNick Mathewson <nickm@torproject.org>2005-02-12 21:03:37 +0000
commitf6221b695f43a3fc3daa5629e2de95a6189c9810 (patch)
tree178f7bb0c6fc3727531026c7f7d2974aa976f6aa /src/common
parent58540dde50566651dc884f58cef4262eb7ac0bd8 (diff)
downloadtor-f6221b695f43a3fc3daa5629e2de95a6189c9810.tar.gz
tor-f6221b695f43a3fc3daa5629e2de95a6189c9810.zip
Apply windows patch from Dmitri Bely
svn:r3617
Diffstat (limited to 'src/common')
-rw-r--r--src/common/crypto.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index fc69f7dd1e..5ff6c8521b 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -1399,15 +1399,15 @@ int crypto_seed_rng(void)
char buf[DIGEST_LEN+1];
if (!provider_set) {
- if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, 0)) {
+ if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, CRYPT_MACHINE_KEYSET)) {
if (GetLastError() != NTE_BAD_KEYSET) {
log_fn(LOG_ERR,"Can't get CryptoAPI provider [1]");
return -1;
}
/* Yes, we need to try it twice. */
if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL,
- CRYPT_NEWKEYSET)) {
- log_fn(LOG_ERR,"Can't get CryptoAPI provider [2]");
+ CRYPT_MACHINE_KEYSET | CRYPT_NEWKEYSET)) {
+ log_fn(LOG_ERR,"Can't get CryptoAPI provider [2], error code: %x", GetLastError());
return -1;
}
}