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

Unified Diff: components/webcrypto/algorithms/ecdh_unittest.cc

Issue 1355923002: [refactor] Misc post-NSS WebCrypto cleanups. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@util_split
Patch Set: add an explicit size_t --> unsigned cast Created 5 years, 3 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 | « components/webcrypto/algorithms/aes_ctr.cc ('k') | components/webcrypto/algorithms/ecdsa_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/webcrypto/algorithms/ecdh_unittest.cc
diff --git a/components/webcrypto/algorithms/ecdh_unittest.cc b/components/webcrypto/algorithms/ecdh_unittest.cc
index c84143cc268e10313899c0ae9e505a05d52ec96f..9c5b057570efd913ea229027a9f9ebcb355b3404 100644
--- a/components/webcrypto/algorithms/ecdh_unittest.cc
+++ b/components/webcrypto/algorithms/ecdh_unittest.cc
@@ -16,15 +16,6 @@ namespace webcrypto {
namespace {
-bool SupportsEcdh() {
-#if defined(USE_OPENSSL)
- return true;
-#else
- LOG(ERROR) << "Skipping ECDH test because unsupported";
- return false;
-#endif
-}
-
// TODO(eroman): Test passing an RSA public key instead of ECDH key.
// TODO(eroman): Test passing an ECDSA public key
@@ -83,9 +74,6 @@ bool ImportKeysFromTest(const base::DictionaryValue* test,
class WebCryptoEcdhTest : public WebCryptoTestBase {};
TEST_F(WebCryptoEcdhTest, DeriveBitsKnownAnswer) {
- if (!SupportsEcdh())
- return;
-
scoped_ptr<base::ListValue> tests;
ASSERT_TRUE(ReadJsonTestFileToList("ecdh.json", &tests));
@@ -156,9 +144,6 @@ TEST_F(WebCryptoEcdhTest, DeriveBitsKnownAnswer) {
// Try deriving an AES key of length 129 bits.
TEST_F(WebCryptoEcdhTest, DeriveKeyBadAesLength) {
- if (!SupportsEcdh())
- return;
-
blink::WebCryptoKey public_key;
blink::WebCryptoKey base_key;
ASSERT_TRUE(LoadTestKeys(&public_key, &base_key));
@@ -174,9 +159,6 @@ TEST_F(WebCryptoEcdhTest, DeriveKeyBadAesLength) {
// Try deriving an AES key of length 192 bits.
TEST_F(WebCryptoEcdhTest, DeriveKeyUnsupportedAesLength) {
- if (!SupportsEcdh())
- return;
-
blink::WebCryptoKey public_key;
blink::WebCryptoKey base_key;
ASSERT_TRUE(LoadTestKeys(&public_key, &base_key));
@@ -192,9 +174,6 @@ TEST_F(WebCryptoEcdhTest, DeriveKeyUnsupportedAesLength) {
// Try deriving an HMAC key of length 0 bits.
TEST_F(WebCryptoEcdhTest, DeriveKeyZeroLengthHmac) {
- if (!SupportsEcdh())
- return;
-
blink::WebCryptoKey public_key;
blink::WebCryptoKey base_key;
ASSERT_TRUE(LoadTestKeys(&public_key, &base_key));
@@ -212,9 +191,6 @@ TEST_F(WebCryptoEcdhTest, DeriveKeyZeroLengthHmac) {
// Derive an HMAC key of length 19 bits.
TEST_F(WebCryptoEcdhTest, DeriveKeyHmac19Bits) {
- if (!SupportsEcdh())
- return;
-
blink::WebCryptoKey public_key;
blink::WebCryptoKey base_key;
ASSERT_TRUE(LoadTestKeys(&public_key, &base_key));
@@ -245,9 +221,6 @@ TEST_F(WebCryptoEcdhTest, DeriveKeyHmac19Bits) {
// Derive an HMAC key with no specified length (just the hash of SHA-256).
TEST_F(WebCryptoEcdhTest, DeriveKeyHmacSha256NoLength) {
- if (!SupportsEcdh())
- return;
-
blink::WebCryptoKey public_key;
blink::WebCryptoKey base_key;
ASSERT_TRUE(LoadTestKeys(&public_key, &base_key));
@@ -284,9 +257,6 @@ TEST_F(WebCryptoEcdhTest, DeriveKeyHmacSha256NoLength) {
// and generate keys. For simplicity of testing, however, test using an HMAC
// key.
TEST_F(WebCryptoEcdhTest, DeriveKeyHmacSha512NoLength) {
- if (!SupportsEcdh())
- return;
-
blink::WebCryptoKey public_key;
blink::WebCryptoKey base_key;
ASSERT_TRUE(LoadTestKeys(&public_key, &base_key));
@@ -304,9 +274,6 @@ TEST_F(WebCryptoEcdhTest, DeriveKeyHmacSha512NoLength) {
// Try deriving an AES key of length 128 bits.
TEST_F(WebCryptoEcdhTest, DeriveKeyAes128) {
- if (!SupportsEcdh())
- return;
-
blink::WebCryptoKey public_key;
blink::WebCryptoKey base_key;
ASSERT_TRUE(LoadTestKeys(&public_key, &base_key));
@@ -330,9 +297,6 @@ TEST_F(WebCryptoEcdhTest, DeriveKeyAes128) {
}
TEST_F(WebCryptoEcdhTest, ImportKeyEmptyUsage) {
- if (!SupportsEcdh())
- return;
-
blink::WebCryptoKey key;
scoped_ptr<base::ListValue> tests;
« no previous file with comments | « components/webcrypto/algorithms/aes_ctr.cc ('k') | components/webcrypto/algorithms/ecdsa_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698