| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |