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

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

Issue 2725683002: Move name matching into the shared certificate validator (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.cc ('k') | net/cert/cert_verify_proc_ios.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_android.h" 5 #include "net/cert/cert_verify_proc_android.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 } 383 }
384 384
385 int CertVerifyProcAndroid::VerifyInternal( 385 int CertVerifyProcAndroid::VerifyInternal(
386 X509Certificate* cert, 386 X509Certificate* cert,
387 const std::string& hostname, 387 const std::string& hostname,
388 const std::string& ocsp_response, 388 const std::string& ocsp_response,
389 int flags, 389 int flags,
390 CRLSet* crl_set, 390 CRLSet* crl_set,
391 const CertificateList& additional_trust_anchors, 391 const CertificateList& additional_trust_anchors,
392 CertVerifyResult* verify_result) { 392 CertVerifyResult* verify_result) {
393 if (!cert->VerifyNameMatch(hostname,
394 &verify_result->common_name_fallback_used)) {
395 verify_result->cert_status |= CERT_STATUS_COMMON_NAME_INVALID;
396 }
397
398 std::vector<std::string> cert_bytes; 393 std::vector<std::string> cert_bytes;
399 if (!GetChainDEREncodedBytes(cert, &cert_bytes)) 394 if (!GetChainDEREncodedBytes(cert, &cert_bytes))
400 return ERR_CERT_INVALID; 395 return ERR_CERT_INVALID;
401 if (!VerifyFromAndroidTrustManager(cert_bytes, hostname, 396 if (!VerifyFromAndroidTrustManager(cert_bytes, hostname,
402 g_cert_net_fetcher.Get(), verify_result)) { 397 g_cert_net_fetcher.Get(), verify_result)) {
403 NOTREACHED(); 398 NOTREACHED();
404 return ERR_FAILED; 399 return ERR_FAILED;
405 } 400 }
406 if (IsCertStatusError(verify_result->cert_status)) 401 if (IsCertStatusError(verify_result->cert_status))
407 return MapCertStatusToNetError(verify_result->cert_status); 402 return MapCertStatusToNetError(verify_result->cert_status);
408 403
409 return OK; 404 return OK;
410 } 405 }
411 406
412 } // namespace net 407 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/cert_verify_proc.cc ('k') | net/cert/cert_verify_proc_ios.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698