Skip to content

Commit d87bb35

Browse files
committed
compatibility updates
1 parent 1ad9fad commit d87bb35

8 files changed

Lines changed: 67 additions & 17 deletions

File tree

build1-1

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ find $jdk11src -name "*.java" -exec scripts/useseccert.sh \{\} \;
202202
rm -rf org/bouncycastle/cert/test/ConverterTest*
203203
rm -rf org/bouncycastle/cert/test/CertPathLoopTest.java
204204
rm -rf org/bouncycastle/cert/test/Bc*
205+
rm -rf org/bouncycastle/cert/test/DeltaCertTest*
205206
rm -rf org/bouncycastle/cert/test/GOST3410_2012CMSTest.java
206207
rm -rf org/bouncycastle/cert/ocsp/test/PKIXRevocationTest.java
207208
rm -rf org/bouncycastle/tsp/GenTimeAccuracyUnit*
@@ -259,6 +260,11 @@ find $jdk11src -name "*.java" -exec scripts/useseccert.sh \{\} \;
259260
rm -rf org/bouncycastle/pkix/jcajce/X509*
260261
rm -rf org/bouncycastle/pkix/jcajce/RFC3280*
261262
rm -rf org/bouncycastle/pkix/jcajce/Revocation*
263+
rm org/bouncycastle/pkix/jcajce/CertPath*.java
264+
rm org/bouncycastle/pkix/jcajce/PKIXCert*.java
265+
rm org/bouncycastle/pkix/jcajce/PKIXPolicyN*.java
266+
rm org/bouncycastle/pkix/jcajce/PKIXCRLUtil.java
267+
rm -r org/bouncycastle/pkix/util
262268
rm -rf org/bouncycastle/pkix/test/Revocation*
263269
rm -rf org/bouncycastle/pkix/test/TestUtil*
264270
rm org/bouncycastle/pkix/test/CheckerTest.java
@@ -284,6 +290,9 @@ find $jdk11src -name "*.java" -exec scripts/useseccert.sh \{\} \;
284290
rm -rf org/bouncycastle/jce/provider/test/SM2SignatureTest.java
285291
rm -f org/bouncycastle/jcajce/provider/drbg/EntropyGatherer.java
286292
rm -f org/bouncycastle/jcajce/provider/drbg/EntropyDaemon.java
293+
rm -f org/bouncycastle/jcajce/provider/asymmetric/Dilithium.java
294+
rm -f org/bouncycastle/jcajce/provider/asymmetric/NTRU.java
295+
rm -f org/bouncycastle/jcajce/provider/asymmetric/Falcon.java
287296
rm -f org/bouncycastle/test/PrintTestResult.java
288297

289298
sh ../../scripts/jdk1.2ed.sh > /dev/null 2>&1
@@ -670,6 +679,7 @@ then
670679
rm -f src/org/bouncycastle/openpgp/test/BcPGPEd25519JcaKeyPairConversionTest.java
671680
rm src/org/bouncycastle/openpgp/test/ArmoredOutputStreamUTF8Test.java
672681
rm -f src/org/bouncycastle/openpgp/examples/DSAElGamalKeyRingGenerator.java
682+
rm -f src/org/bouncycastle/openpgp/examples/EllipticCurveKeyPairGenerator.java
673683

674684
find src -name AllTests.java -exec rm {} \;
675685

@@ -688,18 +698,26 @@ then
688698

689699
echo "compiling"
690700

701+
(
702+
cd src
703+
sh ../../../../../scripts/jdk1.2ed.sh > /dev/null 2>&1
704+
sh ../../../../../scripts/jdk1.1ed.sh > /dev/null 2>&1
705+
)
691706

