Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Unified Diff: net/base/keygen_handler_win.cc

Issue 2828019: Add a locked version of CryptAcquireContext (Closed)
Patch Set: Forgot one reference... Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« base/crypto/capi_util.cc ('K') | « base/crypto/capi_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/keygen_handler_win.cc
diff --git a/net/base/keygen_handler_win.cc b/net/base/keygen_handler_win.cc
index 42997b66bce119a57c332741b7bf48c273aa2d6b..3d97d17e2f54e03b4ad2e8235e326a6662cb8e1c 100644
--- a/net/base/keygen_handler_win.cc
+++ b/net/base/keygen_handler_win.cc
@@ -16,6 +16,7 @@
#include "base/base64.h"
#include "base/basictypes.h"
+#include "base/crypto/capi_util.h"
#include "base/logging.h"
#include "base/string_piece.h"
#include "base/string_util.h"
@@ -250,8 +251,9 @@ std::string KeygenHandler::GenKeyAndSignChallenge() {
// Only create new key containers, so that existing key containers are not
// overwritten.
- ok = CryptAcquireContext(&prov, new_key_id.c_str(), NULL, PROV_RSA_FULL,
- CRYPT_SILENT | CRYPT_NEWKEYSET);
+ ok = base::CryptAcquireContextLocked(&prov, new_key_id.c_str(), NULL,
+ PROV_RSA_FULL,
+ CRYPT_SILENT | CRYPT_NEWKEYSET);
if (ok || GetLastError() != NTE_BAD_KEYSET)
break;
@@ -301,8 +303,9 @@ std::string KeygenHandler::GenKeyAndSignChallenge() {
prov = NULL;
if (!stores_key_) {
// Fully destroys any of the keys that were created and releases prov.
- CryptAcquireContext(&prov, new_key_id.c_str(), NULL, PROV_RSA_FULL,
- CRYPT_SILENT | CRYPT_DELETEKEYSET);
+ base::CryptAcquireContextLocked(&prov, new_key_id.c_str(), NULL,
+ PROV_RSA_FULL,
+ CRYPT_SILENT | CRYPT_DELETEKEYSET);
}
}
« base/crypto/capi_util.cc ('K') | « base/crypto/capi_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698