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

Unified Diff: content/child/webcrypto/shared_crypto.cc

Issue 377723002: Fixes for re-enabling more MSVC level 4 warnings: content/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « content/child/webcrypto/jwk.cc ('k') | content/common/child_process_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/shared_crypto.cc
diff --git a/content/child/webcrypto/shared_crypto.cc b/content/child/webcrypto/shared_crypto.cc
index 65559b04c826f3f36bf81d40606016abceb4317c..03804abbfc3b1aab24b7415c6a77028f8fa88ff4 100644
--- a/content/child/webcrypto/shared_crypto.cc
+++ b/content/child/webcrypto/shared_crypto.cc
@@ -484,9 +484,6 @@ Status BestEffortCheckKeyUsagesForImport(blink::WebCryptoAlgorithmId algorithm,
return CheckKeyUsages(algorithm, blink::WebCryptoKeyTypeSecret, usages);
// Try to infer the key type given the import format.
- blink::WebCryptoKeyType key_type;
- bool key_type_known = false;
-
switch (format) {
case blink::WebCryptoKeyFormatRaw:
// TODO(eroman): The spec defines Diffie-Hellman raw import for public
@@ -494,23 +491,15 @@ Status BestEffortCheckKeyUsagesForImport(blink::WebCryptoAlgorithmId algorithm,
// implemented.
return Status::ErrorUnexpected();
case blink::WebCryptoKeyFormatSpki:
- key_type = blink::WebCryptoKeyTypePublic;
- key_type_known = true;
- break;
+ return CheckKeyUsages(algorithm, blink::WebCryptoKeyTypePublic, usages);
case blink::WebCryptoKeyFormatPkcs8:
- key_type = blink::WebCryptoKeyTypePrivate;
- key_type_known = true;
- break;
+ return CheckKeyUsages(algorithm, blink::WebCryptoKeyTypePrivate, usages);
case blink::WebCryptoKeyFormatJwk:
- key_type_known = false;
break;
default:
return Status::ErrorUnexpected();
}
- if (key_type_known)
- return CheckKeyUsages(algorithm, key_type, usages);
-
// If the key type is not known, then the algorithm is asymmetric. Whether the
// key data describes a public or private key isn't known yet. But it must at
// least be ONE of those two.
« no previous file with comments | « content/child/webcrypto/jwk.cc ('k') | content/common/child_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698