summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-01 03:15:29 +0000
committerrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-01 03:15:29 +0000
commit5bdf2b4b687c33bb83ed28bab6ed35da20a4d50e (patch)
tree7666e5405e74387c72715b12cde0292dc7bb0953 /remoting
parent6e2ab656dcf1ecfbdf52b588ad7f9b212af0551d (diff)
downloadchromium_src-5bdf2b4b687c33bb83ed28bab6ed35da20a4d50e.zip
chromium_src-5bdf2b4b687c33bb83ed28bab6ed35da20a4d50e.tar.gz
chromium_src-5bdf2b4b687c33bb83ed28bab6ed35da20a4d50e.tar.bz2
Make X509Certificate::GetDEREncoded a static function taking an OSCertHandle
Rather than require an X509Certificate*, which has additional processing overhead, make X509Certificate::GetDEREncoded a static function which takes an OSCertHandle. Callers which already have an X509Certificate* can easily use ->os_cert_handle(), while those that have an OSCertHandle, such as by way of GetIntermediateCertificates(), can use the OSCertHandle directly. BUG=91464 TEST=none Review URL: http://codereview.chromium.org/8414047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108067 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/host/host_key_pair.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/remoting/host/host_key_pair.cc b/remoting/host/host_key_pair.cc
index 576bc1b..4f81aa8 100644
--- a/remoting/host/host_key_pair.cc
+++ b/remoting/host/host_key_pair.cc
@@ -100,9 +100,11 @@ std::string HostKeyPair::GenerateCertificate() const {
key_.get(), "CN=chromoting",
base::RandInt(1, std::numeric_limits<int>::max()),
base::TimeDelta::FromDays(1));
- std::string result;
- CHECK(cert->GetDEREncoded(&result));
- return result;
+ std::string encoded;
+ bool result = net::X509Certificate::GetDEREncoded(cert->os_cert_handle(),
+ &encoded);
+ CHECK(result);
+ return encoded;
}
} // namespace remoting