Skip to content

Commit

Permalink
Compatibility updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dghgit committed Aug 16, 2017
1 parent 66cfbcc commit 883ba90
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 14 deletions.
2 changes: 2 additions & 0 deletions ant/jdk13.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@
<exclude name="**/CertPathValidatorUtilities.java" />
<exclude name="**/JDKPKCS12StoreParameter.java" />
<exclude name="**/NTRU*.java" />
<exclude name="**/XMSS*.java" />
<exclude name="**/IndexGenerator.java" />
<exclude name="**/ntru/**/*.java" />
<exclude name="**/xmss/**/*.java" />
<exclude name="**/ecgost12/**/*.java" />
<exclude name="**/asymmetric/DSTU*.java" />
<exclude name="**/asymmetric/dstu/*.java" />
<exclude name="**/provider/config/PKCS12StoreParameter.java" />
Expand Down
27 changes: 24 additions & 3 deletions build1-1
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ find $jdk11src -name "*.java" -exec scripts/useseccert.sh \{\} \;
rm -rf org/bouncycastle/i18n/test
rm -rf org/bouncycastle/i18n/filter/test
rm -rf org/bouncycastle/math/ec/test
rm -rf org/bouncycastle/math/ec/custom/test
rm -rf org/bouncycastle/math/ec/custom/sec/test
rm -rf org/bouncycastle/crypto/tls/test
rm -rf org/bouncycastle/crypto/test/GCMReorderTest.java
rm -rf org/bouncycastle/jce/cert
Expand All @@ -83,8 +85,9 @@ find $jdk11src -name "*.java" -exec scripts/useseccert.sh \{\} \;
rm -rf org/bouncycastle/jce/provider/EC5*.java
rm -rf org/bouncycastle/jce/provider/JCEEC*.java
rm -rf org/bouncycastle/jcajce/provider/asymmetric/ec/EC5Util.java
rm -rf org/bouncycastle/jce/provider/asymmetric/ec/EC5*.java
rm -rf org/bouncycastle/jcajce/provider/asymmetric/ecgost12
rm -rf org/bouncycastle/jcajce/provider/config/ProviderConfigurationPermission.java
rm -rf org/bouncycastle/jcajce/provider/test
rm -rf org/bouncycastle/jce/provider/test/ECDSA5Test.java
rm -rf org/bouncycastle/jce/provider/test/CRL5Test.java
rm -rf org/bouncycastle/jce/provider/test/X509LDAP*.java
Expand Down Expand Up @@ -122,6 +125,7 @@ find $jdk11src -name "*.java" -exec scripts/useseccert.sh \{\} \;
rm org/bouncycastle/asn1/test/ASN1SequenceParserTest.java
rm org/bouncycastle/asn1/test/OctetStringTest.java
rm org/bouncycastle/asn1/test/ParseTest.java
rm org/bouncycastle/asn1/test/ASN1IntegerTest.java
rm -r org/bouncycastle/crypto/test/BigSkippingCipherTest.java
rm -rf org/bouncycastle/jcajce/provider/asymmetric/dstu
rm -rf org/bouncycastle/jcajce/provider/asymmetric/DSTU*.java
Expand All @@ -141,6 +145,7 @@ find $jdk11src -name "*.java" -exec scripts/useseccert.sh \{\} \;
rm -rf org/bouncycastle/cert/test/ConverterTest*
rm -rf org/bouncycastle/cert/test/CertPathLoopTest.java
rm -rf org/bouncycastle/cert/test/Bc*
rm -rf org/bouncycastle/cert/test/GOST3410_2012CMSTest.java
rm -rf org/bouncycastle/tsp/GenTimeAccuracyUnit*
rm -rf org/bouncycastle/tsp/TimeStampTokenInfoUnit*
rm -rf org/bouncycastle/jce/provider/test/DHTest.java
Expand Down Expand Up @@ -208,6 +213,7 @@ then
-classpath classes:$JDK11PATH/lib/classes.zip \
-d javadoc -sourcepath src \
org.bouncycastle.asn1 \
org.bouncycastle.asn1.bc \
org.bouncycastle.asn1.cmp \
org.bouncycastle.asn1.cms \
org.bouncycastle.asn1.cryptopro \
Expand Down Expand Up @@ -257,6 +263,7 @@ then

echo "compiling"

