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/sct_status_flags.h" | |
13 #include "net/cert/x509_cert_types.h" | 14 #include "net/cert/x509_cert_types.h" |
14 | 15 |
16 class Pickle; | |
17 class PickleIterator; | |
18 | |
15 namespace net { | 19 namespace net { |
16 | 20 |
21 namespace ct { | |
22 class SignedCertificateTimestamp; | |
23 } | |
24 | |
17 class X509Certificate; | 25 class X509Certificate; |
18 | 26 |
27 struct SignedCertificateTimestampAndStatus { | |
wtc
2013/11/27 16:32:41
Nit: this struct probably should be declared in a
alcutter
2013/11/27 18:05:55
Done.
| |
28 SignedCertificateTimestampAndStatus( | |
29 const scoped_refptr<ct::SignedCertificateTimestamp>& sct, | |
30 SignedCertificateTimestampVerificationStatus status); | |
31 | |
32 scoped_refptr<ct::SignedCertificateTimestamp> sct_; | |
33 SignedCertificateTimestampVerificationStatus status_; | |
34 }; | |
35 | |
36 typedef std::vector<SignedCertificateTimestampAndStatus> | |
37 SignedCertificateTimestampAndStatusList; | |
38 | |
19 // SSL connection info. | 39 // SSL connection info. |
20 // This is really a struct. All members are public. | 40 // This is really a struct. All members are public. |
21 class NET_EXPORT SSLInfo { | 41 class NET_EXPORT SSLInfo { |
22 public: | 42 public: |
23 // HandshakeType enumerates the possible resumption cases after an SSL | 43 // HandshakeType enumerates the possible resumption cases after an SSL |
24 // handshake. | 44 // handshake. |
25 enum HandshakeType { | 45 enum HandshakeType { |
26 HANDSHAKE_UNKNOWN = 0, | 46 HANDSHAKE_UNKNOWN = 0, |
27 HANDSHAKE_RESUME, // we resumed a previous session. | 47 HANDSHAKE_RESUME, // we resumed a previous session. |
28 HANDSHAKE_FULL, // we negotiated a new session. | 48 HANDSHAKE_FULL, // we negotiated a new session. |
29 }; | 49 }; |
30 | 50 |
31 SSLInfo(); | 51 SSLInfo(); |
32 SSLInfo(const SSLInfo& info); | 52 SSLInfo(const SSLInfo& info); |
33 ~SSLInfo(); | 53 ~SSLInfo(); |
34 SSLInfo& operator=(const SSLInfo& info); | 54 SSLInfo& operator=(const SSLInfo& info); |
35 | 55 |
36 void Reset(); | 56 void Reset(); |
37 | 57 |
38 bool is_valid() const { return cert.get() != NULL; } | 58 bool is_valid() const { return cert.get() != NULL; } |
39 | 59 |
40 // Adds the specified |error| to the cert status. | 60 // Adds the specified |error| to the cert status. |
41 void SetCertError(int error); | 61 void SetCertError(int error); |
42 | 62 |
43 // The SSL certificate. | 63 // The SSL certificate. |
44 scoped_refptr<X509Certificate> cert; | 64 scoped_refptr<X509Certificate> cert; |
45 | 65 |
66 // List of SignedCertificateTimestamps and their corresponding validation | |
67 // status. | |
68 SignedCertificateTimestampAndStatusList signed_certificate_timestamps; | |
wtc
2013/11/27 16:32:41
I suggest moving this member after |cert_status|,
alcutter
2013/11/27 18:05:55
Done.
| |
69 | |
46 // Bitmask of status info of |cert|, representing, for example, known errors | 70 // Bitmask of status info of |cert|, representing, for example, known errors |
47 // and extended validation (EV) status. | 71 // and extended validation (EV) status. |
48 // See cert_status_flags.h for values. | 72 // See cert_status_flags.h for values. |
49 CertStatus cert_status; | 73 CertStatus cert_status; |
50 | 74 |
51 // The security strength, in bits, of the SSL cipher suite. | 75 // The security strength, in bits, of the SSL cipher suite. |
52 // 0 means the connection is not encrypted. | 76 // 0 means the connection is not encrypted. |
53 // -1 means the security strength is unknown. | 77 // -1 means the security strength is unknown. |
54 int security_bits; | 78 int security_bits; |
55 | 79 |
(...skipping 16 matching lines...) Expand all Loading... | |
72 HandshakeType handshake_type; | 96 HandshakeType handshake_type; |
73 | 97 |
74 // The hashes, in several algorithms, of the SubjectPublicKeyInfos from | 98 // The hashes, in several algorithms, of the SubjectPublicKeyInfos from |
75 // each certificate in the chain. | 99 // each certificate in the chain. |
76 HashValueVector public_key_hashes; | 100 HashValueVector public_key_hashes; |
77 }; | 101 }; |
78 | 102 |
79 } // namespace net | 103 } // namespace net |
80 | 104 |
81 #endif // NET_SSL_SSL_INFO_H_ | 105 #endif // NET_SSL_SSL_INFO_H_ |
OLD | NEW |