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

Unified Diff: content/renderer/webcrypto/platform_crypto_openssl.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 | « content/renderer/webcrypto/platform_crypto_nss.cc ('k') | content/renderer/webcrypto/shared_crypto.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/webcrypto/platform_crypto_openssl.cc
diff --git a/content/renderer/webcrypto/platform_crypto_openssl.cc b/content/renderer/webcrypto/platform_crypto_openssl.cc
index 696a37f1d2019f9e3a73b75fb9fe7837c53e0877..e0c1e1776f49329d1e0be53228c279960125422c 100644
--- a/content/renderer/webcrypto/platform_crypto_openssl.cc
+++ b/content/renderer/webcrypto/platform_crypto_openssl.cc
@@ -18,9 +18,7 @@
#include "third_party/WebKit/public/platform/WebArrayBuffer.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
namespace content {
@@ -224,13 +222,9 @@ Status GenerateSecretKey(const blink::WebCryptoAlgorithm& algorithm,
if (!(RAND_bytes(&random_bytes[0], keylen_bytes)))
return Status::Error();
-#ifdef WEBCRYPTO_HAS_KEY_ALGORITHM
blink::WebCryptoKeyAlgorithm key_algorithm;
if (!CreateSecretKeyAlgorithm(algorithm, keylen_bytes, &key_algorithm))
return Status::ErrorUnexpected();
-#else
- const blink::WebCryptoAlgorithm key_algorithm = algorithm;
-#endif
*key = blink::WebCryptoKey::create(new SymKey(CryptoData(random_bytes)),
blink::WebCryptoKeyTypeSecret,
@@ -260,14 +254,10 @@ Status ImportKeyRaw(const blink::WebCryptoAlgorithm& algorithm,
blink::WebCryptoKeyUsageMask usage_mask,
blink::WebCryptoKey* key) {
-#ifdef WEBCRYPTO_HAS_KEY_ALGORITHM
blink::WebCryptoKeyAlgorithm key_algorithm;
if (!CreateSecretKeyAlgorithm(
algorithm, key_data.byte_length(), &key_algorithm))
return Status::ErrorUnexpected();
-#else
- const blink::WebCryptoAlgorithm key_algorithm = algorithm;
-#endif
*key = blink::WebCryptoKey::create(new SymKey(key_data),
blink::WebCryptoKeyTypeSecret,
« no previous file with comments | « content/renderer/webcrypto/platform_crypto_nss.cc ('k') | content/renderer/webcrypto/shared_crypto.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698