aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThai Duong <thaidn@users.noreply.github.com>2017-02-01 16:19:15 -0800
committerGitHub <noreply@github.com>2017-02-01 16:19:15 -0800
commit06d73e03490c49cf7a0eb4769365801288bfa148 (patch)
tree102d64f94067c01b4062bc83bdd91da8cf9c46de
parent9130b7625ff41c8f4684de3b352ef04cf487cac7 (diff)
downloadwycheproof-06d73e03490c49cf7a0eb4769365801288bfa148.tar.gz
Suppress more warnings, sighed (#22)
-rw-r--r--java/com/google/security/wycheproof/testcases/DhTest.java4
-rw-r--r--java/com/google/security/wycheproof/testcases/DsaTest.java8
-rw-r--r--java/com/google/security/wycheproof/testcases/EcdhTest.java4
3 files changed, 15 insertions, 1 deletions
diff --git a/java/com/google/security/wycheproof/testcases/DhTest.java b/java/com/google/security/wycheproof/testcases/DhTest.java
index 84be8f2..32ab83a 100644
--- a/java/com/google/security/wycheproof/testcases/DhTest.java
+++ b/java/com/google/security/wycheproof/testcases/DhTest.java
@@ -192,6 +192,7 @@ public class DhTest extends TestCase {
}
/** Check that key agreement using DH works. */
+ @SuppressWarnings("InsecureCryptoUsage")
public void testDh() throws Exception {
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DH");
DHParameterSpec dhparams = ike2048();
@@ -320,6 +321,7 @@ public class DhTest extends TestCase {
* <p> This is a slow test since some providers (e.g. BouncyCastle) generate new safe primes
* for each new key.
*/
+ @SuppressWarnings("InsecureCryptoUsage")
public void testKeyPairGenerator() throws Exception {
int keySize = 1024;
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DH");
@@ -329,6 +331,7 @@ public class DhTest extends TestCase {
}
/** This test tries a key agreement with keys using distinct parameters. */
+ @SuppressWarnings("InsecureCryptoUsage")
public void testDHDistinctParameters() throws Exception {
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DH");
keyGen.initialize(ike1536());
@@ -361,6 +364,7 @@ public class DhTest extends TestCase {
*
* <p> CVE-2016-1000346: BouncyCastle before v.1.56 did not validate the other parties public key.
*/
+ @SuppressWarnings("InsecureCryptoUsage")
public void testSubgroupConfinement() throws Exception {
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DH");
DHParameterSpec params = ike2048();
diff --git a/java/com/google/security/wycheproof/testcases/DsaTest.java b/java/com/google/security/wycheproof/testcases/DsaTest.java
index e7acbcb..0e94797 100644
--- a/java/com/google/security/wycheproof/testcases/DsaTest.java
+++ b/java/com/google/security/wycheproof/testcases/DsaTest.java
@@ -671,7 +671,8 @@ public class DsaTest extends TestCase {
+ "22e342be484c05763939601cd667",
"300a090380fe01090380fe01",
};
-
+
+ @SuppressWarnings("InsecureCryptoUsage")
public void testVectors(
String[] signatures,
DSAPublicKeySpec key,
@@ -790,6 +791,7 @@ public class DsaTest extends TestCase {
* when an implementation is seriously broken.
*/
@SlowTest(providers = {ProviderType.BOUNCY_CASTLE, ProviderType.SPONGY_CASTLE})
+ @SuppressWarnings("InsecureCryptoUsage")
public void testBasic() throws Exception {
int keySize = 2048;
String algorithm = "SHA256WithDSA";
@@ -833,6 +835,7 @@ public class DsaTest extends TestCase {
System.out.println("s:" + extractS(signature).toString());
}
+ @SuppressWarnings("InsecureCryptoUsage")
public void testKeyGeneration(int keysize) throws Exception {
KeyPairGenerator generator = KeyPairGenerator.getInstance("DSA");
generator.initialize(keysize);
@@ -886,6 +889,7 @@ public class DsaTest extends TestCase {
* Checks whether the one time key k in DSA is biased. For example the SUN provider fell for this
* test until April 2016.
*/
+ @SuppressWarnings("InsecureCryptoUsage")
public void testDsaBias() throws Exception {
// q is close to 2/3 * 2^160.
BigInteger q = new BigInteger("974317976835659416858874959372334979171063697271");
@@ -962,6 +966,7 @@ public class DsaTest extends TestCase {
* the private key.
*/
@SlowTest(providers = {ProviderType.BOUNCY_CASTLE, ProviderType.SPONGY_CASTLE})
+ @SuppressWarnings("InsecureCryptoUsage")
public void testBiasSha1WithDSA() throws Exception {
String hashAlgorithm = "SHA";
String message = "Hello";
@@ -1050,6 +1055,7 @@ public class DsaTest extends TestCase {
*/
@SlowTest(providers = {ProviderType.BOUNCY_CASTLE, ProviderType.OPENJDK,
ProviderType.SPONGY_CASTLE})
+ @SuppressWarnings("InsecureCryptoUsage")
public void testTiming() throws Exception {
ThreadMXBean bean = ManagementFactory.getThreadMXBean();
if (!bean.isCurrentThreadCpuTimeSupported()) {
diff --git a/java/com/google/security/wycheproof/testcases/EcdhTest.java b/java/com/google/security/wycheproof/testcases/EcdhTest.java
index 8bfe03f..092375a 100644
--- a/java/com/google/security/wycheproof/testcases/EcdhTest.java
+++ b/java/com/google/security/wycheproof/testcases/EcdhTest.java
@@ -878,6 +878,7 @@ public class EcdhTest extends TestCase {
* the public key. Also a severe bug would be to reduce the private key modulo the order given in
* the public key parameters.
*/
+ @SuppressWarnings("InsecureCryptoUsage")
public void testModifiedPublic(String algorithm) throws Exception {
KeyAgreement ka;
try {
@@ -922,6 +923,7 @@ public class EcdhTest extends TestCase {
* This is a similar test as testModifiedPublic. However, this test uses test vectors
* ECPublicKeySpec
*/
+ @SuppressWarnings("InsecureCryptoUsage")
public void testModifiedPublicSpec(String algorithm) throws Exception {
KeyAgreement ka;
try {
@@ -977,6 +979,7 @@ public class EcdhTest extends TestCase {
testModifiedPublicSpec("ECDHC");
}
+ @SuppressWarnings("InsecureCryptoUsage")
public void testDistinctCurves(String algorithm, ECPrivateKey priv, ECPublicKey pub)
throws Exception {
KeyAgreement kaA;
@@ -1039,6 +1042,7 @@ public class EcdhTest extends TestCase {
* the public key parameters.
*/
// TODO(bleichen): This can be merged with testModifiedPublic once this is fixed.
+ @SuppressWarnings("InsecureCryptoUsage")
public void testWrongOrder(String algorithm, ECParameterSpec spec) throws Exception {
KeyAgreement ka;
try {