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

Side by Side Diff: net/base/x509_certificate.cc

Issue 6874039: Return the constructed certificate chain in X509Certificate::Verify() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: wtc feedback Created 9 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/base/x509_certificate.h" 5 #include "net/base/x509_certificate.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 if (reference_host.starts_with(pattern_begin) && 585 if (reference_host.starts_with(pattern_begin) &&
586 reference_host.ends_with(pattern_end)) 586 reference_host.ends_with(pattern_end))
587 return true; 587 return true;
588 } 588 }
589 return false; 589 return false;
590 } 590 }
591 591
592 int X509Certificate::Verify(const std::string& hostname, int flags, 592 int X509Certificate::Verify(const std::string& hostname, int flags,
593 CertVerifyResult* verify_result) const { 593 CertVerifyResult* verify_result) const {
594 verify_result->Reset(); 594 verify_result->Reset();
595 verify_result->verified_cert =
596 CreateFromHandle(cert_handle_, intermediate_ca_certs_);
wtc 2011/07/26 19:32:29 Since X509Certificate is reference-counted, I thin
Ryan Sleevi 2011/07/26 23:28:31 This came up on discussion on IRC yesterday, as I
595 597
596 if (IsBlacklisted()) { 598 if (IsBlacklisted()) {
597 verify_result->cert_status |= CERT_STATUS_REVOKED; 599 verify_result->cert_status |= CERT_STATUS_REVOKED;
598 return ERR_CERT_REVOKED; 600 return ERR_CERT_REVOKED;
599 } 601 }
600 602
601 int rv = VerifyInternal(hostname, flags, verify_result); 603 int rv = VerifyInternal(hostname, flags, verify_result);
602 604
603 // If needed, do any post-validation here. 605 // If needed, do any post-validation here.
604 return rv; 606 return rv;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 bool X509Certificate::IsSHA1HashInSortedArray(const SHA1Fingerprint& hash, 703 bool X509Certificate::IsSHA1HashInSortedArray(const SHA1Fingerprint& hash,
702 const uint8* array, 704 const uint8* array,
703 size_t array_byte_len) { 705 size_t array_byte_len) {
704 DCHECK_EQ(0u, array_byte_len % base::SHA1_LENGTH); 706 DCHECK_EQ(0u, array_byte_len % base::SHA1_LENGTH);
705 const unsigned arraylen = array_byte_len / base::SHA1_LENGTH; 707 const unsigned arraylen = array_byte_len / base::SHA1_LENGTH;
706 return NULL != bsearch(hash.data, array, arraylen, base::SHA1_LENGTH, 708 return NULL != bsearch(hash.data, array, arraylen, base::SHA1_LENGTH,
707 CompareSHA1Hashes); 709 CompareSHA1Hashes);
708 } 710 }
709 711
710 } // namespace net 712 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698