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

Side by Side Diff: net/base/x509_certificate_nss.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_mac.cc ('k') | net/base/x509_certificate_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/base/x509_certificate.h" 5 #include "net/base/x509_certificate.h"
6 6
7 #include <cert.h> 7 #include <cert.h>
8 #include <cryptohi.h> 8 #include <cryptohi.h>
9 #include <keyhi.h> 9 #include <keyhi.h>
10 #include <nss.h> 10 #include <nss.h>
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 unsigned int result_len; 1139 unsigned int result_len;
1140 HASH_End(sha1_ctx, sha1.data, &result_len, HASH_ResultLenContext(sha1_ctx)); 1140 HASH_End(sha1_ctx, sha1.data, &result_len, HASH_ResultLenContext(sha1_ctx));
1141 HASH_Destroy(sha1_ctx); 1141 HASH_Destroy(sha1_ctx);
1142 1142
1143 return sha1; 1143 return sha1;
1144 } 1144 }
1145 1145
1146 // static 1146 // static
1147 X509Certificate::OSCertHandle 1147 X509Certificate::OSCertHandle
1148 X509Certificate::ReadOSCertHandleFromPickle(const Pickle& pickle, 1148 X509Certificate::ReadOSCertHandleFromPickle(const Pickle& pickle,
1149 void** pickle_iter) { 1149 PickleIterator* pickle_iter) {
1150 const char* data; 1150 const char* data;
1151 int length; 1151 int length;
1152 if (!pickle.ReadData(pickle_iter, &data, &length)) 1152 if (!pickle.ReadData(pickle_iter, &data, &length))
1153 return NULL; 1153 return NULL;
1154 1154
1155 return CreateOSCertHandleFromBytes(data, length); 1155 return CreateOSCertHandleFromBytes(data, length);
1156 } 1156 }
1157 1157
1158 // static 1158 // static
1159 bool X509Certificate::WriteOSCertHandleToPickle(OSCertHandle cert_handle, 1159 bool X509Certificate::WriteOSCertHandleToPickle(OSCertHandle cert_handle,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 *type = kPublicKeyTypeECDSA; 1191 *type = kPublicKeyTypeECDSA;
1192 break; 1192 break;
1193 default: 1193 default:
1194 *type = kPublicKeyTypeUnknown; 1194 *type = kPublicKeyTypeUnknown;
1195 *size_bits = 0; 1195 *size_bits = 0;
1196 break; 1196 break;
1197 } 1197 }
1198 } 1198 }
1199 1199
1200 } // namespace net 1200 } // namespace net
OLDNEW
« no previous file with comments | « net/base/x509_certificate_mac.cc ('k') | net/base/x509_certificate_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698