Skip to content

Commit c7885f5

Browse files
authored
maven: upgrade bouncycastle due to cve (apache#5949)
Fixes: apache#5948
1 parent e609aa8 commit c7885f5

6 files changed

Lines changed: 42 additions & 11 deletions

File tree

client/pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,11 @@
564564
<artifactId>bcpkix-jdk15on</artifactId>
565565
<version>${cs.bcprov.version}</version>
566566
</dependency>
567+
<dependency>
568+
<groupId>org.bouncycastle</groupId>
569+
<artifactId>bctls-jdk15on</artifactId>
570+
<version>${cs.bcprov.version}</version>
571+
</dependency>
567572
</dependencies>
568573
<configuration>
569574
<supportedPackagings>
@@ -751,6 +756,12 @@
751756
<overWrite>false</overWrite>
752757
<outputDirectory>${project.build.directory}/lib</outputDirectory>
753758
</artifactItem>
759+
<artifactItem>
760+
<groupId>org.bouncycastle</groupId>
761+
<artifactId>bctls-jdk15on</artifactId>
762+
<overWrite>false</overWrite>
763+
<outputDirectory>${project.build.directory}/lib</outputDirectory>
764+
</artifactItem>
754765
</artifactItems>
755766
</configuration>
756767
</execution>
@@ -786,6 +797,7 @@
786797
<exclude>org.apache.geronimo.specs:geronimo-javamail_1.4_spec</exclude>
787798
<exclude>org.bouncycastle:bcprov-jdk15on</exclude>
788799
<exclude>org.bouncycastle:bcpkix-jdk15on</exclude>
800+
<exclude>org.bouncycastle:bctls-jdk15on</exclude>
789801
<exclude>mysql:mysql-connector-java</exclude>
790802
</excludes>
791803
</artifactSet>

plugins/integrations/kubernetes-service/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@
126126
<artifactId>bcprov-jdk15on</artifactId>
127127
<version>${cs.bcprov.version}</version>
128128
</dependency>
129+
<dependency>
130+
<groupId>org.bouncycastle</groupId>
131+
<artifactId>bctls-jdk15on</artifactId>
132+
<version>${cs.bcprov.version}</version>
133+
</dependency>
129134
<dependency>
130135
<groupId>joda-time</groupId>
131136
<artifactId>joda-time</artifactId>

pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
<cs.axiom.version>1.2.8</cs.axiom.version>
124124
<cs.axis.version>1.4</cs.axis.version>
125125
<cs.batik.version>1.14</cs.batik.version>
126-
<cs.bcprov.version>1.64</cs.bcprov.version>
126+
<cs.bcprov.version>1.70</cs.bcprov.version>
127127
<cs.cglib.version>3.3.0</cs.cglib.version>
128128
<cs.checkstyle-lib.version>8.18</cs.checkstyle-lib.version>
129129
<cs.cxf.version>3.2.14</cs.cxf.version>
@@ -554,6 +554,11 @@
554554
<artifactId>bcprov-jdk15on</artifactId>
555555
<version>${cs.bcprov.version}</version>
556556
</dependency>
557+
<dependency>
558+
<groupId>org.bouncycastle</groupId>
559+
<artifactId>bctls-jdk15on</artifactId>
560+
<version>${cs.bcprov.version}</version>
561+
</dependency>
557562
<dependency>
558563
<groupId>org.codehaus.groovy</groupId>
559564
<artifactId>groovy-all</artifactId>

services/console-proxy/rdpconsole/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
<groupId>org.bouncycastle</groupId>
4949
<artifactId>bcprov-jdk15on</artifactId>
5050
</dependency>
51+
<dependency>
52+
<groupId>org.bouncycastle</groupId>
53+
<artifactId>bctls-jdk15on</artifactId>
54+
</dependency>
5155
<dependency>
5256
<groupId>com.sun.xml.security</groupId>
5357
<artifactId>xml-security-impl</artifactId>

services/console-proxy/rdpconsole/src/main/java/streamer/bco/BcoSocketWrapperImpl.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717
package streamer.bco;
1818

1919
import org.apache.log4j.Logger;
20-
import org.bouncycastle.crypto.tls.Certificate;
21-
import org.bouncycastle.crypto.tls.DefaultTlsClient;
22-
import org.bouncycastle.crypto.tls.ServerOnlyTlsAuthentication;
23-
import org.bouncycastle.crypto.tls.TlsAuthentication;
24-
import org.bouncycastle.crypto.tls.TlsClientProtocol;
2520
import org.bouncycastle.jce.provider.BouncyCastleProvider;
21+
import org.bouncycastle.tls.DefaultTlsClient;
22+
import org.bouncycastle.tls.ServerOnlyTlsAuthentication;
23+
import org.bouncycastle.tls.TlsAuthentication;
24+
import org.bouncycastle.tls.TlsClientProtocol;
25+
import org.bouncycastle.tls.TlsServerCertificate;
26+
import org.bouncycastle.tls.crypto.impl.bc.BcTlsCrypto;
2627
import streamer.Direction;
2728
import streamer.Event;
2829
import streamer.SocketWrapperImpl;
@@ -60,18 +61,18 @@ public void upgradeToSsl() {
6061

6162
try {
6263

63-
SecureRandom secureRandom = new SecureRandom();
64-
bcoSslSocket = new TlsClientProtocol(socket.getInputStream(), socket.getOutputStream(), secureRandom);
64+
bcoSslSocket = new TlsClientProtocol(socket.getInputStream(), socket.getOutputStream());
6565

66-
bcoSslSocket.connect(new DefaultTlsClient() {
66+
bcoSslSocket.connect(new DefaultTlsClient(new BcTlsCrypto(new SecureRandom())) {
6767
@Override
6868
public TlsAuthentication getAuthentication() throws IOException {
6969
return new ServerOnlyTlsAuthentication() {
7070
@Override
71-
public void notifyServerCertificate(final Certificate certificate) throws IOException {
71+
public void notifyServerCertificate(final TlsServerCertificate certificate) throws IOException {
7272
try {
7373
if (sslState != null) {
74-
sslState.serverCertificateSubjectPublicKeyInfo = certificate.getCertificateAt(0).getSubjectPublicKeyInfo().getEncoded();
74+
sslState.serverCertificateSubjectPublicKeyInfo =
75+
certificate.getCertificate().getCertificateAt(0).getEncoded();
7576
}
7677
} catch (IOException e) {
7778
throw new RuntimeException("Cannot get server public key.", e);

utils/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@
7070
<groupId>org.bouncycastle</groupId>
7171
<artifactId>bcpkix-jdk15on</artifactId>
7272
</dependency>
73+
<dependency>
74+
<groupId>org.bouncycastle</groupId>
75+
<artifactId>bctls-jdk15on</artifactId>
76+
</dependency>
7377
<dependency>
7478
<groupId>com.jcraft</groupId>
7579
<artifactId>jsch</artifactId>

0 commit comments

Comments
 (0)