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

Side by Side Diff: crypto/scoped_capi_types.h

Issue 686883002: Add crypto/wincrypt_shim.h wrapper header to resolve BoringSSL conflicts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sleevi comments Created 6 years, 1 month 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
« no previous file with comments | « crypto/hmac_win.cc ('k') | crypto/wincrypt_shim.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CRYPTO_SCOPED_CAPI_TYPES_H_ 5 #ifndef CRYPTO_SCOPED_CAPI_TYPES_H_
6 #define CRYPTO_SCOPED_CAPI_TYPES_H_ 6 #define CRYPTO_SCOPED_CAPI_TYPES_H_
7 7
8 #include <windows.h> 8 #include <windows.h>
9 #include <wincrypt.h>
10 9
11 #include <algorithm> 10 #include <algorithm>
12 11
13 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "crypto/wincrypt_shim.h"
14 14
15 namespace crypto { 15 namespace crypto {
16 16
17 // Simple destructor for the Free family of CryptoAPI functions, such as 17 // Simple destructor for the Free family of CryptoAPI functions, such as
18 // CryptDestroyHash, which take only a single argument to release. 18 // CryptDestroyHash, which take only a single argument to release.
19 template <typename CAPIHandle, BOOL (WINAPI *Destroyer)(CAPIHandle)> 19 template <typename CAPIHandle, BOOL (WINAPI *Destroyer)(CAPIHandle)>
20 struct CAPIDestroyer { 20 struct CAPIDestroyer {
21 void operator()(CAPIHandle handle) const { 21 void operator()(CAPIHandle handle) const {
22 if (handle) { 22 if (handle) {
23 BOOL ok = Destroyer(handle); 23 BOOL ok = Destroyer(handle);
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 typedef ScopedCAPIHandle< 113 typedef ScopedCAPIHandle<
114 HCRYPTKEY, CAPIDestroyer<HCRYPTKEY, CryptDestroyKey> > ScopedHCRYPTKEY; 114 HCRYPTKEY, CAPIDestroyer<HCRYPTKEY, CryptDestroyKey> > ScopedHCRYPTKEY;
115 115
116 typedef ScopedCAPIHandle< 116 typedef ScopedCAPIHandle<
117 HCRYPTHASH, CAPIDestroyer<HCRYPTHASH, CryptDestroyHash> > ScopedHCRYPTHASH; 117 HCRYPTHASH, CAPIDestroyer<HCRYPTHASH, CryptDestroyHash> > ScopedHCRYPTHASH;
118 118
119 } // namespace crypto 119 } // namespace crypto
120 120
121 #endif // CRYPTO_SCOPED_CAPI_TYPES_H_ 121 #endif // CRYPTO_SCOPED_CAPI_TYPES_H_
OLDNEW
« no previous file with comments | « crypto/hmac_win.cc ('k') | crypto/wincrypt_shim.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698