Chromium Code Reviews| 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. | |
|
Ryan Sleevi
2017/01/09 23:20:14
Why? Are you documenting implementation details or
eroman
2017/01/09 23:33:12
I was documenting the current behavior, which reli
| |
| 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 and chain that was constructed during verification. |
| 32 // Note that the though the verified certificate will match the originally | 33 // Note that the though the verified certificate will match the originally |
| 33 // supplied certificate, the intermediate certificates stored within may | 34 // supplied certificate, the intermediate certificates stored within may |
| 34 // be substantially different. In the event of a verification failure, this | 35 // be substantially different (both their order and their content). |
| 35 // will contain the chain as supplied by the server. This may be NULL if | 36 // In the event of a verification failure, |verified_cert| may contain a |
| 36 // running within the sandbox. | 37 // partially constructed path, or the original chain. |
|
Ryan Sleevi
2017/01/09 23:20:14
s/, / /
eroman
2017/01/09 23:33:12
Done.
| |
| 38 // In the case of successful verification the trust anchor is the final | |
| 39 // intermediate, or the target certificate if there are no intermediates. | |
|
Ryan Sleevi
2017/01/09 23:20:14
Documentation wise, there's also some pre-existing
eroman
2017/01/09 23:33:12
Done.
| |
| 37 scoped_refptr<X509Certificate> verified_cert; | 40 scoped_refptr<X509Certificate> verified_cert; |
| 38 | 41 |
| 39 // Bitmask of CERT_STATUS_* from net/cert/cert_status_flags.h. Note that | 42 // Bitmask of CERT_STATUS_* from net/cert/cert_status_flags.h. Note that |
| 40 // these status flags apply to the certificate chain returned in | 43 // these status flags apply to the certificate chain returned in |
| 41 // |verified_cert|, rather than the originally supplied certificate | 44 // |verified_cert|, rather than the originally supplied certificate |
| 42 // chain. | 45 // chain. |
| 43 CertStatus cert_status; | 46 CertStatus cert_status; |
| 44 | 47 |
| 45 // Properties of the certificate chain. | 48 // Properties of the certificate chain. |
| 46 bool has_md2; | 49 bool has_md2; |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 68 // name, rather than using the subjectAltName. | 71 // name, rather than using the subjectAltName. |
| 69 bool common_name_fallback_used; | 72 bool common_name_fallback_used; |
| 70 | 73 |
| 71 // Verification of stapled OCSP response, if present. | 74 // Verification of stapled OCSP response, if present. |
| 72 OCSPVerifyResult ocsp_result; | 75 OCSPVerifyResult ocsp_result; |
| 73 }; | 76 }; |
| 74 | 77 |
| 75 } // namespace net | 78 } // namespace net |
| 76 | 79 |
| 77 #endif // NET_CERT_CERT_VERIFY_RESULT_H_ | 80 #endif // NET_CERT_CERT_VERIFY_RESULT_H_ |
| OLD | NEW |