summaryrefslogtreecommitdiffstats
path: root/crypto/rsa_private_key_openssl.cc
diff options
context:
space:
mode:
authorjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-20 11:07:16 +0000
committerjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-20 11:07:16 +0000
commitd641b6e4c2ebf556cb42818e7b3470329baf170c (patch)
tree2fb4471171eb44c781e6f917e13bce3ecd0148df /crypto/rsa_private_key_openssl.cc
parent4503616f13ffe30793168624b93d1c93702d9db1 (diff)
downloadchromium_src-d641b6e4c2ebf556cb42818e7b3470329baf170c.zip
chromium_src-d641b6e4c2ebf556cb42818e7b3470329baf170c.tar.gz
chromium_src-d641b6e4c2ebf556cb42818e7b3470329baf170c.tar.bz2
Fix linux redux build
Follow up to http://codereview.chromium.org/7342047/ stl_util.h seems out of favor, so calling stl method directly as required. BUG=None TEST=Greeness on http://build.chromium.org/p/chromium.fyi/builders/Chromium%20Linux%20Redux/ Review URL: http://codereview.chromium.org/7457021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93181 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'crypto/rsa_private_key_openssl.cc')
-rw-r--r--crypto/rsa_private_key_openssl.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/crypto/rsa_private_key_openssl.cc b/crypto/rsa_private_key_openssl.cc
index b9902a0..63efb9c 100644
--- a/crypto/rsa_private_key_openssl.cc
+++ b/crypto/rsa_private_key_openssl.cc
@@ -40,8 +40,7 @@ bool ExportKey(EVP_PKEY* key,
if (!data || len < 0)
return false;
- std::vector<uint8> for_output(data, data + len);
- output->swap(for_output);
+ output->assign(data, data + len);
return true;
}
@@ -76,11 +75,12 @@ RSAPrivateKey* RSAPrivateKey::CreateSensitive(uint16 num_bits) {
// static
RSAPrivateKey* RSAPrivateKey::CreateFromPrivateKeyInfo(
const std::vector<uint8>& input) {
- OpenSSLErrStackTracer err_tracer(FROM_HERE);
+ if (input.empty())
+ return NULL;
+ OpenSSLErrStackTracer err_tracer(FROM_HERE);
// BIO_new_mem_buf is not const aware, but it does not modify the buffer.
- char* data = reinterpret_cast<char*>(const_cast<uint8*>(
- vector_as_array(&input)));
+ char* data = reinterpret_cast<char*>(const_cast<uint8*>(&input[0]));
ScopedOpenSSL<BIO, BIO_free_all> bio(BIO_new_mem_buf(data, input.size()));
if (!bio.get())
return NULL;