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

Unified Diff: base/crypto/symmetric_key_mac.cc

Issue 1528021: Implement PBKDF2-based key derivation, random key generation,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Make albertb's suggested changes. Created 10 years, 8 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 | « base/crypto/symmetric_key.h ('k') | base/crypto/symmetric_key_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/crypto/symmetric_key_mac.cc
===================================================================
--- base/crypto/symmetric_key_mac.cc (revision 43766)
+++ base/crypto/symmetric_key_mac.cc (working copy)
@@ -29,7 +29,7 @@
return CSSM_ALGID_SHA1HMAC_LEGACY;
}
}
-
+
void* CreateRandomBytes(size_t size) {
CSSM_RETURN err;
CSSM_CC_HANDLE ctx;
@@ -49,8 +49,8 @@
}
CSSM_DeleteContext(ctx);
return random_data.Data; // Caller responsible for freeing this
-}
-
+}
+
inline CSSM_DATA StringToData(const std::string& str) {
CSSM_DATA data = {
str.size(),
@@ -63,6 +63,8 @@
namespace base {
+SymmetricKey::~SymmetricKey() {}
+
// static
SymmetricKey* SymmetricKey::GenerateRandomKey(Algorithm algorithm,
size_t key_size_in_bits) {
@@ -123,7 +125,7 @@
DCHECK_EQ(cssm_key.KeyData.Length, key_size_in_bits / 8);
derived_key = new SymmetricKey(cssm_key.KeyData.Data, key_size_in_bits);
-exit:
+ exit:
CSSM_DeleteContext(ctx);
CSSM_FreeKey(GetSharedCSPHandle(), &credentials, &cssm_key, false);
return derived_key;
« no previous file with comments | « base/crypto/symmetric_key.h ('k') | base/crypto/symmetric_key_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698