diff options
author | Daulet Zhanguzin <dauletz@google.com> | 2020-05-13 18:30:42 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-05-13 18:30:42 +0000 |
commit | be7ca6c867d0a1704cf14ee08717ab4dde5aac77 (patch) | |
tree | c57297b903987e510265cdb231e2c78e61d359a2 | |
parent | 4f802d80c825390dfb30e2ee3e700b331adedbf4 (diff) | |
parent | 858d8e28ae1adb954899c44645344a1b06a9a5ab (diff) | |
download | wycheproof-be7ca6c867d0a1704cf14ee08717ab4dde5aac77.tar.gz |
Remove deprecated BouncyCastle algorithms am: 013daa2841 am: 2c75c3e2c1 am: 858d8e28ae
Change-Id: I2ef7d577980e0942b5425ff35bd8dc1e8a83e02a
9 files changed, 70 insertions, 13 deletions
diff --git a/java/com/google/security/wycheproof/BouncyCastleAllTests.java b/java/com/google/security/wycheproof/BouncyCastleAllTests.java index 7bf5792..2ce1290 100644 --- a/java/com/google/security/wycheproof/BouncyCastleAllTests.java +++ b/java/com/google/security/wycheproof/BouncyCastleAllTests.java @@ -37,13 +37,7 @@ import org.junit.runners.Suite.SuiteClasses; DhTest.class, DhiesTest.class, DsaTest.class, - EcKeyTest.class, - EcdhTest.class, - EcdsaTest.class, EciesTest.class, - RsaEncryptionTest.class, - RsaKeyTest.class, - RsaSignatureTest.class, }) @Provider(ProviderType.BOUNCY_CASTLE) public final class BouncyCastleAllTests { diff --git a/java/com/google/security/wycheproof/BouncyCastleTest.java b/java/com/google/security/wycheproof/BouncyCastleTest.java index 6fd118c..c5beb94 100644 --- a/java/com/google/security/wycheproof/BouncyCastleTest.java +++ b/java/com/google/security/wycheproof/BouncyCastleTest.java @@ -38,13 +38,7 @@ import org.junit.runners.Suite.SuiteClasses; DhTest.class, DhiesTest.class, DsaTest.class, - EcKeyTest.class, - EcdhTest.class, - EcdsaTest.class, EciesTest.class, - RsaEncryptionTest.class, - RsaKeyTest.class, - RsaSignatureTest.class, }) @Provider(ProviderType.BOUNCY_CASTLE) @Fast diff --git a/java/com/google/security/wycheproof/ConscryptTest.java b/java/com/google/security/wycheproof/ConscryptTest.java index 2a87a7b..1cd5cf6 100644 --- a/java/com/google/security/wycheproof/ConscryptTest.java +++ b/java/com/google/security/wycheproof/ConscryptTest.java @@ -31,16 +31,21 @@ import org.junit.runners.Suite.SuiteClasses; */ @RunWith(WycheproofRunner.class) @SuiteClasses({ + AesEaxTest.class, AesGcmTest.class, BasicTest.class, CipherInputStreamTest.class, CipherOutputStreamTest.class, + DhTest.class, + DhiesTest.class, + DsaTest.class, EcKeyTest.class, EcdhTest.class, EcdsaTest.class, + EciesTest.class, RsaEncryptionTest.class, RsaKeyTest.class, - RsaSignatureTest.class + RsaSignatureTest.class, }) @Provider(ProviderType.CONSCRYPT) @Fast diff --git a/java/com/google/security/wycheproof/testcases/DsaTest.java b/java/com/google/security/wycheproof/testcases/DsaTest.java index bf7761e..62ddb01 100644 --- a/java/com/google/security/wycheproof/testcases/DsaTest.java +++ b/java/com/google/security/wycheproof/testcases/DsaTest.java @@ -26,6 +26,7 @@ // signature multiple times, since this allows to get more accurate timings. package com.google.security.wycheproof; +import com.google.security.wycheproof.WycheproofRunner.ExcludedTest; import com.google.security.wycheproof.WycheproofRunner.ProviderType; import com.google.security.wycheproof.WycheproofRunner.SlowTest; // Android-removed: Android doesn't support JMX @@ -891,6 +892,9 @@ public class DsaTest extends TestCase { * test until April 2016. */ @SuppressWarnings("InsecureCryptoUsage") + @ExcludedTest( + providers = {ProviderType.BOUNCY_CASTLE}, + comment = "Signature.SHA1WithDSA is removed") public void testDsaBias() throws Exception { // q is close to 2/3 * 2^160. BigInteger q = new BigInteger("974317976835659416858874959372334979171063697271"); diff --git a/java/com/google/security/wycheproof/testcases/EcKeyTest.java b/java/com/google/security/wycheproof/testcases/EcKeyTest.java index 8d3563c..a18a8ff 100644 --- a/java/com/google/security/wycheproof/testcases/EcKeyTest.java +++ b/java/com/google/security/wycheproof/testcases/EcKeyTest.java @@ -21,6 +21,8 @@ package com.google.security.wycheproof; +import com.google.security.wycheproof.WycheproofRunner.ExcludedTest; +import com.google.security.wycheproof.WycheproofRunner.ProviderType; import java.math.BigInteger; import java.security.InvalidAlgorithmParameterException; import java.security.KeyFactory; @@ -127,6 +129,9 @@ public class EcKeyTest extends TestCase { + "8c0b49bbb85c3303ddb1553c3b761c2caacca71606ba9ebac8", }; + @ExcludedTest( + providers = {ProviderType.BOUNCY_CASTLE}, + comment = "KeyFactory.EC is removed") public void testEncodedPublicKey() throws Exception { KeyFactory kf = KeyFactory.getInstance("EC"); for (String encodedHex : EC_INVALID_PUBLIC_KEYS) { @@ -142,6 +147,9 @@ public class EcKeyTest extends TestCase { } } + @ExcludedTest( + providers = {ProviderType.BOUNCY_CASTLE}, + comment = "KeyPairGenerator.EC is removed") public void testEncodedPrivateKey() throws Exception { KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC"); keyGen.initialize(EcUtil.getNistP256Params()); @@ -185,6 +193,9 @@ public class EcKeyTest extends TestCase { // TODO(bleichen): use RandomUtil } + @ExcludedTest( + providers = {ProviderType.BOUNCY_CASTLE}, + comment = "KeyPairGenerator.EC is removed") public void testKeyGenerationAll() throws Exception { testKeyGeneration(EcUtil.getNistP224Params(), true); testKeyGeneration(EcUtil.getNistP256Params(), true); @@ -202,6 +213,9 @@ public class EcKeyTest extends TestCase { * Nist recommends a minimal security strength of 112 bits for the time until 2030. * To achieve this security strength EC keys of at least 224 bits are required. */ + @ExcludedTest( + providers = {ProviderType.BOUNCY_CASTLE}, + comment = "KeyPairGenerator.EC is removed") public void testDefaultKeyGeneration() throws Exception { KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC"); KeyPair keyPair = keyGen.generateKeyPair(); diff --git a/java/com/google/security/wycheproof/testcases/EcdhTest.java b/java/com/google/security/wycheproof/testcases/EcdhTest.java index 00be916..c1a8b82 100644 --- a/java/com/google/security/wycheproof/testcases/EcdhTest.java +++ b/java/com/google/security/wycheproof/testcases/EcdhTest.java @@ -16,6 +16,8 @@ package com.google.security.wycheproof; +import com.google.security.wycheproof.WycheproofRunner.ExcludedTest; +import com.google.security.wycheproof.WycheproofRunner.ProviderType; import java.math.BigInteger; import java.security.GeneralSecurityException; import java.security.InvalidKeyException; @@ -827,6 +829,9 @@ public class EcdhTest extends TestCase { }; /** Checks that key agreement using ECDH works. */ + @ExcludedTest( + providers = {ProviderType.BOUNCY_CASTLE}, + comment = "KeyPairGenerator.EC is removed") public void testBasic() throws Exception { KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC"); ECGenParameterSpec ecSpec = new ECGenParameterSpec("secp256r1"); @@ -845,6 +850,9 @@ public class EcdhTest extends TestCase { assertEquals(TestUtil.bytesToHex(kAB), TestUtil.bytesToHex(kBA)); } + @ExcludedTest( + providers = {ProviderType.BOUNCY_CASTLE}, + comment = "KeyAgreement.ECDH is removed") public void testVectors() throws Exception { KeyAgreement ka = KeyAgreement.getInstance("ECDH"); for (EcdhTestVector t : ECDH_TEST_VECTORS) { @@ -859,6 +867,9 @@ public class EcdhTest extends TestCase { } } + @ExcludedTest( + providers = {ProviderType.BOUNCY_CASTLE}, + comment = "KeyFactory.EC is removed") public void testDecode() throws Exception { KeyFactory kf = KeyFactory.getInstance("EC"); ECPublicKey key1 = (ECPublicKey) kf.generatePublic(EC_VALID_PUBLIC_KEY.getSpec()); diff --git a/java/com/google/security/wycheproof/testcases/EcdsaTest.java b/java/com/google/security/wycheproof/testcases/EcdsaTest.java index c279aaf..0d65286 100644 --- a/java/com/google/security/wycheproof/testcases/EcdsaTest.java +++ b/java/com/google/security/wycheproof/testcases/EcdsaTest.java @@ -16,6 +16,7 @@ package com.google.security.wycheproof; +import com.google.security.wycheproof.WycheproofRunner.ExcludedTest; import com.google.security.wycheproof.WycheproofRunner.ProviderType; import com.google.security.wycheproof.WycheproofRunner.SlowTest; // Android-removed: Android doesn't support JMX @@ -640,12 +641,18 @@ public class EcdsaTest extends TestCase { assertEquals(0, errors); } + @ExcludedTest( + providers = {ProviderType.BOUNCY_CASTLE}, + comment = "Signature.SHA256WithECDSA is removed") public void testValidSignatures() throws Exception { testVectors( VALID_SIGNATURES, publicKey1(), "Hello", "SHA256WithECDSA", "Valid ECDSA signature", true, true); } + @ExcludedTest( + providers = {ProviderType.BOUNCY_CASTLE}, + comment = "Signature.SHA256WithECDSA is removed") public void testModifiedSignatures() throws Exception { testVectors( MODIFIED_SIGNATURES, @@ -657,6 +664,9 @@ public class EcdsaTest extends TestCase { true); } + @ExcludedTest( + providers = {ProviderType.BOUNCY_CASTLE}, + comment = "Signature.SHA256WithECDSA is removed") public void testInvalidSignatures() throws Exception { testVectors( INVALID_SIGNATURES, @@ -672,6 +682,9 @@ public class EcdsaTest extends TestCase { * This test checks the basic functionality of ECDSA. It can also be used to generate simple test * vectors. */ + @ExcludedTest( + providers = {ProviderType.BOUNCY_CASTLE}, + comment = "KeyPairGenerator.EC is removed") public void testBasic() throws Exception { String algorithm = "SHA256WithECDSA"; String hashAlgorithm = "SHA-256"; diff --git a/java/com/google/security/wycheproof/testcases/RsaKeyTest.java b/java/com/google/security/wycheproof/testcases/RsaKeyTest.java index b761dae..bfe5249 100644 --- a/java/com/google/security/wycheproof/testcases/RsaKeyTest.java +++ b/java/com/google/security/wycheproof/testcases/RsaKeyTest.java @@ -16,6 +16,8 @@ package com.google.security.wycheproof; +import com.google.security.wycheproof.WycheproofRunner.ExcludedTest; +import com.google.security.wycheproof.WycheproofRunner.ProviderType; import java.math.BigInteger; import java.security.KeyFactory; import java.security.KeyPair; @@ -1454,6 +1456,9 @@ public class RsaKeyTest extends TestCase { checkKeyPair(keypair, keySizeInBits); } + @ExcludedTest( + providers = {ProviderType.BOUNCY_CASTLE}, + comment = "KeyPairGenerator.RSA is removed") public void testKeyGeneration() throws Exception { testKeyGenerationSize(1024); testKeyGenerationSize(2048); @@ -1466,6 +1471,9 @@ public class RsaKeyTest extends TestCase { * Such a failure does not need to be a bug, since several encoding for the same key are * possible. */ + @ExcludedTest( + providers = {ProviderType.BOUNCY_CASTLE}, + comment = "KeyFactory.RSA is removed") public void testEncodeDecodePublic() throws Exception { KeyFactory kf = KeyFactory.getInstance("RSA"); byte[] encoded = TestUtil.hexToBytes(ENCODED_PUBLIC_KEY); @@ -1483,6 +1491,9 @@ public class RsaKeyTest extends TestCase { * This test has mostly "defense in depth" characteristic, since applications should * never accept unauthenticated public keys. */ + @ExcludedTest( + providers = {ProviderType.BOUNCY_CASTLE}, + comment = "KeyFactory.RSA is removed") public void testModifiedPublicKeyDecoding() throws Exception { KeyFactory kf = KeyFactory.getInstance("RSA"); int cnt = 0; diff --git a/java/com/google/security/wycheproof/testcases/RsaSignatureTest.java b/java/com/google/security/wycheproof/testcases/RsaSignatureTest.java index 3d214fe..f9e97ba 100644 --- a/java/com/google/security/wycheproof/testcases/RsaSignatureTest.java +++ b/java/com/google/security/wycheproof/testcases/RsaSignatureTest.java @@ -16,6 +16,8 @@ package com.google.security.wycheproof; +import com.google.security.wycheproof.WycheproofRunner.ExcludedTest; +import com.google.security.wycheproof.WycheproofRunner.ProviderType; import java.math.BigInteger; import java.security.KeyFactory; import java.security.KeyPair; @@ -1074,6 +1076,9 @@ public class RsaSignatureTest extends TestCase { + "0000", }; + @ExcludedTest( + providers = {ProviderType.BOUNCY_CASTLE}, + comment = "KeyPairGenerator.RSA is removed") public void testBasic() throws Exception { String algorithm = "SHA256WithRSA"; String hashAlgorithm = "SHA-256"; @@ -1155,6 +1160,9 @@ public class RsaSignatureTest extends TestCase { } /** SunJCE threw an OutOfMemoryError with one of the signatures. */ + @ExcludedTest( + providers = {ProviderType.BOUNCY_CASTLE}, + comment = "KeyFactory.RSA is removed") public void testVectorsAll() throws Exception { testVectors(RSA_KEY1, ALGORITHM_KEY1, SIGNATURES_KEY1); } @@ -1187,6 +1195,9 @@ public class RsaSignatureTest extends TestCase { * https://groups.google.com/a/chromium.org/forum/#!topic/chromium-reviews/Jo5S7HtEABI claims that * 7% of the responses in the Online Certificate Status Protocol (OCSP) miss the NULL parameter */ + @ExcludedTest( + providers = {ProviderType.BOUNCY_CASTLE}, + comment = "KeyFactory.RSA is removed") public void testLegacySignatures() throws Exception { RSAPublicKeySpec key = RSA_KEY1; String algorithm = ALGORITHM_KEY1; |