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

Unified Diff: crypto/rsa_private_key_openssl.cc

Issue 7457021: Fix linux redux build (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: bulach comment Created 9 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/rsa_private_key_openssl.cc
diff --git a/crypto/rsa_private_key_openssl.cc b/crypto/rsa_private_key_openssl.cc
index b9902a0e3d243ab2388aa4552a071610d8b27d59..63efb9c4f875e2e50b85ded1c7ed2664bca0aff7 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)));
Denis Lagno 2011/07/20 11:13:59 some methods from stl_util are still widely used a
+ 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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698