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

Unified Diff: base/crypto/symmetric_key_openssl.cc

Issue 4963002: Refactor EnsureOpenSSLInit and openssl_util into base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 10 years, 1 month 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 | « base/crypto/encryptor_openssl.cc ('k') | base/openssl_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/crypto/symmetric_key_openssl.cc
diff --git a/base/crypto/symmetric_key_openssl.cc b/base/crypto/symmetric_key_openssl.cc
index e46913548cd67d3961089718be0cc3297b7606c3..9f0ad385b02cd43c18622dac811e325997fb2446 100644
--- a/base/crypto/symmetric_key_openssl.cc
+++ b/base/crypto/symmetric_key_openssl.cc
@@ -30,6 +30,7 @@ SymmetricKey* SymmetricKey::GenerateRandomKey(Algorithm algorithm,
if (key_size_in_bits == 0)
return NULL;
+ EnsureOpenSSLInit();
scoped_ptr<SymmetricKey> key(new SymmetricKey);
uint8* key_data =
reinterpret_cast<uint8*>(WriteInto(&key->key_, key_size_in_bytes + 1));
@@ -53,6 +54,7 @@ SymmetricKey* SymmetricKey::DeriveKeyFromPassword(Algorithm algorithm,
int key_size_in_bytes = key_size_in_bits / 8;
DCHECK_EQ(static_cast<int>(key_size_in_bits), key_size_in_bytes * 8);
+ EnsureOpenSSLInit();
scoped_ptr<SymmetricKey> key(new SymmetricKey);
uint8* key_data =
reinterpret_cast<uint8*>(WriteInto(&key->key_, key_size_in_bytes + 1));
« no previous file with comments | « base/crypto/encryptor_openssl.cc ('k') | base/openssl_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698