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

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

Issue 929683002: Revert "Implement chrome.platformKeys.getKeyPair()." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/platform_keys_natives.cc
diff --git a/chrome/renderer/extensions/platform_keys_natives.cc b/chrome/renderer/extensions/platform_keys_natives.cc
index 186f297ab61af069812f701d0a4ef8a2a6dbeb7c..5e4b770dadc8fa2c02b7f8517ca0f0c03f33f011 100644
--- a/chrome/renderer/extensions/platform_keys_natives.cc
+++ b/chrome/renderer/extensions/platform_keys_natives.cc
@@ -25,10 +25,6 @@ bool StringToWebCryptoOperation(const std::string& str,
*op = blink::WebCryptoOperationGenerateKey;
return true;
}
- if (str == "ImportKey") {
- *op = blink::WebCryptoOperationImportKey;
- return true;
- }
if (str == "Sign") {
*op = blink::WebCryptoOperationSign;
return true;
@@ -48,9 +44,6 @@ scoped_ptr<base::DictionaryValue> WebCryptoAlgorithmToBaseValue(
const blink::WebCryptoAlgorithmInfo* info =
blink::WebCryptoAlgorithm::lookupAlgorithmInfo(algorithm.id());
dict->SetStringWithoutPathExpansion("name", info->name);
-
- const blink::WebCryptoAlgorithm* hash = nullptr;
-
const blink::WebCryptoRsaHashedKeyGenParams* rsaHashedKeyGen =
algorithm.rsaHashedKeyGenParams();
if (rsaHashedKeyGen) {
@@ -64,20 +57,10 @@ scoped_ptr<base::DictionaryValue> WebCryptoAlgorithmToBaseValue(
reinterpret_cast<const char*>(public_exponent.data()),
public_exponent.size()));
- hash = &rsaHashedKeyGen->hash();
- DCHECK(!hash->isNull());
- }
-
- const blink::WebCryptoRsaHashedImportParams* rsaHashedImport =
- algorithm.rsaHashedImportParams();
- if (rsaHashedImport) {
- hash = &rsaHashedImport->hash();
- DCHECK(!hash->isNull());
- }
-
- if (hash) {
+ const blink::WebCryptoAlgorithm& hash = rsaHashedKeyGen->hash();
+ DCHECK(!hash.isNull());
const blink::WebCryptoAlgorithmInfo* hash_info =
- blink::WebCryptoAlgorithm::lookupAlgorithmInfo(hash->id());
+ blink::WebCryptoAlgorithm::lookupAlgorithmInfo(hash.id());
scoped_ptr<base::DictionaryValue> hash_dict(new base::DictionaryValue);
hash_dict->SetStringWithoutPathExpansion("name", hash_info->name);

Powered by Google App Engine
This is Rietveld 408576698