xref: /aosp_15_r20/external/cronet/base/win/wincrypt_shim.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2014 The Chromium Authors
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_WIN_WINCRYPT_SHIM_H_
6 #define BASE_WIN_WINCRYPT_SHIM_H_
7 
8 // wincrypt.h defines macros which conflict with OpenSSL's types. This header
9 // includes wincrypt and undefines the OpenSSL macros which conflict. Any
10 // Chromium headers which include wincrypt should instead include this header.
11 
12 #include <windows.h>
13 
14 #include <wincrypt.h>
15 
16 // Undefine the macros which conflict with OpenSSL and define replacements. See
17 // http://msdn.microsoft.com/en-us/library/windows/desktop/aa378145(v=vs.85).aspx
18 #undef PKCS7_SIGNER_INFO
19 #undef X509_CERT_PAIR
20 #undef X509_EXTENSIONS
21 #undef X509_NAME
22 
23 #define WINCRYPT_PKCS7_SIGNER_INFO ((LPCSTR)500)
24 #define WINCRYPT_X509_CERT_PAIR ((LPCSTR)53)
25 #define WINCRYPT_X509_EXTENSIONS ((LPCSTR)5)
26 #define WINCRYPT_X509_NAME ((LPCSTR)7)
27 
28 #endif  // BASE_WIN_WINCRYPT_SHIM_H_
29