OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BASE_CERT_VERIFY_RESULT_H_ | 5 #ifndef NET_BASE_CERT_VERIFY_RESULT_H_ |
6 #define NET_BASE_CERT_VERIFY_RESULT_H_ | 6 #define NET_BASE_CERT_VERIFY_RESULT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "net/base/cert_status_flags.h" | |
12 #include "net/base/net_export.h" | 11 #include "net/base/net_export.h" |
13 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
14 #include "net/base/x509_cert_types.h" | 13 #include "net/base/x509_cert_types.h" |
15 | 14 |
16 namespace net { | 15 namespace net { |
17 | 16 |
18 class X509Certificate; | 17 class X509Certificate; |
19 | 18 |
20 // The result of certificate verification. | 19 // The result of certificate verification. |
21 class NET_EXPORT CertVerifyResult { | 20 class NET_EXPORT CertVerifyResult { |
22 public: | 21 public: |
23 CertVerifyResult(); | 22 CertVerifyResult(); |
24 ~CertVerifyResult(); | 23 ~CertVerifyResult(); |
25 | 24 |
26 void Reset(); | 25 void Reset(); |
27 | 26 |
28 // The certificate and chain that was constructed during verification. | 27 // The certificate and chain that was constructed during verification. |
29 // Note that the though the verified certificate will match the originally | 28 // Note that the though the verified certificate will match the originally |
30 // supplied certificate, the intermediate certificates stored within may | 29 // supplied certificate, the intermediate certificates stored within may |
31 // be substantially different. In the event of a verification failure, this | 30 // be substantially different. In the event of a verification failure, this |
32 // will contain the chain as supplied by the server. This may be NULL if | 31 // will contain the chain as supplied by the server. This may be NULL if |
33 // running within the sandbox. | 32 // running within the sandbox. |
34 scoped_refptr<X509Certificate> verified_cert; | 33 scoped_refptr<X509Certificate> verified_cert; |
35 | 34 |
36 // Bitmask of CERT_STATUS_* from net/base/cert_status_flags.h. Note that | 35 // Bitmask of CERT_STATUS_* from net/base/cert_status_flags.h. Note that |
37 // these status flags apply to the certificate chain returned in | 36 // these status flags apply to the certificate chain returned in |
38 // |verified_cert|, rather than the originally supplied certificate | 37 // |verified_cert|, rather than the originally supplied certificate |
39 // chain. | 38 // chain. |
40 CertStatus cert_status; | 39 int cert_status; |
41 | 40 |
42 // Properties of the certificate chain. | 41 // Properties of the certificate chain. |
43 bool has_md5; | 42 bool has_md5; |
44 bool has_md2; | 43 bool has_md2; |
45 bool has_md4; | 44 bool has_md4; |
46 bool has_md5_ca; | 45 bool has_md5_ca; |
47 bool has_md2_ca; | 46 bool has_md2_ca; |
48 | 47 |
49 // If the certificate was successfully verified then this contains the SHA1 | 48 // If the certificate was successfully verified then this contains the SHA1 |
50 // fingerprints of the SubjectPublicKeyInfos of the chain. The fingerprint | 49 // fingerprints of the SubjectPublicKeyInfos of the chain. The fingerprint |
51 // from the leaf certificate will be the first element of the vector. | 50 // from the leaf certificate will be the first element of the vector. |
52 std::vector<SHA1Fingerprint> public_key_hashes; | 51 std::vector<SHA1Fingerprint> public_key_hashes; |
53 | 52 |
54 // is_issued_by_known_root is true if we recognise the root CA as a standard | 53 // is_issued_by_known_root is true if we recognise the root CA as a standard |
55 // root. If it isn't then it's probably the case that this certificate was | 54 // root. If it isn't then it's probably the case that this certificate was |
56 // generated by a MITM proxy whose root has been installed locally. This is | 55 // generated by a MITM proxy whose root has been installed locally. This is |
57 // meaningless if the certificate was not trusted. | 56 // meaningless if the certificate was not trusted. |
58 bool is_issued_by_known_root; | 57 bool is_issued_by_known_root; |
59 }; | 58 }; |
60 | 59 |
61 } // namespace net | 60 } // namespace net |
62 | 61 |
63 #endif // NET_BASE_CERT_VERIFY_RESULT_H_ | 62 #endif // NET_BASE_CERT_VERIFY_RESULT_H_ |
OLD | NEW |