summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-27 09:18:43 +0000
committerrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-27 09:18:43 +0000
commit5123d9c4a4f9190436a9c15ee0733a5340aad08e (patch)
tree409d1f94e61b550ede597dfad3ea3b29238c5647 /remoting
parent277823276af8fb584020b981b30fbde5b4e7171d (diff)
downloadchromium_src-5123d9c4a4f9190436a9c15ee0733a5340aad08e.zip
chromium_src-5123d9c4a4f9190436a9c15ee0733a5340aad08e.tar.gz
chromium_src-5123d9c4a4f9190436a9c15ee0733a5340aad08e.tar.bz2
Remove platform-specific implementations of RSAPrivateKey and SignatureCreator
Use NSS/OpenSSL on all platforms, rather than deferring to the underlying OS routines. Because X509Certificate::CreateSelfSigned no longer relies on platform-native types for RSA keys or certificates, it has been moved to x509_util and simply returns a DER-encoded certificate as a string. BUG=none R=wtc Review URL: https://chromiumcodereview.appspot.com/17265013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208870 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/base/rsa_key_pair.cc24
1 files changed, 10 insertions, 14 deletions
diff --git a/remoting/base/rsa_key_pair.cc b/remoting/base/rsa_key_pair.cc
index 9f8b11f..81e8a92 100644
--- a/remoting/base/rsa_key_pair.cc
+++ b/remoting/base/rsa_key_pair.cc
@@ -14,7 +14,7 @@
#include "base/time.h"
#include "crypto/rsa_private_key.h"
#include "crypto/signature_creator.h"
-#include "net/cert/x509_certificate.h"
+#include "net/cert/x509_util.h"
namespace remoting {
@@ -92,19 +92,15 @@ std::string RsaKeyPair::SignMessage(const std::string& message) const {
}
std::string RsaKeyPair::GenerateCertificate() const {
- scoped_refptr<net::X509Certificate> cert =
- net::X509Certificate::CreateSelfSigned(
- key_.get(), "CN=chromoting",
- base::RandInt(1, std::numeric_limits<int>::max()),
- base::TimeDelta::FromDays(1));
- if (!cert.get())
- return std::string();
-
- std::string encoded;
- bool result = net::X509Certificate::GetDEREncoded(cert->os_cert_handle(),
- &encoded);
- CHECK(result);
- return encoded;
+ std::string der_cert;
+ net::x509_util::CreateSelfSignedCert(
+ key_.get(),
+ "CN=chromoting",
+ base::RandInt(1, std::numeric_limits<int>::max()),
+ base::Time::Now(),
+ base::Time::Now() + base::TimeDelta::FromDays(1),
+ &der_cert);
+ return der_cert;
}
} // namespace remoting