Suppress more warnings, sighed (#22)
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user