summaryrefslogtreecommitdiffstats
path: root/base/crypto/symmetric_key_win.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/crypto/symmetric_key_win.cc')
-rw-r--r--base/crypto/symmetric_key_win.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/base/crypto/symmetric_key_win.cc b/base/crypto/symmetric_key_win.cc
index 7d2080c..eb772d5 100644
--- a/base/crypto/symmetric_key_win.cc
+++ b/base/crypto/symmetric_key_win.cc
@@ -454,7 +454,8 @@ SymmetricKey* SymmetricKey::DeriveKeyFromPassword(Algorithm algorithm,
// static
SymmetricKey* SymmetricKey::Import(Algorithm algorithm,
- const std::string& raw_key) {
+ const void* key_data,
+ size_t key_size_in_bytes) {
// TODO(wtc): support HMAC.
DCHECK_EQ(algorithm, AES);
@@ -464,16 +465,16 @@ SymmetricKey* SymmetricKey::Import(Algorithm algorithm,
if (!ok)
return NULL;
- ALG_ID alg = GetAESAlgIDForKeySize(raw_key.size() * 8);
+ ALG_ID alg = GetAESAlgIDForKeySize(key_size_in_bytes * 8);
if (alg == 0)
return NULL;
ScopedHCRYPTKEY key;
- if (!ImportRawKey(provider, alg, raw_key.data(), raw_key.size(), &key))
+ if (!ImportRawKey(provider, alg, key_data, key_size_in_bytes, &key))
return NULL;
return new SymmetricKey(provider.release(), key.release(),
- raw_key.data(), raw_key.size());
+ key_data, key_size_in_bytes);
}
bool SymmetricKey::GetRawKey(std::string* raw_key) {