| 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_mac.h" | 5 #include "net/cert/cert_verify_proc_mac.h" |
| 6 | 6 |
| 7 #include <CommonCrypto/CommonDigest.h> | 7 #include <CommonCrypto/CommonDigest.h> |
| 8 #include <CoreServices/CoreServices.h> | 8 #include <CoreServices/CoreServices.h> |
| 9 #include <Security/Security.h> | 9 #include <Security/Security.h> |
| 10 | 10 |
| (...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 984 if (!IsCertStatusError(verify_result->cert_status)) { | 984 if (!IsCertStatusError(verify_result->cert_status)) { |
| 985 LOG(WARNING) << "trust_result=" << trust_result; | 985 LOG(WARNING) << "trust_result=" << trust_result; |
| 986 verify_result->cert_status |= CERT_STATUS_INVALID; | 986 verify_result->cert_status |= CERT_STATUS_INVALID; |
| 987 } | 987 } |
| 988 break; | 988 break; |
| 989 } | 989 } |
| 990 | 990 |
| 991 // Perform hostname verification independent of SecTrustEvaluate. In order to | 991 // Perform hostname verification independent of SecTrustEvaluate. In order to |
| 992 // do so, mask off any reported name errors first. | 992 // do so, mask off any reported name errors first. |
| 993 verify_result->cert_status &= ~CERT_STATUS_COMMON_NAME_INVALID; | 993 verify_result->cert_status &= ~CERT_STATUS_COMMON_NAME_INVALID; |
| 994 if (!cert->VerifyNameMatch(hostname, | |
| 995 &verify_result->common_name_fallback_used)) { | |
| 996 verify_result->cert_status |= CERT_STATUS_COMMON_NAME_INVALID; | |
| 997 } | |
| 998 | 994 |
| 999 // TODO(wtc): Suppress CERT_STATUS_NO_REVOCATION_MECHANISM for now to be | 995 // TODO(wtc): Suppress CERT_STATUS_NO_REVOCATION_MECHANISM for now to be |
| 1000 // compatible with Windows, which in turn implements this behavior to be | 996 // compatible with Windows, which in turn implements this behavior to be |
| 1001 // compatible with WinHTTP, which doesn't report this error (bug 3004). | 997 // compatible with WinHTTP, which doesn't report this error (bug 3004). |
| 1002 verify_result->cert_status &= ~CERT_STATUS_NO_REVOCATION_MECHANISM; | 998 verify_result->cert_status &= ~CERT_STATUS_NO_REVOCATION_MECHANISM; |
| 1003 | 999 |
| 1004 AppendPublicKeyHashes(completed_chain, &verify_result->public_key_hashes); | 1000 AppendPublicKeyHashes(completed_chain, &verify_result->public_key_hashes); |
| 1005 verify_result->is_issued_by_known_root = | 1001 verify_result->is_issued_by_known_root = |
| 1006 g_known_roots.Get().IsIssuedByKnownRoot(completed_chain); | 1002 g_known_roots.Get().IsIssuedByKnownRoot(completed_chain); |
| 1007 | 1003 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1077 // EV cert and it was covered by CRLSets or revocation checking passed. | 1073 // EV cert and it was covered by CRLSets or revocation checking passed. |
| 1078 verify_result->cert_status |= CERT_STATUS_IS_EV; | 1074 verify_result->cert_status |= CERT_STATUS_IS_EV; |
| 1079 } | 1075 } |
| 1080 | 1076 |
| 1081 return OK; | 1077 return OK; |
| 1082 } | 1078 } |
| 1083 | 1079 |
| 1084 } // namespace net | 1080 } // namespace net |
| 1085 | 1081 |
| 1086 #pragma clang diagnostic pop // "-Wdeprecated-declarations" | 1082 #pragma clang diagnostic pop // "-Wdeprecated-declarations" |
| OLD | NEW |