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 #include "net/cert/cert_verify_proc_android.h" | 5 #include "net/cert/cert_verify_proc_android.h" |
6 | 6 |
7 #include <openssl/x509v3.h> | 7 #include <openssl/x509v3.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 } // namespace | 148 } // namespace |
149 | 149 |
150 CertVerifyProcAndroid::CertVerifyProcAndroid() {} | 150 CertVerifyProcAndroid::CertVerifyProcAndroid() {} |
151 | 151 |
152 CertVerifyProcAndroid::~CertVerifyProcAndroid() {} | 152 CertVerifyProcAndroid::~CertVerifyProcAndroid() {} |
153 | 153 |
154 bool CertVerifyProcAndroid::SupportsAdditionalTrustAnchors() const { | 154 bool CertVerifyProcAndroid::SupportsAdditionalTrustAnchors() const { |
155 return false; | 155 return false; |
156 } | 156 } |
157 | 157 |
| 158 bool CertVerifyProcAndroid::SupportsOCSPStapling() const { |
| 159 return false; |
| 160 } |
| 161 |
158 int CertVerifyProcAndroid::VerifyInternal( | 162 int CertVerifyProcAndroid::VerifyInternal( |
159 X509Certificate* cert, | 163 X509Certificate* cert, |
160 const std::string& hostname, | 164 const std::string& hostname, |
| 165 const std::string& ocsp_response, |
161 int flags, | 166 int flags, |
162 CRLSet* crl_set, | 167 CRLSet* crl_set, |
163 const CertificateList& additional_trust_anchors, | 168 const CertificateList& additional_trust_anchors, |
164 CertVerifyResult* verify_result) { | 169 CertVerifyResult* verify_result) { |
165 if (!cert->VerifyNameMatch(hostname, | 170 if (!cert->VerifyNameMatch(hostname, |
166 &verify_result->common_name_fallback_used)) { | 171 &verify_result->common_name_fallback_used)) { |
167 verify_result->cert_status |= CERT_STATUS_COMMON_NAME_INVALID; | 172 verify_result->cert_status |= CERT_STATUS_COMMON_NAME_INVALID; |
168 } | 173 } |
169 | 174 |
170 std::vector<std::string> cert_bytes; | 175 std::vector<std::string> cert_bytes; |
171 if (!GetChainDEREncodedBytes(cert, &cert_bytes)) | 176 if (!GetChainDEREncodedBytes(cert, &cert_bytes)) |
172 return ERR_CERT_INVALID; | 177 return ERR_CERT_INVALID; |
173 if (!VerifyFromAndroidTrustManager(cert_bytes, hostname, verify_result)) { | 178 if (!VerifyFromAndroidTrustManager(cert_bytes, hostname, verify_result)) { |
174 NOTREACHED(); | 179 NOTREACHED(); |
175 return ERR_FAILED; | 180 return ERR_FAILED; |
176 } | 181 } |
177 if (IsCertStatusError(verify_result->cert_status)) | 182 if (IsCertStatusError(verify_result->cert_status)) |
178 return MapCertStatusToNetError(verify_result->cert_status); | 183 return MapCertStatusToNetError(verify_result->cert_status); |
179 | 184 |
180 return OK; | 185 return OK; |
181 } | 186 } |
182 | 187 |
183 } // namespace net | 188 } // namespace net |
OLD | NEW |