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

Unified Diff: content/renderer/webcrypto/shared_crypto.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
Index: content/renderer/webcrypto/shared_crypto.cc
diff --git a/content/renderer/webcrypto/shared_crypto.cc b/content/renderer/webcrypto/shared_crypto.cc
index 1d6c94a2a5f24c29029a8db7baa936cdbf421c63..b3681c36db6e1e06ac82cec3c44f855982c19afb 100644
--- a/content/renderer/webcrypto/shared_crypto.cc
+++ b/content/renderer/webcrypto/shared_crypto.cc
@@ -11,9 +11,7 @@
#include "crypto/secure_util.h"
#include "third_party/WebKit/public/platform/WebCryptoAlgorithm.h"
#include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h"
-#ifdef WEBCRYPTO_HAS_KEY_ALGORITHM
#include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h"
-#endif
#include "third_party/WebKit/public/platform/WebCryptoKey.h"
namespace content {
@@ -189,13 +187,8 @@ Status SignRsaSsaPkcs1v1_5(const blink::WebCryptoAlgorithm& algorithm,
if (status.IsError())
return status;
-#ifdef WEBCRYPTO_HAS_KEY_ALGORITHM
return platform::SignRsaSsaPkcs1v1_5(
private_key, key.algorithm().rsaHashedParams()->hash(), data, buffer);
-#else
- return platform::SignRsaSsaPkcs1v1_5(
- private_key, algorithm.rsaSsaParams()->hash(), data, buffer);
-#endif
}
Status VerifyRsaSsaPkcs1v1_5(const blink::WebCryptoAlgorithm& algorithm,
@@ -208,20 +201,12 @@ Status VerifyRsaSsaPkcs1v1_5(const blink::WebCryptoAlgorithm& algorithm,
if (status.IsError())
return status;
-#ifdef WEBCRYPTO_HAS_KEY_ALGORITHM
return platform::VerifyRsaSsaPkcs1v1_5(
public_key,
key.algorithm().rsaHashedParams()->hash(),
signature,
data,
signature_match);
-#else
- return platform::VerifyRsaSsaPkcs1v1_5(public_key,
- algorithm.rsaSsaParams()->hash(),
- signature,
- data,
- signature_match);
-#endif
}
Status ImportKeyRaw(const CryptoData& key_data,
@@ -327,12 +312,8 @@ Status GenerateSecretKey(const blink::WebCryptoAlgorithm& algorithm,
break;
}
case blink::WebCryptoAlgorithmIdHmac: {
-#ifdef WEBCRYPTO_HAS_KEY_ALGORITHM
const blink::WebCryptoHmacKeyGenParams* params =
algorithm.hmacKeyGenParams();
-#else
- const blink::WebCryptoHmacKeyParams* params = algorithm.hmacKeyParams();
-#endif
DCHECK(params);
if (params->hasLengthBytes()) {
keylen_bytes = params->optionalLengthBytes();
@@ -364,7 +345,6 @@ Status GenerateKeyPair(const blink::WebCryptoAlgorithm& algorithm,
blink::WebCryptoKey* private_key) {
// TODO(padolph): Handle other asymmetric algorithm key generation.
switch (algorithm.paramsType()) {
-#ifdef WEBCRYPTO_HAS_KEY_ALGORITHM
case blink::WebCryptoAlgorithmParamsTypeRsaHashedKeyGenParams:
case blink::WebCryptoAlgorithmParamsTypeRsaKeyGenParams: {
const blink::WebCryptoRsaKeyGenParams* params = NULL;
@@ -376,13 +356,6 @@ Status GenerateKeyPair(const blink::WebCryptoAlgorithm& algorithm,
} else {
params = algorithm.rsaKeyGenParams();
}
-#else
- case blink::WebCryptoAlgorithmParamsTypeRsaKeyGenParams: {
- const blink::WebCryptoRsaKeyGenParams* params =
- algorithm.rsaKeyGenParams();
- blink::WebCryptoAlgorithm hash_or_null =
- blink::WebCryptoAlgorithm::createNull();
-#endif
if (!params->modulusLengthBits())
return Status::ErrorGenerateRsaZeroModulus();
« no previous file with comments | « content/renderer/webcrypto/platform_crypto_openssl.cc ('k') | content/renderer/webcrypto/shared_crypto_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698