| 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_CERT_CERT_VERIFY_PROC_H_ | 5 #ifndef NET_CERT_CERT_VERIFY_PROC_H_ |
| 6 #define NET_CERT_CERT_VERIFY_PROC_H_ | 6 #define NET_CERT_CERT_VERIFY_PROC_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 virtual ~CertVerifyProc(); | 82 virtual ~CertVerifyProc(); |
| 83 | 83 |
| 84 private: | 84 private: |
| 85 friend class base::RefCountedThreadSafe<CertVerifyProc>; | 85 friend class base::RefCountedThreadSafe<CertVerifyProc>; |
| 86 FRIEND_TEST_ALL_PREFIXES(CertVerifyProcTest, DigiNotarCerts); | 86 FRIEND_TEST_ALL_PREFIXES(CertVerifyProcTest, DigiNotarCerts); |
| 87 FRIEND_TEST_ALL_PREFIXES(CertVerifyProcTest, TestHasTooLongValidity); | 87 FRIEND_TEST_ALL_PREFIXES(CertVerifyProcTest, TestHasTooLongValidity); |
| 88 FRIEND_TEST_ALL_PREFIXES(CertVerifyProcTest, | 88 FRIEND_TEST_ALL_PREFIXES(CertVerifyProcTest, |
| 89 VerifyRejectsSHA1AfterDeprecationLegacyMode); | 89 VerifyRejectsSHA1AfterDeprecationLegacyMode); |
| 90 | 90 |
| 91 // Performs the actual verification using the desired underlying | 91 // Performs the actual verification using the desired underlying |
| 92 // cryptographic library. On entry, |verify_result->verified_cert| | 92 // |
| 93 // is set to |cert|, the unverified chain. If no chain is built, the | 93 // On entry, |verify_result| will be default-initialized as a successful |
| 94 // value must be left untouched. | 94 // validation, with |verify_result->verified_cert| set to |cert|. |
| 95 // |
| 96 // Implementations are expected to fill in all applicable fields, excluding |
| 97 // |ocsp_result|, which will be filled in by |Verify()|. If an error code is |
| 98 // returned, |verify_result->cert_status| should be non-zero, indicating an |
| 99 // error occurred. |
| 100 // |
| 101 // On success, net::OK should be returned, with |verify_result| updated to |
| 102 // reflect the successfully verified chain. |
| 95 virtual int VerifyInternal(X509Certificate* cert, | 103 virtual int VerifyInternal(X509Certificate* cert, |
| 96 const std::string& hostname, | 104 const std::string& hostname, |
| 97 const std::string& ocsp_response, | 105 const std::string& ocsp_response, |
| 98 int flags, | 106 int flags, |
| 99 CRLSet* crl_set, | 107 CRLSet* crl_set, |
| 100 const CertificateList& additional_trust_anchors, | 108 const CertificateList& additional_trust_anchors, |
| 101 CertVerifyResult* verify_result) = 0; | 109 CertVerifyResult* verify_result) = 0; |
| 102 | 110 |
| 103 // Returns true if |cert| is explicitly blacklisted. | 111 // Returns true if |cert| is explicitly blacklisted. |
| 104 static bool IsBlacklisted(X509Certificate* cert); | 112 static bool IsBlacklisted(X509Certificate* cert); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // This function is intended to be used as a helper by platform-specific | 154 // This function is intended to be used as a helper by platform-specific |
| 147 // CertVerifyProc implementations. | 155 // CertVerifyProc implementations. |
| 148 X509Certificate::SignatureHashAlgorithm FillCertVerifyResultWeakSignature( | 156 X509Certificate::SignatureHashAlgorithm FillCertVerifyResultWeakSignature( |
| 149 X509Certificate::OSCertHandle cert, | 157 X509Certificate::OSCertHandle cert, |
| 150 bool is_leaf, | 158 bool is_leaf, |
| 151 CertVerifyResult* verify_result); | 159 CertVerifyResult* verify_result); |
| 152 | 160 |
| 153 } // namespace net | 161 } // namespace net |
| 154 | 162 |
| 155 #endif // NET_CERT_CERT_VERIFY_PROC_H_ | 163 #endif // NET_CERT_CERT_VERIFY_PROC_H_ |
| OLD | NEW |