OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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_ios.h" | 5 #include "net/cert/cert_verify_proc_ios.h" |
6 | 6 |
7 #include <CommonCrypto/CommonDigest.h> | 7 #include <CommonCrypto/CommonDigest.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/scoped_cftyperef.h" | 10 #include "base/mac/scoped_cftyperef.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 break; | 259 break; |
260 case kSecTrustResultDeny: | 260 case kSecTrustResultDeny: |
261 verify_result->cert_status |= CERT_STATUS_AUTHORITY_INVALID; | 261 verify_result->cert_status |= CERT_STATUS_AUTHORITY_INVALID; |
262 break; | 262 break; |
263 default: | 263 default: |
264 verify_result->cert_status |= GetCertFailureStatusFromTrust(trust_ref); | 264 verify_result->cert_status |= GetCertFailureStatusFromTrust(trust_ref); |
265 } | 265 } |
266 | 266 |
267 GetCertChainInfo(final_chain, verify_result); | 267 GetCertChainInfo(final_chain, verify_result); |
268 | 268 |
269 // Perform hostname verification independent of SecTrustEvaluate. | |
270 if (!verify_result->verified_cert->VerifyNameMatch( | |
271 hostname, &verify_result->common_name_fallback_used)) { | |
272 verify_result->cert_status |= CERT_STATUS_COMMON_NAME_INVALID; | |
273 } | |
274 | |
275 verify_result->is_issued_by_known_root = false; | 269 verify_result->is_issued_by_known_root = false; |
276 | 270 |
277 if (IsCertStatusError(verify_result->cert_status)) | 271 if (IsCertStatusError(verify_result->cert_status)) |
278 return MapCertStatusToNetError(verify_result->cert_status); | 272 return MapCertStatusToNetError(verify_result->cert_status); |
279 | 273 |
280 return OK; | 274 return OK; |
281 } | 275 } |
282 | 276 |
283 } // namespace net | 277 } // namespace net |
OLD | NEW |