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

Unified Diff: remoting/protocol/authenticator_test_base.cc

Issue 12316083: Move HostKeyPair into protocol::KeyPair. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rename key_pair_ to local_key_pair_ Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: remoting/protocol/authenticator_test_base.cc
diff --git a/remoting/protocol/authenticator_test_base.cc b/remoting/protocol/authenticator_test_base.cc
index 18450987f3f0559e79f491eda89cd4a47491cfe1..1e3f5409adb8578fef452286738897556548bb07 100644
--- a/remoting/protocol/authenticator_test_base.cc
+++ b/remoting/protocol/authenticator_test_base.cc
@@ -4,13 +4,14 @@
#include "remoting/protocol/authenticator_test_base.h"
+#include "base/base64.h"
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/path_service.h"
#include "base/test/test_timeouts.h"
#include "base/timer.h"
-#include "crypto/rsa_private_key.h"
#include "net/base/test_data_directory.h"
+#include "remoting/base/rsa_key_pair.h"
#include "remoting/protocol/authenticator.h"
#include "remoting/protocol/channel_authenticator.h"
#include "remoting/protocol/fake_session.h"
@@ -51,12 +52,10 @@ void AuthenticatorTestBase::SetUp() {
base::FilePath key_path = certs_dir.AppendASCII("unittest.key.bin");
std::string key_string;
ASSERT_TRUE(file_util::ReadFileToString(key_path, &key_string));
- std::vector<uint8> key_vector(
- reinterpret_cast<const uint8*>(key_string.data()),
- reinterpret_cast<const uint8*>(key_string.data() +
- key_string.length()));
- private_key_.reset(
- crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_vector));
+ std::string key_base64;
+ base::Base64Encode(key_string, &key_base64);
Wez 2013/03/06 00:43:25 Can we switch to a Base64 encoded string in the fi
rmsousa 2013/03/06 04:36:49 These files are not owned by us, they're the test
+ key_pair_ = new RsaKeyPair();
+ key_pair_->LoadFromString(key_base64);
}
void AuthenticatorTestBase::RunAuthExchange() {

Powered by Google App Engine
This is Rietveld 408576698