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

Side by Side Diff: base/crypto/capi_util.h

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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BASE_CRYPTO_CAPI_UTIL_H_
6 #define BASE_CRYPTO_CAPI_UTIl_H_
7
8 #include <windows.h>
9 #include <wincrypt.h>
10
11 namespace base {
12
13 // CryptAcquireContext when passed CRYPT_NEWKEYSET or CRYPT_DELETEKEYSET in
14 // flags is not thread-safe. For such calls, we create a global lock to
15 // synchronize it.
16 //
17 // From "Threading Issues with Cryptographic Service Providers",
18 // <http://msdn.microsoft.com/en-us/library/aa388149(v=VS.85).aspx>:
19 //
20 // "The CryptAcquireContext function is generally thread safe unless
21 // CRYPT_NEWKEYSET or CRYPT_DELETEKEYSET is specified in the dwFlags
22 // parameter."
23 BOOL CryptAcquireContextLocked(HCRYPTPROV* prov,
wtc 2010/06/23 16:44:15 Suggestion for future work: also add CryptoAcquire
24 const TCHAR* container,
25 const TCHAR* provider,
26 DWORD prov_type,
27 DWORD flags);
28
29 } // namespace base
30
31 #endif // BASE_CRYPTO_CAPI_UTIl_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698