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

Unified Diff: chrome/renderer/extensions/enterprise_platform_keys_natives.cc

Issue 331173002: enterprise.platformKeys: Respect the 'hash' argument of generateKey. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 6 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
Index: chrome/renderer/extensions/enterprise_platform_keys_natives.cc
diff --git a/chrome/renderer/extensions/enterprise_platform_keys_natives.cc b/chrome/renderer/extensions/enterprise_platform_keys_natives.cc
index 2e11b25d09b642d2448fd1f8cc650dc720ada04e..9bccc8126e5125b655ffcfcc44d21697b87f3e37 100644
--- a/chrome/renderer/extensions/enterprise_platform_keys_natives.cc
+++ b/chrome/renderer/extensions/enterprise_platform_keys_natives.cc
@@ -56,6 +56,15 @@ scoped_ptr<base::DictionaryValue> WebCryptoAlgorithmToBaseValue(
base::BinaryValue::CreateWithCopiedBuffer(
reinterpret_cast<const char*>(public_exponent.data()),
public_exponent.size()));
+
+ const blink::WebCryptoAlgorithm& hash = rsaHashedKeyGen->hash();
+ DCHECK(!hash.isNull());
+ const blink::WebCryptoAlgorithmInfo* hash_info =
+ blink::WebCryptoAlgorithm::lookupAlgorithmInfo(hash.id());
+
+ scoped_ptr<base::DictionaryValue> hash_dict(new base::DictionaryValue);
+ hash_dict->SetStringWithoutPathExpansion("name", hash_info->name);
+ dict->SetWithoutPathExpansion("hash", hash_dict.release());
}
// Otherwise, |algorithm| is missing support here or no parameters were
// required.

Powered by Google App Engine
This is Rietveld 408576698