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

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

Issue 9447084: Refactor Pickle Read methods to use higher performance PickleIterator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile (racing with incoming CLs) Created 8 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 | Annotate | Revision Log
« no previous file with comments | « net/base/x509_certificate_nss.cc ('k') | net/base/x509_certificate_unittest.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/base/x509_certificate.h" 5 #include "net/base/x509_certificate.h"
6 6
7 #include <openssl/asn1.h> 7 #include <openssl/asn1.h>
8 #include <openssl/crypto.h> 8 #include <openssl/crypto.h>
9 #include <openssl/obj_mac.h> 9 #include <openssl/obj_mac.h>
10 #include <openssl/pem.h> 10 #include <openssl/pem.h>
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 643
644 return GetDERAndCacheIfNeeded(a, &der_cache_a) && 644 return GetDERAndCacheIfNeeded(a, &der_cache_a) &&
645 GetDERAndCacheIfNeeded(b, &der_cache_b) && 645 GetDERAndCacheIfNeeded(b, &der_cache_b) &&
646 der_cache_a.data_length == der_cache_b.data_length && 646 der_cache_a.data_length == der_cache_b.data_length &&
647 memcmp(der_cache_a.data, der_cache_b.data, der_cache_a.data_length) == 0; 647 memcmp(der_cache_a.data, der_cache_b.data, der_cache_a.data_length) == 0;
648 } 648 }
649 649
650 // static 650 // static
651 X509Certificate::OSCertHandle 651 X509Certificate::OSCertHandle
652 X509Certificate::ReadOSCertHandleFromPickle(const Pickle& pickle, 652 X509Certificate::ReadOSCertHandleFromPickle(const Pickle& pickle,
653 void** pickle_iter) { 653 PickleIterator* pickle_iter) {
654 const char* data; 654 const char* data;
655 int length; 655 int length;
656 if (!pickle.ReadData(pickle_iter, &data, &length)) 656 if (!pickle.ReadData(pickle_iter, &data, &length))
657 return NULL; 657 return NULL;
658 658
659 return CreateOSCertHandleFromBytes(data, length); 659 return CreateOSCertHandleFromBytes(data, length);
660 } 660 }
661 661
662 // static 662 // static
663 bool X509Certificate::WriteOSCertHandleToPickle(OSCertHandle cert_handle, 663 bool X509Certificate::WriteOSCertHandleToPickle(OSCertHandle cert_handle,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 for (OSCertHandles::const_iterator it = cert_handles.begin(); 717 for (OSCertHandles::const_iterator it = cert_handles.begin();
718 it != cert_handles.end(); ++it) { 718 it != cert_handles.end(); ++it) {
719 std::string cert_bytes; 719 std::string cert_bytes;
720 GetDEREncoded(*it, &cert_bytes); 720 GetDEREncoded(*it, &cert_bytes);
721 chain_bytes->push_back(cert_bytes); 721 chain_bytes->push_back(cert_bytes);
722 } 722 }
723 } 723 }
724 #endif 724 #endif
725 725
726 } // namespace net 726 } // namespace net
OLDNEW
« no previous file with comments | « net/base/x509_certificate_nss.cc ('k') | net/base/x509_certificate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698