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

Unified Diff: content/renderer/webcrypto/jwk.cc

Issue 182073002: [webcrypto] Remove code conditional on !defined(WEBCRYPTO_HAS_KEY_ALGORITHM). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 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
« no previous file with comments | « no previous file | content/renderer/webcrypto/platform_crypto_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/webcrypto/jwk.cc
diff --git a/content/renderer/webcrypto/jwk.cc b/content/renderer/webcrypto/jwk.cc
index 920c271b1f19656c69c8343b72a90d84afe76389..5d72f45288e0f7f8409154026733ae21dd94892d 100644
--- a/content/renderer/webcrypto/jwk.cc
+++ b/content/renderer/webcrypto/jwk.cc
@@ -15,7 +15,6 @@
#include "content/renderer/webcrypto/platform_crypto.h"
#include "content/renderer/webcrypto/shared_crypto.h"
#include "content/renderer/webcrypto/webcrypto_util.h"
-#include "third_party/WebKit/public/platform/WebCrypto.h" // TODO(eroman): delete
namespace content {
@@ -142,7 +141,6 @@ class JwkAlgorithmRegistry {
base::LazyInstance<JwkAlgorithmRegistry> jwk_alg_registry =
LAZY_INSTANCE_INITIALIZER;
-#ifdef WEBCRYPTO_HAS_KEY_ALGORITHM
bool ImportAlgorithmsConsistent(const blink::WebCryptoAlgorithm& alg1,
const blink::WebCryptoAlgorithm& alg2) {
DCHECK(!alg1.isNull());
@@ -164,39 +162,6 @@ bool ImportAlgorithmsConsistent(const blink::WebCryptoAlgorithm& alg1,
return false;
}
}
-#else
-bool ImportAlgorithmsConsistent(const blink::WebCryptoAlgorithm& alg1,
- const blink::WebCryptoAlgorithm& alg2) {
- DCHECK(!alg1.isNull());
- DCHECK(!alg2.isNull());
- if (alg1.id() != alg2.id())
- return false;
- switch (alg1.id()) {
- case blink::WebCryptoAlgorithmIdHmac:
- case blink::WebCryptoAlgorithmIdRsaOaep:
- case blink::WebCryptoAlgorithmIdRsaSsaPkcs1v1_5:
- if (ImportAlgorithmsConsistent(GetInnerHashAlgorithm(alg1),
- GetInnerHashAlgorithm(alg2))) {
- return true;
- }
- break;
- case blink::WebCryptoAlgorithmIdRsaEsPkcs1v1_5:
- case blink::WebCryptoAlgorithmIdSha1:
- case blink::WebCryptoAlgorithmIdSha224:
- case blink::WebCryptoAlgorithmIdSha256:
- case blink::WebCryptoAlgorithmIdSha384:
- case blink::WebCryptoAlgorithmIdSha512:
- case blink::WebCryptoAlgorithmIdAesCbc:
- case blink::WebCryptoAlgorithmIdAesGcm:
- case blink::WebCryptoAlgorithmIdAesCtr:
- return true;
- default:
- NOTREACHED(); // Not a supported algorithm.
- break;
- }
- return false;
-}
-#endif
// Extracts the required string property with key |path| from |dict| and saves
// the result to |*result|. If the property does not exist or is not a string,
« no previous file with comments | « no previous file | content/renderer/webcrypto/platform_crypto_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698