Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: net/cert/cert_verify_proc_mac.cc

Issue 2735733003: Disable commonName matching for certificates (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/cert/cert_verify_proc_ios.cc ('k') | net/cert/cert_verify_proc_openssl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 970 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 if (status) 981 if (status)
982 return NetErrorFromOSStatus(status); 982 return NetErrorFromOSStatus(status);
983 verify_result->cert_status |= CertStatusFromOSStatus(cssm_result); 983 verify_result->cert_status |= CertStatusFromOSStatus(cssm_result);
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 // Hostname validation is handled by CertVerifyProc, so mask off any errors
992 // do so, mask off any reported name errors first. 992 // that SecTrustEvaluate may have set, as its results are not used.
993 verify_result->cert_status &= ~CERT_STATUS_COMMON_NAME_INVALID; 993 verify_result->cert_status &= ~CERT_STATUS_COMMON_NAME_INVALID;
994 994
995 // 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
996 // compatible with Windows, which in turn implements this behavior to be 996 // compatible with Windows, which in turn implements this behavior to be
997 // compatible with WinHTTP, which doesn't report this error (bug 3004). 997 // compatible with WinHTTP, which doesn't report this error (bug 3004).
998 verify_result->cert_status &= ~CERT_STATUS_NO_REVOCATION_MECHANISM; 998 verify_result->cert_status &= ~CERT_STATUS_NO_REVOCATION_MECHANISM;
999 999
1000 AppendPublicKeyHashes(completed_chain, &verify_result->public_key_hashes); 1000 AppendPublicKeyHashes(completed_chain, &verify_result->public_key_hashes);
1001 verify_result->is_issued_by_known_root = 1001 verify_result->is_issued_by_known_root =
1002 g_known_roots.Get().IsIssuedByKnownRoot(completed_chain); 1002 g_known_roots.Get().IsIssuedByKnownRoot(completed_chain);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 // 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.
1074 verify_result->cert_status |= CERT_STATUS_IS_EV; 1074 verify_result->cert_status |= CERT_STATUS_IS_EV;
1075 } 1075 }
1076 1076
1077 return OK; 1077 return OK;
1078 } 1078 }
1079 1079
1080 } // namespace net 1080 } // namespace net
1081 1081
1082 #pragma clang diagnostic pop // "-Wdeprecated-declarations" 1082 #pragma clang diagnostic pop // "-Wdeprecated-declarations"
OLDNEW
« no previous file with comments | « net/cert/cert_verify_proc_ios.cc ('k') | net/cert/cert_verify_proc_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698