OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 NET_CERT_SHA256_LEGACY_SUPPORT_WIN_H_ | 5 #ifndef NET_CERT_SHA256_LEGACY_SUPPORT_WIN_H_ |
6 #define NET_CERT_SHA256_LEGACY_SUPPORT_WIN_H_ | 6 #define NET_CERT_SHA256_LEGACY_SUPPORT_WIN_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <wincrypt.h> | |
10 | 9 |
| 10 #include "base/strings/string_piece.h" |
| 11 #include "crypto/wincrypt_shim.h" |
11 #include "net/base/net_export.h" | 12 #include "net/base/net_export.h" |
12 | 13 |
13 namespace net { | 14 namespace net { |
14 | 15 |
15 namespace sha256_interception { | 16 namespace sha256_interception { |
16 | 17 |
17 typedef BOOL (WINAPI* CryptVerifyCertificateSignatureExFunc)( | 18 typedef BOOL (WINAPI* CryptVerifyCertificateSignatureExFunc)( |
18 HCRYPTPROV_LEGACY provider, | 19 HCRYPTPROV_LEGACY provider, |
19 DWORD encoding_type, | 20 DWORD encoding_type, |
20 DWORD subject_type, | 21 DWORD subject_type, |
(...skipping 13 matching lines...) Expand all Loading... |
34 CryptVerifyCertificateSignatureExFunc original_func, | 35 CryptVerifyCertificateSignatureExFunc original_func, |
35 HCRYPTPROV_LEGACY provider, | 36 HCRYPTPROV_LEGACY provider, |
36 DWORD encoding_type, | 37 DWORD encoding_type, |
37 DWORD subject_type, | 38 DWORD subject_type, |
38 void* subject_data, | 39 void* subject_data, |
39 DWORD issuer_type, | 40 DWORD issuer_type, |
40 void* issuer_data, | 41 void* issuer_data, |
41 DWORD flags, | 42 DWORD flags, |
42 void* extra); | 43 void* extra); |
43 | 44 |
| 45 // Returns true if |subject_type| a supported subject type for interception. |
| 46 bool IsSupportedSubjectType(DWORD subject_type); |
| 47 |
| 48 // Returns true if |issuer_type| is a supported issuer type for interception. |
| 49 bool IsSupportedIssuerType(DWORD issuer_type); |
| 50 |
| 51 // Returns the encoded form of |subject_data| or an empty StringPiece if not |
| 52 // supported. |
| 53 base::StringPiece GetSubjectSignature(DWORD subject_type, |
| 54 void* subject_data); |
| 55 |
| 56 // Returns the public key of |issuer_data| or NULL if not supported. |
| 57 PCERT_PUBLIC_KEY_INFO GetIssuerPublicKey(DWORD issuer_type, |
| 58 void* issuer_data); |
| 59 |
44 } // namespace sha256_interception | 60 } // namespace sha256_interception |
45 | 61 |
46 } // namespace net | 62 } // namespace net |
47 | 63 |
48 #endif // NET_CERT_SHA256_LEGACY_SUPPORT_WIN_H_ | 64 #endif // NET_CERT_SHA256_LEGACY_SUPPORT_WIN_H_ |
OLD | NEW |