(cd src/java/; javac -d ../../classes -classpath ../../classes:../../src:$JDK11PATH/lib/classes.zip */*.java)
(cd src/org/bouncycastle; javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip *.java ; javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip */*.java; javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip */p*/*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip */a*/*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip */d*/*.java
Expand All @@ -266,6 +273,12 @@ javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/li
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip */m*/*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip */s*/*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip a*/t*/*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip a*/c*/*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip a*/x*/*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip a*/x*/s*/*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip a*/c*/e*/*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip a*/[kno]*/*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip a*/b*/*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip c*/t*/A*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip c*/t*/[BC]*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip c*/t*/D*.java
Expand All @@ -275,6 +288,14 @@ javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/li
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip c*/t*/T*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip c*/t*/U*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip u*/t*/*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip math/ec/tools/*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip math/raw/*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip crypto/agreement/kdf/*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip crypto/modes/gcm/*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip crypto/test/*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip util/io/*/*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip pqc/math/*/*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip pqc/crypto/*/*.java pqc/crypto/*/*/*.java
javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip */u*/*.java )

cp ../../../../core/src/test/resources/org/bouncycastle/crypto/test/*.txt classes/org/bouncycastle/crypto/test/
Expand Down Expand Up @@ -409,14 +430,14 @@ then
(cd src/org/bouncycastle; javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip jce/*/*.java)
(cd src/org/bouncycastle; javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip util/*/*.java)
(cd src/org/bouncycastle; javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip [abc]*/*/*/*.java)
(cd src/org/bouncycastle; javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip j*/*/*/*.java)
(cd src/org/bouncycastle; javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip jcajce/*/*/*.java)
(cd src/org/bouncycastle; javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip jce/*/*/*.java)
(cd src/org/bouncycastle; javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip m*/*/*/*.java)
(cd src/org/bouncycastle; javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip [ptuvx]*/*/*/*.java)
(cd src/org/bouncycastle; javac -d ../../../classes -classpath ../../../classes:../../../src:$JDK11PATH/lib/classes.zip x509/*.java x509/*/*.java)

rm -rf classes/org/bouncycastle/crypto/test


echo "provider regression test"
java -classpath classes:$JDK11PATH/lib/classes.zip org.bouncycastle.jce.provider.test.RegressionTest
)
Expand Down
8 changes: 7 additions & 1 deletion build1-2
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ find $jdk12src -name "*.java" -exec scripts/usejcecert.sh \{\} \;
rm -rf org/bouncycastle/pqc/crypto/ntru
rm -rf org/bouncycastle/pqc/crypto/*/NTRU*
rm -rf org/bouncycastle/pqc/crypto/xmss
rm -rf org/bouncycastle/pqc/jcajce/provider/xmss
rm -rf org/bouncycastle/pqc/jcajce/provider/XMSS*
rm -rf org/bouncycastle/pqc/crypto/*/XMSS*
rm -rf org/bouncycastle/pqc/crypto/*/EncryptionKey*
rm -rf org/bouncycastle/pqc/crypto/*/BitStringT*
Expand All @@ -84,6 +86,8 @@ find $jdk12src -name "*.java" -exec scripts/usejcecert.sh \{\} \;
rm -rf org/bouncycastle/jce/provider/EC5*.java
rm -rf org/bouncycastle/jce/provider/JCEEC*.java
rm -rf org/bouncycastle/jcajce/provider/asymmetric/ec/EC5Util.java
rm -rf org/bouncycastle/jcajce/provider/asymmetric/ecgost12
rm -rf org/bouncycastle/jcajce/provider/test
rm -rf org/bouncycastle/jce/provider/asymmetric/ec/EC5*.java
rm -rf org/bouncycastle/jce/provider/test/ECDSA5Test.java
rm -rf org/bouncycastle/jce/provider/test/CRL5Test.java
Expand Down Expand Up @@ -347,7 +351,9 @@ then
(cd src/java/security/spec; javac -d ../../../../classes -classpath ../../../../classes *.java )

