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

Unified Diff: components/webcrypto/algorithms/ecdsa_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/ecdh_unittest.cc ('k') | components/webcrypto/algorithms/hmac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/webcrypto/algorithms/ecdsa_unittest.cc
diff --git a/components/webcrypto/algorithms/ecdsa_unittest.cc b/components/webcrypto/algorithms/ecdsa_unittest.cc
index 6193c088fc2c2cf1393cdbac93cff6976f342c74..b753f4846741eb2eb2842a7e7e1ac6fab42afd71 100644
--- a/components/webcrypto/algorithms/ecdsa_unittest.cc
+++ b/components/webcrypto/algorithms/ecdsa_unittest.cc
@@ -16,15 +16,6 @@ namespace webcrypto {
namespace {
-bool SupportsEcdsa() {
-#if defined(USE_OPENSSL)
- return true;
-#else
- LOG(ERROR) << "Skipping ECDSA test because unsupported";
- return false;
-#endif
-}
-
blink::WebCryptoAlgorithm CreateEcdsaKeyGenAlgorithm(
blink::WebCryptoNamedCurve named_curve) {
return blink::WebCryptoAlgorithm::adoptParamsAndCreate(
@@ -51,9 +42,6 @@ class WebCryptoEcdsaTest : public WebCryptoTestBase {};
// ensure that the keys are otherwise usable (by trying to sign/verify with
// them).
TEST_F(WebCryptoEcdsaTest, GenerateKeyIsRandom) {
- if (!SupportsEcdsa())
- return;
-
blink::WebCryptoNamedCurve named_curve = blink::WebCryptoNamedCurveP256;
std::vector<std::vector<uint8_t>> serialized_keys;
@@ -91,9 +79,6 @@ TEST_F(WebCryptoEcdsaTest, GenerateKeyIsRandom) {
}
TEST_F(WebCryptoEcdsaTest, GenerateKeyEmptyUsage) {
- if (!SupportsEcdsa())
- return;
-
blink::WebCryptoNamedCurve named_curve = blink::WebCryptoNamedCurveP256;
blink::WebCryptoKey public_key;
blink::WebCryptoKey private_key;
@@ -106,9 +91,6 @@ TEST_F(WebCryptoEcdsaTest, GenerateKeyEmptyUsage) {
// times should yield different signatures. However both signatures should
// verify correctly.
TEST_F(WebCryptoEcdsaTest, SignatureIsRandom) {
- if (!SupportsEcdsa())
- return;
-
// Import a public and private keypair from "ec_private_keys.json". It doesn't
// really matter which one is used since they are all valid. In this case
// using the first one.
@@ -167,9 +149,6 @@ TEST_F(WebCryptoEcdsaTest, SignatureIsRandom) {
// Tests verify() for ECDSA using an assortment of keys, curves and hashes.
// These tests also include expected failures for bad signatures and keys.
TEST_F(WebCryptoEcdsaTest, VerifyKnownAnswer) {
- if (!SupportsEcdsa())
- return;
-
scoped_ptr<base::ListValue> tests;
ASSERT_TRUE(ReadJsonTestFileToList("ecdsa.json", &tests));
@@ -252,9 +231,6 @@ blink::WebCryptoKeyUsageMask GetExpectedUsagesForKeyImport(
// Tests importing bad public/private keys in a variety of formats.
TEST_F(WebCryptoEcdsaTest, ImportBadKeys) {
- if (!SupportsEcdsa())
- return;
-
scoped_ptr<base::ListValue> tests;
ASSERT_TRUE(ReadJsonTestFileToList("bad_ec_keys.json", &tests));
@@ -285,9 +261,6 @@ TEST_F(WebCryptoEcdsaTest, ImportBadKeys) {
// The test imports a key first using JWK, and then exporting it to JWK and
// PKCS8. It does the same thing using PKCS8 as the original source of truth.
TEST_F(WebCryptoEcdsaTest, ImportExportPrivateKey) {
- if (!SupportsEcdsa())
- return;
-
scoped_ptr<base::ListValue> tests;
ASSERT_TRUE(ReadJsonTestFileToList("ec_private_keys.json", &tests));
« no previous file with comments | « components/webcrypto/algorithms/ecdh_unittest.cc ('k') | components/webcrypto/algorithms/hmac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698