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_CERT_CERT_VERIFY_RESULT_H_ | 5 #ifndef NET_CERT_CERT_VERIFY_RESULT_H_ |
6 #define NET_CERT_CERT_VERIFY_RESULT_H_ | 6 #define NET_CERT_CERT_VERIFY_RESULT_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/ocsp_verify_result.h" | 13 #include "net/cert/ocsp_verify_result.h" |
14 #include "net/cert/x509_cert_types.h" | 14 #include "net/cert/x509_cert_types.h" |
15 | 15 |
16 namespace net { | 16 namespace net { |
17 | 17 |
18 class X509Certificate; | 18 class X509Certificate; |
19 | 19 |
20 // The result of certificate verification. | 20 // The result of certificate verification. |
21 class NET_EXPORT CertVerifyResult { | 21 class NET_EXPORT CertVerifyResult { |
22 public: | 22 public: |
23 CertVerifyResult(); | 23 CertVerifyResult(); |
24 CertVerifyResult(const CertVerifyResult& other); | 24 CertVerifyResult(const CertVerifyResult& other); |
25 ~CertVerifyResult(); | 25 ~CertVerifyResult(); |
26 | 26 |
27 void Reset(); | 27 void Reset(); |
28 | 28 |
| 29 // Comparing CertVerifyResult with a nullptr |verified_cert| is invalid. |
29 bool operator==(const CertVerifyResult& other) const; | 30 bool operator==(const CertVerifyResult& other) const; |
30 | 31 |
31 // The certificate and chain that was constructed during verification. | 32 // The certificate chain that was constructed during verification. |
32 // Note that the though the verified certificate will match the originally | 33 // |
33 // supplied certificate, the intermediate certificates stored within may | 34 // Note: Although |verified_cert| will match the originally supplied |
34 // be substantially different. In the event of a verification failure, this | 35 // certificate to be validated, the results of GetIntermediateCertificates() |
35 // will contain the chain as supplied by the server. This may be NULL if | 36 // may be substantially different, both in order and in content, then the |
36 // running within the sandbox. | 37 // originally supplied intermediates. |
| 38 // |
| 39 // In the event of validation failures, this may contain the originally |
| 40 // supplied certificate chain or a partially constructed path, depending on |
| 41 // the implementation. |
| 42 // |
| 43 // In the event of validation success, the trust anchor will be |
| 44 // |verified_cert->GetIntermediateCertificates().back()| if |
| 45 // there was a certificate chain to the trust anchor, and will |
| 46 // be |verified_cert->os_cert_handle()| if the certificate was |
| 47 // the trust anchor. |
37 scoped_refptr<X509Certificate> verified_cert; | 48 scoped_refptr<X509Certificate> verified_cert; |
38 | 49 |
39 // Bitmask of CERT_STATUS_* from net/cert/cert_status_flags.h. Note that | 50 // Bitmask of CERT_STATUS_* from net/cert/cert_status_flags.h. Note that |
40 // these status flags apply to the certificate chain returned in | 51 // these status flags apply to the certificate chain returned in |
41 // |verified_cert|, rather than the originally supplied certificate | 52 // |verified_cert|, rather than the originally supplied certificate |
42 // chain. | 53 // chain. |
43 CertStatus cert_status; | 54 CertStatus cert_status; |
44 | 55 |
45 // Properties of the certificate chain. | 56 // Properties of the certificate chain. |
46 bool has_md2; | 57 bool has_md2; |
(...skipping 21 matching lines...) Expand all Loading... |
68 // name, rather than using the subjectAltName. | 79 // name, rather than using the subjectAltName. |
69 bool common_name_fallback_used; | 80 bool common_name_fallback_used; |
70 | 81 |
71 // Verification of stapled OCSP response, if present. | 82 // Verification of stapled OCSP response, if present. |
72 OCSPVerifyResult ocsp_result; | 83 OCSPVerifyResult ocsp_result; |
73 }; | 84 }; |
74 | 85 |
75 } // namespace net | 86 } // namespace net |
76 | 87 |
77 #endif // NET_CERT_CERT_VERIFY_RESULT_H_ | 88 #endif // NET_CERT_CERT_VERIFY_RESULT_H_ |
OLD | NEW |