(cd src/org/bouncycastle/jce/cert; javac -d ../../../../../classes -classpath ../../../../../classes:../../../../../src *.java )
(cd src/org/bouncycastle/jcajce/provider; javac -d ../../../../../classes -classpath ../../../../../classes:../../../../../src [abcis]*/*.java )
(cd src/org/bouncycastle/jcajce/provider; javac -d ../../../../../classes -classpath ../../../../../classes:../../../../../src a*/*.java )
(cd src/org/bouncycastle/jcajce/provider; javac -d ../../../../../classes -classpath ../../../../../classes:../../../../../src b*/*.java )
(cd src/org/bouncycastle/jcajce/provider; javac -d ../../../../../classes -classpath ../../../../../classes:../../../../../src [cis]*/*.java )
(cd src/org/bouncycastle/jcajce/provider; javac -d ../../../../../classes -classpath ../../../../../classes:../../../../../src [abcis]*/*/*.java )
(cd src/org/bouncycastle; javac -d ../../../classes -classpath ../../../classes:../../../src *.java a*/*.java a*/*/*.java a*/*/*/*.java )
(cd src/org/bouncycastle; javac -d ../../../classes -classpath ../../../classes:../../../src *.java [bci]*/*.java [bci]*/*/*.java [bci]*/*/*/*.java )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ public class RegressionTest
new PaddingTest(),
new DHTest(),
new ElGamalTest(),
new DSATest(),
new ECTest(),
new GOST3410Test(),
new ECGOST3410Test(),
new ECIESTest(),
new ECNRTest(),
//new DSATest(),
//new ECTest(),
//new GOST3410Test(),
//new ECGOST3410Test(),
//new ECIESTest(),
//new ECNRTest(),
new MacTest(),
new GOST28147MacTest(),
new RC2Test(),
Expand Down Expand Up @@ -118,7 +118,7 @@ public class RegressionTest
new SCryptTest(),
new ResetTest(),
new NullTest(),
new DSTU4145Test(),
//new DSTU4145Test(),
new Poly1305Test(),
new OCBTest(),
new NonMemoableDigestTest(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package org.bouncycastle.jcajce.provider.symmetric.util;

public class ClassUtil
{
public static Class loadClass(Class sourceClass, final String className)
{
try
{
ClassLoader loader = sourceClass.getClassLoader();

if (loader != null)
{
return loader.loadClass(className);
}
else
{
return (Class)Class.forName(className);
}
}
catch (ClassNotFoundException e)
{
// ignore - maybe log?
}

return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public final class BouncyCastleProvider extends Provider
"AES", "ARC4", "Blowfish", "Camellia", "CAST5", "CAST6", "ChaCha", "DES", "DESede",
"GOST28147", "Grainv1", "Grain128", "HC128", "HC256", "IDEA", "Noekeon", "RC2", "RC5",
"RC6", "Rijndael", "Salsa20", "SEED", "Serpent", "Shacal2", "Skipjack", "SM4", "TEA", "Twofish", "Threefish",
"VMPC", "VMPCKSA3", "XTEA", "XSalsa20", "OpenSSLPBKDF"
"VMPC", "VMPCKSA3", "XTEA", "XSalsa20", "OpenSSLPBKDF", "DSTU7624"
};

/*
Expand All @@ -88,7 +88,7 @@ public final class BouncyCastleProvider extends Provider

private static final String[] ASYMMETRIC_CIPHERS =
{
"DSA", "DH", "EC", "RSA", "GOST", "ECGOST", "ElGamal", "DSTU4145"
"DSA", "DH", "EC", "RSA", "GOST", "ECGOST", "ElGamal", "DSTU4145", "GM"
};

/*
Expand All @@ -98,7 +98,7 @@ public final class BouncyCastleProvider extends Provider
private static final String[] DIGESTS =
{
"GOST3411", "Keccak", "MD2", "MD4", "MD5", "SHA1", "RIPEMD128", "RIPEMD160", "RIPEMD256", "RIPEMD320", "SHA224",
"SHA256", "SHA384", "SHA512", "SHA3", "Skein", "SM3", "Tiger", "Whirlpool", "Blake2b"
"SHA256", "SHA384", "SHA512", "SHA3", "Skein", "SM3", "Tiger", "Whirlpool", "Blake2b", "DSTU7564"
};

/*
Expand Down
12 changes: 12 additions & 0 deletions scripts/jdk1.1ed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,15 @@ g/private final .*;/s/final//
w
q
%

ed org/bouncycastle/asn1/cryptopro/Gost2814789KeyWrapParameters.java <<%
g/private final .*;/s/final//
w
q
%

ed org/bouncycastle/asn1/cryptopro/Gost2814789EncryptedKey.java <<%
g/private final .*;/s/final//
w
q
%

0 comments on commit 883ba90

Please sign in to comment.