summaryrefslogtreecommitdiffstats
path: root/remoting/host
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-14 17:37:14 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-14 17:37:14 +0000
commit4b559b4ddffc0b7f688019bcb80658f05e063af7 (patch)
tree0be21d8914de707f5125d2cb66733cbcf088606c /remoting/host
parent056dd45d610de34312344445d7b078a31f4a1e20 (diff)
downloadchromium_src-4b559b4ddffc0b7f688019bcb80658f05e063af7.zip
chromium_src-4b559b4ddffc0b7f688019bcb80658f05e063af7.tar.gz
chromium_src-4b559b4ddffc0b7f688019bcb80658f05e063af7.tar.bz2
Move crypto files out of base, to a top level directory.
src/crypto is now an independent project that contains our cryptographic primitives (except md5 and sha1). This removes the base dependency from nss, openssl and sqlite. BUG=76996 TEST=none Review URL: http://codereview.chromium.org/6805019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81611 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host')
-rw-r--r--remoting/host/host_key_pair.cc16
-rw-r--r--remoting/host/host_key_pair.h6
-rw-r--r--remoting/host/keygen_main.cc4
-rw-r--r--remoting/host/simple_host_process.cc4
4 files changed, 15 insertions, 15 deletions
diff --git a/remoting/host/host_key_pair.cc b/remoting/host/host_key_pair.cc
index ad3d59b..948b4ad 100644
--- a/remoting/host/host_key_pair.cc
+++ b/remoting/host/host_key_pair.cc
@@ -9,12 +9,12 @@
#include <vector>
#include "base/base64.h"
-#include "base/crypto/rsa_private_key.h"
-#include "base/crypto/signature_creator.h"
#include "base/logging.h"
#include "base/rand_util.h"
#include "base/task.h"
#include "base/time.h"
+#include "crypto/rsa_private_key.h"
+#include "crypto/signature_creator.h"
#include "net/base/x509_certificate.h"
#include "remoting/host/host_config.h"
@@ -25,7 +25,7 @@ HostKeyPair::HostKeyPair() { }
HostKeyPair::~HostKeyPair() { }
void HostKeyPair::Generate() {
- key_.reset(base::RSAPrivateKey::Create(2048));
+ key_.reset(crypto::RSAPrivateKey::Create(2048));
}
bool HostKeyPair::LoadFromString(const std::string& key_base64) {
@@ -36,7 +36,7 @@ bool HostKeyPair::LoadFromString(const std::string& key_base64) {
}
std::vector<uint8> key_buf(key_str.begin(), key_str.end());
- key_.reset(base::RSAPrivateKey::CreateFromPrivateKeyInfo(key_buf));
+ key_.reset(crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_buf));
if (key_.get() == NULL) {
LOG(ERROR) << "Invalid private key.";
return false;
@@ -76,8 +76,8 @@ std::string HostKeyPair::GetPublicKey() const {
}
std::string HostKeyPair::GetSignature(const std::string& message) const {
- scoped_ptr<base::SignatureCreator> signature_creator(
- base::SignatureCreator::Create(key_.get()));
+ scoped_ptr<crypto::SignatureCreator> signature_creator(
+ crypto::SignatureCreator::Create(key_.get()));
signature_creator->Update(reinterpret_cast<const uint8*>(message.c_str()),
message.length());
std::vector<uint8> signature_buf;
@@ -88,10 +88,10 @@ std::string HostKeyPair::GetSignature(const std::string& message) const {
return signature_base64;
}
-base::RSAPrivateKey* HostKeyPair::CopyPrivateKey() const {
+crypto::RSAPrivateKey* HostKeyPair::CopyPrivateKey() const {
std::vector<uint8> key_bytes;
CHECK(key_->ExportPrivateKey(&key_bytes));
- return base::RSAPrivateKey::CreateFromPrivateKeyInfo(key_bytes);
+ return crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_bytes);
}
net::X509Certificate* HostKeyPair::GenerateCertificate() const {
diff --git a/remoting/host/host_key_pair.h b/remoting/host/host_key_pair.h
index b087e1f..c1f6082 100644
--- a/remoting/host/host_key_pair.h
+++ b/remoting/host/host_key_pair.h
@@ -11,7 +11,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/task.h"
-namespace base {
+namespace crypto {
class RSAPrivateKey;
} // namespace base
@@ -38,11 +38,11 @@ class HostKeyPair {
std::string GetSignature(const std::string& message) const;
// Make a new copy of private key. Caller will own the generated private key.
- base::RSAPrivateKey* CopyPrivateKey() const;
+ crypto::RSAPrivateKey* CopyPrivateKey() const;
net::X509Certificate* GenerateCertificate() const;
private:
- scoped_ptr<base::RSAPrivateKey> key_;
+ scoped_ptr<crypto::RSAPrivateKey> key_;
};
} // namespace remoting
diff --git a/remoting/host/keygen_main.cc b/remoting/host/keygen_main.cc
index 73b1aa2..9102756 100644
--- a/remoting/host/keygen_main.cc
+++ b/remoting/host/keygen_main.cc
@@ -13,13 +13,13 @@
#include "base/at_exit.h"
#include "base/base64.h"
-#include "base/crypto/rsa_private_key.h"
+#include "crypto/rsa_private_key.h"
#include "base/memory/scoped_ptr.h"
int main(int argc, char** argv) {
base::AtExitManager exit_manager;
- scoped_ptr<base::RSAPrivateKey> key(base::RSAPrivateKey::Create(2048));
+ scoped_ptr<crypto::RSAPrivateKey> key(crypto::RSAPrivateKey::Create(2048));
std::vector<uint8> private_key_buf;
key->ExportPrivateKey(&private_key_buf);
diff --git a/remoting/host/simple_host_process.cc b/remoting/host/simple_host_process.cc
index 7c3a595..c10c2c5 100644
--- a/remoting/host/simple_host_process.cc
+++ b/remoting/host/simple_host_process.cc
@@ -24,10 +24,10 @@
#include "base/file_path.h"
#include "base/logging.h"
#include "base/mac/scoped_nsautorelease_pool.h"
-#include "base/nss_util.h"
#include "base/path_service.h"
#include "base/test/mock_chrome_application_mac.h"
#include "base/threading/thread.h"
+#include "crypto/nss_util.h"
#include "media/base/media.h"
#include "remoting/base/tracer.h"
#include "remoting/host/capturer_fake.h"
@@ -83,7 +83,7 @@ int main(int argc, char** argv) {
const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
base::AtExitManager exit_manager;
- base::EnsureNSPRInit();
+ crypto::EnsureNSPRInit();
// Allocate a chromoting context and starts it.
#if defined(TOOLKIT_USES_GTK)