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 // iOS lacks the ability to distinguish built-in versus non-built-in roots, |
| 270 // so opt to 'fail open' of any restrictive policies that apply to built-in |
| 271 // roots. |
269 verify_result->is_issued_by_known_root = false; | 272 verify_result->is_issued_by_known_root = false; |
270 | 273 |
271 if (IsCertStatusError(verify_result->cert_status)) | 274 if (IsCertStatusError(verify_result->cert_status)) |
272 return MapCertStatusToNetError(verify_result->cert_status); | 275 return MapCertStatusToNetError(verify_result->cert_status); |
273 | 276 |
274 return OK; | 277 return OK; |
275 } | 278 } |
276 | 279 |
277 } // namespace net | 280 } // namespace net |
OLD | NEW |