Skip to content

Commit fd754d7

Browse files
committed
compatibility updates.
1 parent 8f31ae3 commit fd754d7

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

ant/bc+-build.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@
158158
srcdir="${artifacts.dir}/@{target}/src"
159159
destdir="${build.dir}/@{target}/classes"
160160
memoryMaximumSize="512m"
161+
fork="true"
161162
debug="${release.debug}">
162163
<classpath>
163164
<path refid="project.classpath" />

ant/jdk14.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@
155155
<exclude name="**/jsse/**"/>
156156
<exclude name="**/CertChainUtil.java"/>
157157
<exclude name="**/TlsTestUtils.java"/>
158+
<exclude name="**/TlsServerRawKeysTest.java"/>
159+
<exclude name="**/TlsClientRawKeysTest.java"/>
158160
</fileset>
159161

160162
<fileset dir="tls/src/test/resources" includes="**/*.*"/>

tls/src/test/java/org/bouncycastle/tls/test/MockRawKeysTlsClient.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.security.SecureRandom;
55
import java.util.Vector;
66

7+
import junit.framework.TestCase;
78
import org.bouncycastle.crypto.params.Ed25519PrivateKeyParameters;
89
import org.bouncycastle.crypto.util.SubjectPublicKeyInfoFactory;
910
import org.bouncycastle.tls.Certificate;
@@ -22,13 +23,12 @@
2223
import org.bouncycastle.tls.TlsServerCertificate;
2324
import org.bouncycastle.tls.TlsUtils;
2425
import org.bouncycastle.tls.crypto.TlsCertificate;
26+
import org.bouncycastle.tls.crypto.TlsCrypto;
2527
import org.bouncycastle.tls.crypto.TlsCryptoParameters;
2628
import org.bouncycastle.tls.crypto.impl.bc.BcDefaultTlsCredentialedSigner;
2729
import org.bouncycastle.tls.crypto.impl.bc.BcTlsCrypto;
2830
import org.bouncycastle.tls.crypto.impl.bc.BcTlsRawKeyCertificate;
2931

30-
import junit.framework.TestCase;
31-
3232
class MockRawKeysTlsClient
3333
extends DefaultTlsClient
3434
{
@@ -114,15 +114,15 @@ public TlsCredentials getClientCredentials(CertificateRequest certificateRequest
114114
break;
115115
case CertificateType.RawPublicKey:
116116
TlsCertificate rawKeyCert = new BcTlsRawKeyCertificate(
117-
getCrypto(),
117+
(BcTlsCrypto)getCrypto(),
118118
SubjectPublicKeyInfoFactory.createSubjectPublicKeyInfo(privateKey.generatePublicKey()));
119119
Certificate cert = new Certificate(
120120
CertificateType.RawPublicKey,
121121
TlsUtils.isTLSv13(context) ? TlsUtils.EMPTY_BYTES : null,
122122
new CertificateEntry[] {new CertificateEntry(rawKeyCert, null)});
123123
credentials = new BcDefaultTlsCredentialedSigner(
124124
new TlsCryptoParameters(context),
125-
getCrypto(),
125+
(BcTlsCrypto)getCrypto(),
126126
privateKey,
127127
cert,
128128
SignatureAndHashAlgorithm.ed25519);
@@ -137,8 +137,8 @@ public TlsCredentials getClientCredentials(CertificateRequest certificateRequest
137137
};
138138
}
139139

140-
public BcTlsCrypto getCrypto()
140+
public TlsCrypto getCrypto()
141141
{
142-
return (BcTlsCrypto) super.getCrypto();
142+
return super.getCrypto();
143143
}
144144
}

tls/src/test/java/org/bouncycastle/tls/test/MockRawKeysTlsServer.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.util.Hashtable;
66
import java.util.Vector;
77

8+
import junit.framework.TestCase;
89
import org.bouncycastle.crypto.params.Ed25519PrivateKeyParameters;
910
import org.bouncycastle.crypto.util.SubjectPublicKeyInfoFactory;
1011
import org.bouncycastle.tls.Certificate;
@@ -21,13 +22,12 @@
2122
import org.bouncycastle.tls.TlsCredentials;
2223
import org.bouncycastle.tls.TlsUtils;
2324
import org.bouncycastle.tls.crypto.TlsCertificate;
25+
import org.bouncycastle.tls.crypto.TlsCrypto;
2426
import org.bouncycastle.tls.crypto.TlsCryptoParameters;
2527
import org.bouncycastle.tls.crypto.impl.bc.BcDefaultTlsCredentialedSigner;
2628
import org.bouncycastle.tls.crypto.impl.bc.BcTlsCrypto;
2729
import org.bouncycastle.tls.crypto.impl.bc.BcTlsRawKeyCertificate;
2830

29-
import junit.framework.TestCase;
30-
3131
class MockRawKeysTlsServer extends DefaultTlsServer
3232
{
3333

@@ -97,15 +97,15 @@ protected TlsCredentialedSigner getECDSASignerCredentials() throws IOException
9797
break;
9898
case CertificateType.RawPublicKey:
9999
TlsCertificate rawKeyCert = new BcTlsRawKeyCertificate(
100-
getCrypto(),
100+
(BcTlsCrypto)getCrypto(),
101101
SubjectPublicKeyInfoFactory.createSubjectPublicKeyInfo(privateKey.generatePublicKey()));
102102
Certificate cert = new Certificate(
103103
CertificateType.RawPublicKey,
104104
TlsUtils.isTLSv13(context) ? TlsUtils.EMPTY_BYTES : null,
105105
new CertificateEntry[] {new CertificateEntry(rawKeyCert, null)});
106106
credentials = new BcDefaultTlsCredentialedSigner(
107107
new TlsCryptoParameters(context),
108-
getCrypto(),
108+
(BcTlsCrypto)getCrypto(),
109109
privateKey,
110110
cert,
111111
SignatureAndHashAlgorithm.ed25519);
@@ -158,8 +158,8 @@ public void notifyClientCertificate(Certificate clientCertificate) throws IOExce
158158
TestCase.assertEquals("client certificate is the wrong type", clientCertType, clientCertificate.getCertificateType());
159159
}
160160

161-
public BcTlsCrypto getCrypto()
161+
public TlsCrypto getCrypto()
162162
{
163-
return (BcTlsCrypto) super.getCrypto();
163+
return super.getCrypto();
164164
}
165165
}

tls/src/test/java/org/bouncycastle/tls/test/TlsServerRawKeysTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ public static void main(String[] args)
3131
ServerSocket ss = new ServerSocket(port, 16, address);
3232
try
3333
{
34-
for (ProtocolVersion tlsVersion : tlsVersions)
34+
for (int i = 0; i != tlsVersions.length; i++)
3535
{
36+
ProtocolVersion tlsVersion = tlsVersions[i];
3637
Socket s = ss.accept();
3738
System.out.println("--------------------------------------------------------------------------------");
3839
System.out.println("Accepted " + s);

0 commit comments

Comments
 (0)