diff options
author | Thai Duong <thaidn@users.noreply.github.com> | 2017-02-01 16:04:21 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-01 16:04:21 -0800 |
commit | 9130b7625ff41c8f4684de3b352ef04cf487cac7 (patch) | |
tree | 3b4fda64cfd9dc8b8563c2c2add135ac972f7b20 /java | |
parent | f2f6a309e29139b949dde8ca59305699f5daf462 (diff) | |
download | wycheproof-9130b7625ff41c8f4684de3b352ef04cf487cac7.tar.gz |
Fix ErrorProne build errors (#21)
* Fix ErrorProne build errors
Diffstat (limited to 'java')
6 files changed, 23 insertions, 23 deletions
diff --git a/java/com/google/security/wycheproof/testcases/CipherInputStreamTest.java b/java/com/google/security/wycheproof/testcases/CipherInputStreamTest.java index f094a3b..da7e4fb 100644 --- a/java/com/google/security/wycheproof/testcases/CipherInputStreamTest.java +++ b/java/com/google/security/wycheproof/testcases/CipherInputStreamTest.java @@ -61,7 +61,7 @@ public class CipherInputStreamTest extends TestCase { public byte[] aad; public byte[] ct; - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public TestVector( String algorithm, int keySize, int ivSize, int tagSize, int ptSize, int aadSize) throws Exception { @@ -100,7 +100,7 @@ public class CipherInputStreamTest extends TestCase { return result; } - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public void testEncrypt(Iterable<TestVector> tests) throws Exception { for (TestVector t : tests) { Cipher cipher = Cipher.getInstance(t.algorithm); @@ -124,7 +124,7 @@ public class CipherInputStreamTest extends TestCase { } /** JDK-8016249: CipherInputStream in decrypt mode fails on close with AEAD ciphers */ - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public void testDecrypt(Iterable<TestVector> tests) throws Exception { for (TestVector t : tests) { Cipher cipher = Cipher.getInstance(t.algorithm); @@ -155,7 +155,7 @@ public class CipherInputStreamTest extends TestCase { * with BouncyCastle v 1.52. A possible explanation is that BouncyCastle has its own * implemenatation of CipherInputStream (org.bouncycastle.crypto.io.CipherInputStream). */ - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public void testCorruptDecrypt(Iterable<TestVector> tests) throws Exception { for (TestVector t : tests) { Cipher cipher = Cipher.getInstance(t.algorithm); @@ -189,7 +189,7 @@ public class CipherInputStreamTest extends TestCase { } } - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public void testCorruptDecryptEmpty(Iterable<TestVector> tests) throws Exception { for (TestVector t : tests) { Cipher cipher = Cipher.getInstance(t.algorithm); diff --git a/java/com/google/security/wycheproof/testcases/CipherOutputStreamTest.java b/java/com/google/security/wycheproof/testcases/CipherOutputStreamTest.java index 735056e..e4f288a 100644 --- a/java/com/google/security/wycheproof/testcases/CipherOutputStreamTest.java +++ b/java/com/google/security/wycheproof/testcases/CipherOutputStreamTest.java @@ -52,7 +52,7 @@ public class CipherOutputStreamTest extends TestCase { } /** Test vectors */ - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public static class TestVector { public String algorithm; public SecretKeySpec key; @@ -99,7 +99,7 @@ public class CipherOutputStreamTest extends TestCase { return result; } - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public void testEncrypt(Iterable<TestVector> tests) throws Exception { for (TestVector t : tests) { Cipher cipher = Cipher.getInstance(t.algorithm); @@ -113,7 +113,7 @@ public class CipherOutputStreamTest extends TestCase { } } - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public void testDecrypt(Iterable<TestVector> tests) throws Exception { for (TestVector t : tests) { Cipher cipher = Cipher.getInstance(t.algorithm); @@ -127,7 +127,7 @@ public class CipherOutputStreamTest extends TestCase { } } - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public void testCorruptDecrypt(Iterable<TestVector> tests) throws Exception { for (TestVector t : tests) { Cipher cipher = Cipher.getInstance(t.algorithm); @@ -158,7 +158,7 @@ public class CipherOutputStreamTest extends TestCase { } } - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public void testCorruptDecryptEmpty(Iterable<TestVector> tests) throws Exception { for (TestVector t : tests) { Cipher cipher = Cipher.getInstance(t.algorithm); @@ -216,7 +216,7 @@ public class CipherOutputStreamTest extends TestCase { } /** Tests CipherOutputStream with AES-EAX if AES-EAS is supported by the provider. */ - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public void testAesEax() throws Exception { final String algorithm = "AES/EAX/NoPadding"; final int[] keySizes = {16, 32}; diff --git a/java/com/google/security/wycheproof/testcases/DhiesTest.java b/java/com/google/security/wycheproof/testcases/DhiesTest.java index fbf8054..ef27232 100644 --- a/java/com/google/security/wycheproof/testcases/DhiesTest.java +++ b/java/com/google/security/wycheproof/testcases/DhiesTest.java @@ -75,7 +75,7 @@ public class DhiesTest extends TestCase { * works in the sense that it can decrypt what it encrypts. Unfortunately it seems that there is * no secure mode using AES. */ - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public void testDhiesBasic() throws Exception { DHParameterSpec params = ike2048(); KeyPairGenerator kf = KeyPairGenerator.getInstance("DH"); @@ -98,7 +98,7 @@ public class DhiesTest extends TestCase { * ciphertexts. Checks that a modification of the ciphertext is dectected. */ @SlowTest(providers = {ProviderType.BOUNCY_CASTLE, ProviderType.SPONGY_CASTLE}) - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public void testDhiesCorrupt() throws Exception { KeyPairGenerator kf = KeyPairGenerator.getInstance("DH"); kf.initialize(ike2048()); @@ -126,7 +126,7 @@ public class DhiesTest extends TestCase { * Tries to detect if an algorithm is using ECB. Unfortunately, many JCE algorithms use ECB if no * encryption mode is specified. */ - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public void testNotEcb(String algorithm) throws Exception { Cipher dhies; try { diff --git a/java/com/google/security/wycheproof/testcases/DsaTest.java b/java/com/google/security/wycheproof/testcases/DsaTest.java index 4d546bb..e7acbcb 100644 --- a/java/com/google/security/wycheproof/testcases/DsaTest.java +++ b/java/com/google/security/wycheproof/testcases/DsaTest.java @@ -1126,7 +1126,7 @@ public class DsaTest extends TestCase { * DSA does not allow encryption. This test verifies that a provider does not implement an ad hoc * scheme that attempts to turn DSA into a public key encryption scheme. */ - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public void testEncryptionWithDsa() throws Exception { try { Cipher cipher = Cipher.getInstance("DSA"); diff --git a/java/com/google/security/wycheproof/testcases/EciesTest.java b/java/com/google/security/wycheproof/testcases/EciesTest.java index 791d6ea..3846e19 100644 --- a/java/com/google/security/wycheproof/testcases/EciesTest.java +++ b/java/com/google/security/wycheproof/testcases/EciesTest.java @@ -68,7 +68,7 @@ public class EciesTest extends TestCase { * AES-CBC with PKCS #5 padding. HMAC-SHA1 with a 20 byte digest. The AES and the HMAC key are * both 128 bits. */ - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public void testEciesBasic() throws Exception { ECGenParameterSpec ecSpec = new ECGenParameterSpec("secp256r1"); KeyPairGenerator kf = KeyPairGenerator.getInstance("EC"); @@ -92,7 +92,7 @@ public class EciesTest extends TestCase { */ // TODO(bleichen): This test describes BouncyCastles behaviour, but not necessarily what we // expect. - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public void testInvalidNames() throws Exception { String[] invalidNames = new String[] { @@ -114,7 +114,7 @@ public class EciesTest extends TestCase { /** Here are a few names that BouncyCastle accepts. */ // TODO(bleichen): This test describes BouncyCastles behaviour, but not necessarily what we // expect. - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public void testValidNames() throws Exception { String[] invalidNames = new String[] { @@ -151,7 +151,7 @@ public class EciesTest extends TestCase { * <li> CVE-2016-1000345 BouncyCastle before v.1.56 is vulnerable to a padding oracle attack. * </ul> */ - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public void testExceptions(String algorithm) throws Exception { Cipher ecies; try { @@ -197,7 +197,7 @@ public class EciesTest extends TestCase { testExceptions("ECIES"); } - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public void testModifyPoint() throws Exception { ECGenParameterSpec ecSpec = new ECGenParameterSpec("secp256r1"); KeyPairGenerator kf = KeyPairGenerator.getInstance("EC"); @@ -224,7 +224,7 @@ public class EciesTest extends TestCase { * This test tries to detect ECIES implementations using ECB. This is insecure and also violates * the claims of ECIES, since ECIES is secure agains adaptive chosen-ciphertext attacks. */ - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public void testNotEcb(String algorithm) throws Exception { Cipher ecies; try { @@ -257,7 +257,7 @@ public class EciesTest extends TestCase { * Tests whether algorithmA is an alias of algorithmB by encrypting with algorithmA and decrypting * with algorithmB. */ - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public void testIsAlias(String algorithmA, String algorithmB) throws Exception { Cipher eciesA; Cipher eciesB; diff --git a/java/com/google/security/wycheproof/testcases/RsaEncryptionTest.java b/java/com/google/security/wycheproof/testcases/RsaEncryptionTest.java index 79a9d5c..0744b66 100644 --- a/java/com/google/security/wycheproof/testcases/RsaEncryptionTest.java +++ b/java/com/google/security/wycheproof/testcases/RsaEncryptionTest.java @@ -94,7 +94,7 @@ public class RsaEncryptionTest extends TestCase { * differences are too small to be reliably detectable in unit tests. * </ul> */ - @SuppressWarnings("InsecureCipherMode") + @SuppressWarnings("InsecureCryptoUsage") public void testExceptions(String algorithm) throws Exception { KeyPairGenerator keygen = KeyPairGenerator.getInstance("RSA"); keygen.initialize(1024); |