692-
for i in src/org/bouncycastle/pqc/jcajce/provider/*/*.java src/org/bouncycastle/pqc/crypto/*/*.java src/org/bouncycastle/bcpg/*.java src/org/bouncycastle/openpgp/*.java src/org/bouncycastle/openpgp/test/*.java
693-
do
694-
ed $i <<%%
695-
g/.Override/d
707+
ed src/org/bouncycastle/gpg/SExpression.java <<%
708+
g/\.\.\. /s//[]/
696709
w
697710
q
698-
%%
699-
done
711+
%
700712

701-
ed src/org/bouncycastle/gpg/SExpression.java <<%
702-
g/\.\.\. /s//[]/
713+
ed src/org/bouncycastle/openpgp/PGPSignature.java <<%
714+
g/private.*final.*;/s/final//
715+
w
716+
q
717+
%
718+
719+
ed src/org/bouncycastle/openpgp/operator/jcajce/JceAEADUtil.java <<%
720+
g/private.*final.*;/s/final//
703721
w
704722
q
705723
%

build1-2

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ find $jdk12src -name "*.java" -exec scripts/usejcecert.sh \{\} \;
115115
rm org/bouncycastle/pkix/jcajce/Revocation*.java
116116
rm org/bouncycastle/pkix/jcajce/X509RevocationChecker.java
117117
rm org/bouncycastle/pkix/jcajce/RFC3280*.java
118+
rm org/bouncycastle/pkix/jcajce/CertPath*.java
119+
rm org/bouncycastle/pkix/jcajce/X509CertSel*.java
120+
rm org/bouncycastle/pkix/jcajce/X509CertStoreSel*.java
121+
rm org/bouncycastle/pkix/jcajce/X509CRLStoreSel*.java
122+
rm org/bouncycastle/pkix/jcajce/PKIXCRL*.java
123+
rm org/bouncycastle/pkix/jcajce/PKIXCert*.java
124+
rm org/bouncycastle/pkix/jcajce/PKIXPolicyN*.java
125+
rm -r org/bouncycastle/pkix/util
118126
rm org/bouncycastle/cms/jcajce/JceKeyTransAuthEnvelopedRecipient.java
119127
rm org/bouncycastle/cms/jcajce/JceAADStream.java
120128
rm org/bouncycastle/jcajce/provider/keystore/util/ParameterUtil.java
@@ -224,6 +232,7 @@ find $jdk12src -name "*.java" -exec scripts/usejcecert.sh \{\} \;
224232
rm -rf org/bouncycastle/cert/test/ConverterTest*
225233
rm -rf org/bouncycastle/cert/test/CertPathLoopTest.java
226234
rm -rf org/bouncycastle/cert/test/Bc*
235+
rm -rf org/bouncycastle/cert/test/Delta*
227236
rm -rf org/bouncycastle/tsp/GenTimeAccuracyUnit*
228237
rm -rf org/bouncycastle/tsp/TimeStampTokenInfoUnit*
229238
rm org/bouncycastle/openpgp/test/BcPGPEd25519JcaKeyPairConversionTest.java

core/src/main/jdk1.3/org/bouncycastle/pqc/crypto/picnic/Tree.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.bouncycastle.pqc.crypto.picnic;
22

3+
34
import org.bouncycastle.util.Arrays;
45
import org.bouncycastle.util.Pack;
56

core/src/test/java/org/bouncycastle/crypto/test/GCMTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import java.security.SecureRandom;
44

5-
import junit.framework.TestCase;
65
import org.bouncycastle.crypto.BlockCipher;
76
import org.bouncycastle.crypto.InvalidCipherTextException;
87
import org.bouncycastle.crypto.engines.AESEngine;
@@ -358,8 +357,8 @@ private void testResetBehavior() throws Exception
358357
l = gcm.processBytes(ct, 0, ct.length, outPostReset, 0);
359358
gcm.doFinal(outPostReset, l);
360359

361-
TestCase.assertTrue("before / after reset decryptions not the same", Arrays.areEqual(outPreReset, outPostReset));
362-
TestCase.assertTrue("decryption not same as message", Arrays.areEqual(msg, outPostReset));
360+
isTrue("before / after reset decryptions not the same", Arrays.areEqual(outPreReset, outPostReset));
361+
isTrue("decryption not same as message", Arrays.areEqual(msg, outPostReset));
363362

364363
}
365364

pkix/src/main/jdk1.1/org/bouncycastle/cert/selector/jcajce/JcaX509CertSelectorConverter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.bouncycastle.asn1.DEROctetString;
88
import org.bouncycastle.asn1.x500.X500Name;
99
import org.bouncycastle.cert.selector.X509CertificateHolderSelector;
10+
import org.bouncycastle.util.Exceptions;
1011

1112
public class JcaX509CertSelectorConverter
1213
{
@@ -26,7 +27,7 @@ protected X509CertSelector doConversion(X500Name issuer, BigInteger serialNumber
2627
}
2728
catch (IOException e)
2829
{
29-
throw new IllegalArgumentException("unable to convert issuer: " + e.getMessage(), e);
30+
throw Exceptions.illegalArgumentException("unable to convert issuer: " + e.getMessage(), e);
3031
}
3132
}
3233

@@ -43,7 +44,7 @@ protected X509CertSelector doConversion(X500Name issuer, BigInteger serialNumber
4344
}
4445
catch (IOException e)
4546
{
46-
throw new IllegalArgumentException("unable to convert subjectKeyIdentifier: " + e.getMessage(), e);
47+
throw Exceptions.illegalArgumentException("unable to convert subjectKeyIdentifier: " + e.getMessage(), e);
4748
}
4849
}
4950

prov/src/main/jdk1.2/org/bouncycastle/jcajce/provider/asymmetric/ec/ECUtils.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.math.BigInteger;
44
import java.security.InvalidKeyException;
55
import java.security.PublicKey;
6+
import java.security.PrivateKey;
67

78
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
89
import org.bouncycastle.asn1.DERNull;
@@ -18,6 +19,14 @@
1819

1920
class ECUtils
2021
{
22+
static AsymmetricKeyParameter generatePrivateKeyParameter(
23+
PrivateKey key)
24+
throws InvalidKeyException
25+
{
26+
return (key instanceof BCECPrivateKey) ? ((BCECPrivateKey)key).engineGetKeyParameters() : ECUtil.generatePrivateKeyParameter(key);
27+
}
28+
29+
2130
static AsymmetricKeyParameter generatePublicKeyParameter(
2231
PublicKey key)
2332
throws InvalidKeyException

prov/src/test/jdk1.3/org/bouncycastle/jce/provider/test/CertPathBuilderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ public TestResult v0Test()
9696
X509Certificate endCert = TestUtils.generateEndEntityCert(endPair.getPublic(), interPair.getPrivate(), interCert);
9797

9898
BigInteger revokedSerialNumber = BigInteger.valueOf(2);
99-
X509CRL rootCRL = TestUtils.createCRL(rootCert, rootPair.getPrivate(), revokedSerialNumber);
100-
X509CRL interCRL = TestUtils.createCRL(interCert, interPair.getPrivate(), revokedSerialNumber);
99+
X509CRL rootCRL = TestCertificateGen.createCRL(rootCert, rootPair.getPrivate(), revokedSerialNumber);
100+
X509CRL interCRL = TestCertificateGen.createCRL(interCert, interPair.getPrivate(), revokedSerialNumber);
101101

102102
// create CertStore to support path building
103103
List list = new ArrayList();

scripts/jdk1.2ed.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#
22
# JDK 1.2 edits
33

4-
for i in org/bouncycastle/pqc/jcajce/provider/*/*.java org/bouncycastle/pqc/*/*/*.java org/bouncycastle/pqc/*/*/*/*.java org/bouncycastle/crypto/digests/*.java org/bouncycastle/cert/cmp/*.java org/bouncycastle/crypto/engines/*.java org/bouncycastle/openpgp/*.java org/bouncycastle/bcpg/*.java org/bouncycastle/openpgp/test/*.java
4+
for i in org/bouncycastle/pqc/jcajce/provider/*/*.java org/bouncycastle/pqc/*/*/*.java org/bouncycastle/pqc/*/*/*/*.java org/bouncycastle/crypto/digests/*.java org/bouncycastle/cert/cmp/*.java org/bouncycastle/crypto/engines/*.java org/bouncycastle/openpgp/operator/*.java org/bouncycastle/openpgp/operator/jcajce/*.java org/bouncycastle/openpgp/operator/bc/*.java org/bouncycastle/openpgp/*.java org/bouncycastle/bcpg/*.java org/bouncycastle/openpgp/test/*.java
55
do
66
ed $i <<%%
7-
g/.Override/d
7+
g/ .Override/d
8+
g/ .Override/d
89
w
910
q
1011
%%
@@ -194,6 +195,18 @@ w
194195
q
195196
%
196197

198+
ed org/bouncycastle/openpgp/operator/jcajce/JcePGPDataEncryptorBuilder.java <<%
199+
g/private final/s//private/g
200+
w
201+
q
202+
%
203+
204+
ed org/bouncycastle/openpgp/operator/bc/BcPGPDataEncryptorBuilder.java <<%
205+
g/private final/s//private/g
206+
w
207+
q
208+
%
209+
197210
ed org/bouncycastle/openpgp/PGPCanonicalizedDataGenerator.java <<%
198211
g/FileNotFoundException/s//IOException/
199212
w

0 commit comments

Comments
 (0)