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

Side by Side Diff: net/socket/dns_cert_provenance_checker.cc

Issue 6339012: More net/ method ordering. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More done while waiting for previous patch to clear Created 9 years, 11 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/socket/client_socket_factory.cc ('k') | net/socket/ssl_client_socket_nss.h » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/socket/dns_cert_provenance_checker.h" 5 #include "net/socket/dns_cert_provenance_checker.h"
6 6
7 #if !defined(USE_OPENSSL) 7 #if !defined(USE_OPENSSL)
8 8
9 #include <nspr.h> 9 #include <nspr.h>
10 10
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 211
212 CERTSubjectPublicKeyInfo* spki = SECKEY_DecodeDERSubjectPublicKeyInfo(&der); 212 CERTSubjectPublicKeyInfo* spki = SECKEY_DecodeDERSubjectPublicKeyInfo(&der);
213 SECKEYPublicKey* public_key = SECKEY_ExtractPublicKey(spki); 213 SECKEYPublicKey* public_key = SECKEY_ExtractPublicKey(spki);
214 SECKEY_DestroySubjectPublicKeyInfo(spki); 214 SECKEY_DestroySubjectPublicKeyInfo(spki);
215 215
216 return public_key; 216 return public_key;
217 } 217 }
218 218
219 } // namespace 219 } // namespace
220 220
221 DnsCertProvenanceChecker::Delegate::~Delegate() {
222 }
223
224 DnsCertProvenanceChecker::~DnsCertProvenanceChecker() {
225 }
226
227 void DnsCertProvenanceChecker::DoAsyncLookup(
228 const std::string& hostname,
229 const std::vector<base::StringPiece>& der_certs,
230 DnsRRResolver* dnsrr_resolver,
231 Delegate* delegate) {
232 DnsCertProvenanceCheck* check = new DnsCertProvenanceCheck(
233 hostname, dnsrr_resolver, delegate, der_certs);
234 check->Start();
235 }
236
221 // static 237 // static
222 std::string DnsCertProvenanceChecker::BuildEncryptedReport( 238 std::string DnsCertProvenanceChecker::BuildEncryptedReport(
223 const std::string& hostname, 239 const std::string& hostname,
224 const std::vector<std::string>& der_certs) { 240 const std::vector<std::string>& der_certs) {
225 static const int kVersion = 0; 241 static const int kVersion = 0;
226 static const unsigned kKeySizeInBytes = 16; // AES-128 242 static const unsigned kKeySizeInBytes = 16; // AES-128
227 static const unsigned kIVSizeInBytes = 16; // AES's block size 243 static const unsigned kIVSizeInBytes = 16; // AES's block size
228 static const unsigned kPadSize = 4096; // we pad up to 4KB, 244 static const unsigned kPadSize = 4096; // we pad up to 4KB,
229 // This is a DER encoded, ANSI X9.62 CurveParams object which simply 245 // This is a DER encoded, ANSI X9.62 CurveParams object which simply
230 // specifies P256. 246 // specifies P256.
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 327
312 outer.WriteString(ciphertext); 328 outer.WriteString(ciphertext);
313 329
314 SECKEY_DestroyPublicKey(pub_key); 330 SECKEY_DestroyPublicKey(pub_key);
315 SECKEY_DestroyPrivateKey(priv_key); 331 SECKEY_DestroyPrivateKey(priv_key);
316 332
317 return std::string(reinterpret_cast<const char*>(outer.data()), 333 return std::string(reinterpret_cast<const char*>(outer.data()),
318 outer.size()); 334 outer.size());
319 } 335 }
320 336
321 void DnsCertProvenanceChecker::DoAsyncLookup(
322 const std::string& hostname,
323 const std::vector<base::StringPiece>& der_certs,
324 DnsRRResolver* dnsrr_resolver,
325 Delegate* delegate) {
326 DnsCertProvenanceCheck* check = new DnsCertProvenanceCheck(
327 hostname, dnsrr_resolver, delegate, der_certs);
328 check->Start();
329 }
330
331 DnsCertProvenanceChecker::Delegate::~Delegate() {
332 }
333
334 DnsCertProvenanceChecker::~DnsCertProvenanceChecker() {
335 }
336
337 } // namespace net 337 } // namespace net
338 338
339 #else // USE_OPENSSL 339 #else // USE_OPENSSL
340 340
341 namespace net { 341 namespace net {
342 342
343 std::string DnsCertProvenanceChecker::BuildEncryptedReport( 343 DnsCertProvenanceChecker::Delegate::~Delegate() {
344 const std::string& hostname, 344 }
345 const std::vector<std::string>& der_certs) { 345
346 return ""; 346 DnsCertProvenanceChecker::~DnsCertProvenanceChecker() {
347 } 347 }
348 348
349 void DnsCertProvenanceChecker::DoAsyncLookup( 349 void DnsCertProvenanceChecker::DoAsyncLookup(
350 const std::string& hostname, 350 const std::string& hostname,
351 const std::vector<base::StringPiece>& der_certs, 351 const std::vector<base::StringPiece>& der_certs,
352 DnsRRResolver* dnsrr_resolver, 352 DnsRRResolver* dnsrr_resolver,
353 Delegate* delegate) { 353 Delegate* delegate) {
354 } 354 }
355 355
356 DnsCertProvenanceChecker::Delegate::~Delegate() { 356 std::string DnsCertProvenanceChecker::BuildEncryptedReport(
357 } 357 const std::string& hostname,
358 358 const std::vector<std::string>& der_certs) {
359 DnsCertProvenanceChecker::~DnsCertProvenanceChecker() { 359 return "";
360 } 360 }
361 361
362 } // namespace net 362 } // namespace net
363 363
364 #endif // USE_OPENSSL 364 #endif // USE_OPENSSL
OLDNEW
« no previous file with comments | « net/socket/client_socket_factory.cc ('k') | net/socket/ssl_client_socket_nss.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698