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

Side by Side Diff: chrome/browser/extensions/api/networking_private/networking_private_crypto.cc

Issue 22295002: Base infrastructure for Networking Private API on Windows and Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use crypto_verify_mock for browser_test. Created 7 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/extensions/api/networking_private/networking_private_cr ypto.h" 5 #include "chrome/browser/extensions/api/networking_private/networking_private_cr ypto.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 <keythi.h> 10 #include <keythi.h>
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 if (!pem_tok.GetNext()) { 60 if (!pem_tok.GetNext()) {
61 return false; 61 return false;
62 } 62 }
63 63
64 *der_output = pem_tok.data(); 64 *der_output = pem_tok.data();
65 return true; 65 return true;
66 } 66 }
67 67
68 } // namespace 68 } // namespace
69 69
70
71 NetworkingPrivateCrypto::NetworkingPrivateCrypto() {} 70 NetworkingPrivateCrypto::NetworkingPrivateCrypto() {}
72 71
73 NetworkingPrivateCrypto::~NetworkingPrivateCrypto() {} 72 NetworkingPrivateCrypto::~NetworkingPrivateCrypto() {}
74 73
75 bool NetworkingPrivateCrypto::VerifyCredentials( 74 bool NetworkingPrivateCrypto::VerifyCredentials(
76 const std::string& certificate, 75 const std::string& certificate,
77 const std::string& signature, 76 const std::string& signature,
78 const std::string& data, 77 const std::string& data,
79 const std::string& connected_mac) { 78 const std::string& connected_mac) {
80 crypto::EnsureNSSInit(); 79 crypto::EnsureNSSInit();
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 encrypted_data.length()); 232 encrypted_data.length());
234 if (decrypted != SECSuccess) { 233 if (decrypted != SECSuccess) {
235 LOG(ERROR) << "Error during decryption."; 234 LOG(ERROR) << "Error during decryption.";
236 return false; 235 return false;
237 } 236 }
238 decrypted_output->assign(reinterpret_cast<char*>(rsa_output.get()), 237 decrypted_output->assign(reinterpret_cast<char*>(rsa_output.get()),
239 output_length); 238 output_length);
240 return true; 239 return true;
241 } 240 }
242 241
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698