Skip to content

Commit afad0ba

Browse files
committed
added use of Exceptions class.
removed argon2 tests from Java 4 build (not enough memory).
1 parent 9852842 commit afad0ba

File tree

3 files changed

+70
-2
lines changed

3 files changed

+70
-2
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
package org.bouncycastle.openpgp.test;
2+
3+
import java.security.Security;
4+
5+
import junit.extensions.TestSetup;
6+
import junit.framework.Test;
7+
import junit.framework.TestCase;
8+
import junit.framework.TestSuite;
9+
import org.bouncycastle.jce.provider.BouncyCastleProvider;
10+
import org.bouncycastle.test.PrintTestResult;
11+
import org.bouncycastle.util.test.SimpleTestResult;
12+
13+
public class AllTests
14+
extends TestCase
15+
{
16+
public void testPGP()
17+
{
18+
Security.addProvider(new BouncyCastleProvider());
19+
20+
org.bouncycastle.util.test.Test[] tests = RegressionTest.tests;
21+
22+
for (int i = 0; i != tests.length; i++)
23+
{
24+
SimpleTestResult result = (SimpleTestResult)tests[i].perform();
25+
26+
if (!result.isSuccessful())
27+
{
28+
fail(tests[i].getClass().getName() + " " + result.toString());
29+
}
30+
}
31+
}
32+
33+
public static void main(String[] args)
34+
{
35+
PrintTestResult.printResult(junit.textui.TestRunner.run(suite()));
36+
}
37+
38+
public static Test suite()
39+
{
40+
TestSuite suite = new TestSuite("OpenPGP Tests");
41+
42+
suite.addTestSuite(AllTests.class);
43+
suite.addTestSuite(DSA2Test.class);
44+
suite.addTestSuite(PGPUnicodeTest.class);
45+
46+
return new BCTestSetup(suite);
47+
}
48+
49+
static class BCTestSetup
50+
extends TestSetup
51+
{
52+
public BCTestSetup(Test test)
53+
{
54+
super(test);
55+
}
56+
57+
protected void setUp()
58+
{
59+
Security.addProvider(new BouncyCastleProvider());
60+
}
61+
62+
protected void tearDown()
63+
{
64+
Security.removeProvider("BC");
65+
}
66+
}
67+
}

prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/util/BaseDeterministicOrRandomSignature.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.bouncycastle.jcajce.spec.ContextParameterSpec;
1919
import org.bouncycastle.jcajce.util.BCJcaJceHelper;
2020
import org.bouncycastle.jcajce.util.JcaJceHelper;
21+
import org.bouncycastle.util.Exceptions;
2122

2223
public abstract class BaseDeterministicOrRandomSignature
2324
extends Signature
@@ -170,7 +171,7 @@ protected final AlgorithmParameters engineGetParameters()
170171
}
171172
catch (Exception e)
172173
{
173-
throw new IllegalStateException(e.toString(), e);
174+
throw Exceptions.illegalStateException(e.toString(), e);
174175
}
175176
}
176177
}

prov/src/main/jdk1.4/org/bouncycastle/jce/provider/BouncyCastleProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public final class BouncyCastleProvider extends Provider
9696

9797
private static final String[] ASYMMETRIC_CIPHERS =
9898
{
99-
"DSA", "DH", "EC", "RSA", "GOST", "ECGOST", "ElGamal", "DSTU4145", "GM", "EdEC", "SPHINCSPlus", "Dilithium", "Falcon", "NTRU", "SLHDSA", "MLDSA", "MLKEM"
99+
"DSA", "DH", "EC", "RSA", "GOST", "ECGOST", "ElGamal", "DSTU4145", "GM", "EdEC", "SPHINCSPlus", "Dilithium", "Falcon", "NTRU", "CONTEXT", "SLHDSA", "MLDSA", "MLKEM"
100100
};
101101

102102
/*

0 commit comments

Comments
 (0)