OLD | NEW |
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 NET_SSL_SSL_INFO_H_ | 5 #ifndef NET_SSL_SSL_INFO_H_ |
6 #define NET_SSL_SSL_INFO_H_ | 6 #define NET_SSL_SSL_INFO_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "net/base/net_export.h" | 11 #include "net/base/net_export.h" |
12 #include "net/cert/cert_status_flags.h" | 12 #include "net/cert/cert_status_flags.h" |
13 #include "net/cert/ct_verify_result.h" | 13 #include "net/cert/ct_verify_result.h" |
14 #include "net/cert/sct_status_flags.h" | 14 #include "net/cert/sct_status_flags.h" |
15 #include "net/cert/x509_cert_types.h" | 15 #include "net/cert/x509_cert_types.h" |
16 #include "net/ssl/signed_certificate_timestamp_and_status.h" | 16 #include "net/ssl/signed_certificate_timestamp_and_status.h" |
17 #include "net/ssl/ssl_config.h" | 17 #include "net/ssl/ssl_config.h" |
18 | 18 |
19 namespace net { | 19 namespace net { |
20 | 20 |
| 21 namespace ct { |
| 22 |
| 23 enum class EVPolicyCompliance; |
| 24 |
| 25 } // namespace ct |
| 26 |
21 class X509Certificate; | 27 class X509Certificate; |
22 | 28 |
23 // SSL connection info. | 29 // SSL connection info. |
24 // This is really a struct. All members are public. | 30 // This is really a struct. All members are public. |
25 class NET_EXPORT SSLInfo { | 31 class NET_EXPORT SSLInfo { |
26 public: | 32 public: |
27 // HandshakeType enumerates the possible resumption cases after an SSL | 33 // HandshakeType enumerates the possible resumption cases after an SSL |
28 // handshake. | 34 // handshake. |
29 enum HandshakeType { | 35 enum HandshakeType { |
30 HANDSHAKE_UNKNOWN = 0, | 36 HANDSHAKE_UNKNOWN = 0, |
31 HANDSHAKE_RESUME, // we resumed a previous session. | 37 HANDSHAKE_RESUME, // we resumed a previous session. |
32 HANDSHAKE_FULL, // we negotiated a new session. | 38 HANDSHAKE_FULL, // we negotiated a new session. |
33 }; | 39 }; |
34 | 40 |
35 SSLInfo(); | 41 SSLInfo(); |
36 SSLInfo(const SSLInfo& info); | 42 SSLInfo(const SSLInfo& info); |
37 ~SSLInfo(); | 43 ~SSLInfo(); |
38 SSLInfo& operator=(const SSLInfo& info); | 44 SSLInfo& operator=(const SSLInfo& info); |
39 | 45 |
40 void Reset(); | 46 void Reset(); |
41 | 47 |
42 bool is_valid() const { return cert.get() != NULL; } | 48 bool is_valid() const { return cert.get() != NULL; } |
43 | 49 |
44 // Adds the specified |error| to the cert status. | 50 // Adds the specified |error| to the cert status. |
45 void SetCertError(int error); | 51 void SetCertError(int error); |
46 | 52 |
47 // Adds the SignedCertificateTimestamps from ct_verify_result to | 53 // Adds the SignedCertificateTimestamps and policy compliance details |
48 // |signed_certificate_timestamps|. SCTs are held in three separate vectors | 54 // from ct_verify_result to |signed_certificate_timestamps| and |
49 // in ct_verify_result, each vetor representing a particular verification | 55 // |ct_policy_compliance_details|. SCTs are held in three separate |
50 // state, this method associates each of the SCTs with the corresponding | 56 // vectors in ct_verify_result, each vetor representing a particular |
51 // SCTVerifyStatus as it adds it to the |signed_certificate_timestamps| list. | 57 // verification state, this method associates each of the SCTs with |
52 void UpdateSignedCertificateTimestamps( | 58 // the corresponding SCTVerifyStatus as it adds it to the |
| 59 // |signed_certificate_timestamps| list. |
| 60 void UpdateCertificateTransparencyInfo( |
53 const ct::CTVerifyResult& ct_verify_result); | 61 const ct::CTVerifyResult& ct_verify_result); |
54 | 62 |
55 // The SSL certificate. | 63 // The SSL certificate. |
56 scoped_refptr<X509Certificate> cert; | 64 scoped_refptr<X509Certificate> cert; |
57 | 65 |
58 // The SSL certificate as received by the client. Can be different | 66 // The SSL certificate as received by the client. Can be different |
59 // from |cert|, which is the chain as built by the client during | 67 // from |cert|, which is the chain as built by the client during |
60 // validation. | 68 // validation. |
61 scoped_refptr<X509Certificate> unverified_cert; | 69 scoped_refptr<X509Certificate> unverified_cert; |
62 | 70 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 HashValueVector public_key_hashes; | 116 HashValueVector public_key_hashes; |
109 | 117 |
110 // pinning_failure_log contains a message produced by | 118 // pinning_failure_log contains a message produced by |
111 // TransportSecurityState::PKPState::CheckPublicKeyPins in the event of a | 119 // TransportSecurityState::PKPState::CheckPublicKeyPins in the event of a |
112 // pinning failure. It is a (somewhat) human-readable string. | 120 // pinning failure. It is a (somewhat) human-readable string. |
113 std::string pinning_failure_log; | 121 std::string pinning_failure_log; |
114 | 122 |
115 // List of SignedCertificateTimestamps and their corresponding validation | 123 // List of SignedCertificateTimestamps and their corresponding validation |
116 // status. | 124 // status. |
117 SignedCertificateTimestampAndStatusList signed_certificate_timestamps; | 125 SignedCertificateTimestampAndStatusList signed_certificate_timestamps; |
| 126 |
| 127 // True if Certificate Transparency policies were applied on this |
| 128 // connection and results are available. If true, the field below |
| 129 // (|ev_policy_compliance|) will contain information about whether |
| 130 // the connection complied with the policy and why the connection |
| 131 // was considered non-compliant, if applicable. |
| 132 bool ct_compliance_details_available; |
| 133 |
| 134 // Whether the connection complied with the CT EV policy, and if not, |
| 135 // why not. Only meaningful if |ct_compliance_details_available| is |
| 136 // true. |
| 137 ct::EVPolicyCompliance ct_ev_policy_compliance; |
118 }; | 138 }; |
119 | 139 |
120 } // namespace net | 140 } // namespace net |
121 | 141 |
122 #endif // NET_SSL_SSL_INFO_H_ | 142 #endif // NET_SSL_SSL_INFO_H_ |
OLD | NEW |