diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-08-29 13:24:29 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-08-29 13:24:29 -0400 |
commit | 42350968a9d7afb1259dfdfb4d4ec5f9aa806711 (patch) | |
tree | 844e563b14d7b218aeb1ddd445ba32473d5e514a /src/common/crypto.c | |
parent | 37a76d75dd38a1ebd45627bb6e29e40f60917188 (diff) | |
download | tor-42350968a9d7afb1259dfdfb4d4ec5f9aa806711.tar.gz tor-42350968a9d7afb1259dfdfb4d4ec5f9aa806711.zip |
Drop check for NTE_BAD_KEYSET error
Any error when acquiring the CryptoAPI context should get treated as
bad. Also, this one can't happen for the arguments we're giving.
Fixes bug 10816; bugfix on 0.0.2pre26.
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r-- | src/common/crypto.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c index a247a87d48..03a74912dd 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -2456,10 +2456,8 @@ crypto_strongest_rand(uint8_t *out, size_t out_len) if (!provider_set) { if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { - if ((unsigned long)GetLastError() != (unsigned long)NTE_BAD_KEYSET) { - log_warn(LD_CRYPTO, "Can't get CryptoAPI provider [1]"); - return -1; - } + log_warn(LD_CRYPTO, "Can't get CryptoAPI provider [1]"); + return -1; } provider_set = 1; } |