Skip to content

Commit 13102d4

Browse files
slobodanadamovicalexey-ivanov-es
authored andcommitted
Upgrade Bouncy Castle FIPS dependencies (elastic#112989)
This PR updates `bc-fips` and `bctls-fips` dependencies to the latest minor versions.
1 parent dd912b8 commit 13102d4

File tree

12 files changed

+34
-22
lines changed

12 files changed

+34
-22
lines changed

build-tools-internal/src/main/groovy/elasticsearch.fips.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ if (buildParams.inFipsJvm) {
2525
File fipsSecurity = new File(fipsResourcesDir, javaSecurityFilename)
2626
File fipsPolicy = new File(fipsResourcesDir, 'fips_java.policy')
2727
File fipsTrustStore = new File(fipsResourcesDir, 'cacerts.bcfks')
28-
def bcFips = dependencies.create('org.bouncycastle:bc-fips:1.0.2.4')
29-
def bcTlsFips = dependencies.create('org.bouncycastle:bctls-fips:1.0.17')
28+
def bcFips = dependencies.create('org.bouncycastle:bc-fips:1.0.2.5')
29+
def bcTlsFips = dependencies.create('org.bouncycastle:bctls-fips:1.0.19')
3030
def manualDebug = false; //change this to manually debug bouncy castle in an IDE
3131
if(manualDebug) {
32-
bcFips = dependencies.create('org.bouncycastle:bc-fips-debug:1.0.2.4')
33-
bcTlsFips = dependencies.create('org.bouncycastle:bctls-fips:1.0.17'){
32+
bcFips = dependencies.create('org.bouncycastle:bc-fips-debug:1.0.2.5')
33+
bcTlsFips = dependencies.create('org.bouncycastle:bctls-fips:1.0.19'){
3434
exclude group: 'org.bouncycastle', module: 'bc-fips' // to avoid jar hell
3535
}
3636
}

build-tools-internal/src/main/resources/fips_java.policy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ grant {
55
permission java.security.SecurityPermission "getProperty.jdk.tls.disabledAlgorithms";
66
permission java.security.SecurityPermission "getProperty.jdk.certpath.disabledAlgorithms";
77
permission java.security.SecurityPermission "getProperty.jdk.tls.server.defaultDHEParameters";
8+
permission java.security.SecurityPermission "getProperty.org.bouncycastle.ec.max_f2m_field_size";
89
permission java.lang.RuntimePermission "getProtectionDomain";
910
permission java.util.PropertyPermission "java.runtime.name", "read";
1011
permission org.bouncycastle.crypto.CryptoServicesPermission "tlsAlgorithmsEnabled";
@@ -20,6 +21,6 @@ grant {
2021
};
2122

2223
// rely on the caller's socket permissions, the JSSE TLS implementation here is always allowed to connect
23-
grant codeBase "file:${jdk.module.path}/bctls-fips-1.0.17.jar" {
24+
grant codeBase "file:${jdk.module.path}/bctls-fips-1.0.19.jar" {
2425
permission java.net.SocketPermission "*", "connect";
2526
};

distribution/tools/plugin-cli/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dependencies {
2929
implementation 'org.ow2.asm:asm-tree:9.7'
3030

3131
api "org.bouncycastle:bcpg-fips:1.0.7.1"
32-
api "org.bouncycastle:bc-fips:1.0.2.4"
32+
api "org.bouncycastle:bc-fips:1.0.2.5"
3333
testImplementation project(":test:framework")
3434
testImplementation "com.google.jimfs:jimfs:${versions.jimfs}"
3535
testRuntimeOnly "com.google.guava:guava:${versions.jimfs_guava}"

docs/changelog/112989.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 112989
2+
summary: Upgrade Bouncy Castle FIPS dependencies
3+
area: Security
4+
type: upgrade
5+
issues: []

docs/reference/security/fips-140-compliance.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ https://docs.oracle.com/en/java/javase/17/security/java-cryptography-architectur
5353
https://docs.oracle.com/en/java/javase/17/security/java-secure-socket-extension-jsse-reference-guide.html[JSSE] implementation is required
5454
so that the JVM uses FIPS validated implementations of NIST recommended cryptographic algorithms.
5555

56-
Elasticsearch has been tested with Bouncy Castle's https://repo1.maven.org/maven2/org/bouncycastle/bc-fips/1.0.2.4/bc-fips-1.0.2.4.jar[bc-fips 1.0.2.4]
57-
and https://repo1.maven.org/maven2/org/bouncycastle/bctls-fips/1.0.17/bctls-fips-1.0.17.jar[bctls-fips 1.0.17].
56+
Elasticsearch has been tested with Bouncy Castle's https://repo1.maven.org/maven2/org/bouncycastle/bc-fips/1.0.2.5/bc-fips-1.0.2.5.jar[bc-fips 1.0.2.5]
57+
and https://repo1.maven.org/maven2/org/bouncycastle/bctls-fips/1.0.19/bctls-fips-1.0.19.jar[bctls-fips 1.0.19].
5858
Please refer to the {es}
5959
https://www.elastic.co/support/matrix#matrix_jvm[JVM support matrix] for details on which combinations of JVM and security provider are supported in FIPS mode. Elasticsearch does not ship with a FIPS certified provider. It is the responsibility of the user
6060
to install and configure the security provider to ensure compliance with FIPS 140-2. Using a FIPS certified provider will ensure that only

gradle/verification-metadata.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3288,14 +3288,14 @@
32883288
<sha256 value="d749db58c2bd353f1c03541d747b753931d4b84da8e48993ef51efe8694b4ed7" origin="Generated by Gradle"/>
32893289
</artifact>
32903290
</component>
3291-
<component group="org.bouncycastle" name="bc-fips" version="1.0.2.4">
3292-
<artifact name="bc-fips-1.0.2.4.jar">
3293-
<sha256 value="703ecd8a3a619800269bc8cd442f2ebf469bd2fe70478364f58ddc6460c35f9f" origin="Generated by Gradle"/>
3291+
<component group="org.bouncycastle" name="bc-fips" version="1.0.2.5">
3292+
<artifact name="bc-fips-1.0.2.5.jar">
3293+
<sha256 value="50e4c7a0d0c68413d3d8587560d56945ac09e7c89c41bd971cd22d76be6f1085" origin="Generated by Gradle"/>
32943294
</artifact>
32953295
</component>
3296-
<component group="org.bouncycastle" name="bc-fips-debug" version="1.0.2.4">
3297-
<artifact name="bc-fips-debug-1.0.2.4.jar">
3298-
<sha256 value="a025e947c9c91d023bf2a0a3a74d78d5f8b9f6f0f4de13dc52025f2b996a306b" origin="Generated by Gradle"/>
3296+
<component group="org.bouncycastle" name="bc-fips-debug" version="1.0.2.5">
3297+
<artifact name="bc-fips-debug-1.0.2.5.jar">
3298+
<sha256 value="5cfda7e020c5c1a3b1724386f139957472e551494254b8fc74e34f73590fc605" origin="Generated by Gradle"/>
32993299
</artifact>
33003300
</component>
33013301
<component group="org.bouncycastle" name="bcpg-fips" version="1.0.7.1">
@@ -3333,9 +3333,9 @@
33333333
<sha256 value="add5915e6acfc6ab5836e1fd8a5e21c6488536a8c1f21f386eeb3bf280b702d7" origin="Generated by Gradle"/>
33343334
</artifact>
33353335
</component>
3336-
<component group="org.bouncycastle" name="bctls-fips" version="1.0.17">
3337-
<artifact name="bctls-fips-1.0.17.jar">
3338-
<sha256 value="51dfd28ec370f27ba4efc10ec8e21129e34e2f2340ac465a6d17a468e0a4696d" origin="Generated by Gradle"/>
3336+
<component group="org.bouncycastle" name="bctls-fips" version="1.0.19">
3337+
<artifact name="bctls-fips-1.0.19.jar">
3338+
<sha256 value="a0bbad2eb5268f1baa08f0e2e69cb61cd292e19e73595c620d586d335d97d1a8" origin="Generated by Gradle"/>
33393339
</artifact>
33403340
</component>
33413341
<component group="org.bouncycastle" name="bcutil-jdk18on" version="1.78.1">

plugins/discovery-ec2/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ tasks.register("writeTestJavaPolicy") {
7777
"permission java.security.SecurityPermission \"getProperty.jdk.tls.disabledAlgorithms\";",
7878
"permission java.security.SecurityPermission \"getProperty.jdk.certpath.disabledAlgorithms\";",
7979
"permission java.security.SecurityPermission \"getProperty.keystore.type.compat\";",
80+
"permission java.security.SecurityPermission \"getProperty.org.bouncycastle.ec.max_f2m_field_size\";",
8081
"};"
8182
].join("\n")
8283
)

test/test-clusters/src/main/resources/fips/fips_java.policy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ grant {
55
permission java.security.SecurityPermission "getProperty.jdk.tls.disabledAlgorithms";
66
permission java.security.SecurityPermission "getProperty.jdk.certpath.disabledAlgorithms";
77
permission java.security.SecurityPermission "getProperty.jdk.tls.server.defaultDHEParameters";
8+
permission java.security.SecurityPermission "getProperty.org.bouncycastle.ec.max_f2m_field_size";
89
permission java.lang.RuntimePermission "getProtectionDomain";
910
permission java.util.PropertyPermission "java.runtime.name", "read";
1011
permission org.bouncycastle.crypto.CryptoServicesPermission "tlsAlgorithmsEnabled";
@@ -20,6 +21,6 @@ grant {
2021
};
2122

2223
// rely on the caller's socket permissions, the JSSE TLS implementation here is always allowed to connect
23-
grant codeBase "file:${jdk.module.path}/bctls-fips-1.0.17.jar" {
24+
grant codeBase "file:${jdk.module.path}/bctls-fips-1.0.19.jar" {
2425
permission java.net.SocketPermission "*", "connect";
2526
};

x-pack/plugin/core/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ dependencies {
6565
testImplementation project(path: ':modules:rest-root')
6666
testImplementation project(path: ':modules:health-shards-availability')
6767
// Needed for Fips140ProviderVerificationTests
68-
testCompileOnly('org.bouncycastle:bc-fips:1.0.2.4')
68+
testCompileOnly('org.bouncycastle:bc-fips:1.0.2.5')
6969

7070
testImplementation(project(':x-pack:license-tools')) {
7171
transitive = false

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ssl/RestrictedTrustManagerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public void testThatDelegateTrustManagerIsRespected() throws Exception {
218218
if (cert.endsWith("/ca")) {
219219
assertTrusted(trustManager, cert);
220220
} else {
221-
assertNotValid(trustManager, cert, inFipsJvm() ? "Unable to find certificate chain." : "PKIX path building failed.*");
221+
assertNotValid(trustManager, cert, inFipsJvm() ? "Unable to construct a valid chain" : "PKIX path building failed.*");
222222
}
223223
}
224224
}

0 commit comments

Comments
 (0)