Skip to content

Commit 3e31062

Browse files
committed
added valid date for CheckNameConstraintsTest
removed use of junit from SimpleTest
1 parent fc496aa commit 3e31062

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

pkix/src/test/java/org/bouncycastle/pkix/test/CheckNameConstraintsTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void testPKIXCertPathBuilder()
8383
PKIXBuilderParameters buildParams = new PKIXBuilderParameters(Collections.singleton(new TrustAnchor(rootCert, null)), pathConstraints);
8484

8585
buildParams.addCertStore(store);
86-
buildParams.setDate(new Date());
86+
buildParams.setDate(new Date(1744869361113L)); // 17th April 2025
8787
buildParams.setRevocationEnabled(false);
8888

8989
PKIXCertPathBuilderResult result = (PKIXCertPathBuilderResult)builder.build(buildParams);
@@ -116,6 +116,7 @@ public void testPKIXCertPathValidator()
116116
CertPathValidator cpv = CertPathValidator.getInstance("PKIX", "BC");
117117
PKIXParameters param = new PKIXParameters(trust);
118118
param.setRevocationEnabled(false);
119+
param.setDate(new Date(1744869361113L)); // 17th April 2025
119120

120121
cpv.validate(certPath, param);
121122
}

prov/src/test/java/org/bouncycastle/jce/provider/test/BlockCipherTest.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,13 @@
4141
import org.bouncycastle.crypto.BufferedBlockCipher;
4242
import org.bouncycastle.crypto.DefaultMultiBlockCipher;
4343
import org.bouncycastle.crypto.engines.AESEngine;
44-
import org.bouncycastle.crypto.engines.DESEngine;
45-
import org.bouncycastle.crypto.paddings.PKCS7Padding;
46-
import org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher;
4744
import org.bouncycastle.crypto.params.KeyParameter;
4845
import org.bouncycastle.jce.provider.BouncyCastleProvider;
4946
import org.bouncycastle.util.Arrays;
5047
import org.bouncycastle.util.encoders.Hex;
5148
import org.bouncycastle.util.test.SimpleTest;
5249
import org.bouncycastle.util.test.TestFailedException;
53-
import org.junit.Assert;
50+
5451

5552
/**
5653
* basic test class for a block cipher, basically this just exercises the provider, and makes sure we
@@ -868,12 +865,12 @@ else if (algorithm.startsWith("RC5"))
868865
}
869866
catch (Exception e)
870867
{
871-
Assert.fail(e.toString());
868+
fail(e.toString());
872869
}
873870

874871
if (!Arrays.areEqual(data, 0, len, output, 0, output.length))
875872
{
876-
Assert.fail("" + algorithm + " failed doFinal - expected " + new String(Hex.encode(output)) + " got " + new String(Hex.encode(data)));
873+
fail("" + algorithm + " failed doFinal - expected " + new String(Hex.encode(output)) + " got " + new String(Hex.encode(data)));
877874
}
878875

879876
//
@@ -898,12 +895,12 @@ else if (algorithm.startsWith("RC5"))
898895
}
899896
catch (Exception e)
900897
{
901-
Assert.fail(e.toString());
898+
fail(e.toString());
902899
}
903900

904901
if (!Arrays.areEqual(data, 1, 1 + len, output, 0, output.length))
905902
{
906-
Assert.fail("" + algorithm + " failed doFinal - expected " + new String(Hex.encode(output)) + " got " + new String(Hex.encode(data)));
903+
fail("" + algorithm + " failed doFinal - expected " + new String(Hex.encode(output)) + " got " + new String(Hex.encode(data)));
907904
}
908905

909906
//

0 commit comments

Comments
 (0)