Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion adapters/oidc/adapter-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<dependencies>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/installed/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/jakarta-servlet-filter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/jetty/jetty-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/jetty/jetty9.4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/servlet-filter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/spring-security/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/tomcat/tomcat-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/tomcat/tomcat/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/undertow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
2 changes: 1 addition & 1 deletion adapters/oidc/wildfly-elytron/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
2 changes: 1 addition & 1 deletion adapters/saml/jakarta-servlet-filter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
Expand Down
2 changes: 1 addition & 1 deletion adapters/saml/jetty/jetty-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
Expand Down
2 changes: 1 addition & 1 deletion adapters/saml/jetty/jetty9.4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
Expand Down
2 changes: 1 addition & 1 deletion adapters/saml/servlet-filter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
Expand Down
2 changes: 1 addition & 1 deletion adapters/saml/tomcat/tomcat-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
Expand Down
2 changes: 1 addition & 1 deletion adapters/saml/tomcat/tomcat/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
2 changes: 1 addition & 1 deletion adapters/spi/adapter-spi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<dependencies>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion adapters/spi/jboss-adapter-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
4 changes: 2 additions & 2 deletions crypto/default/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<artifactId>bcpkix-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
Expand Down
4 changes: 2 additions & 2 deletions dependencies/server-min/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<artifactId>bcpkix-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
Expand Down
10 changes: 10 additions & 0 deletions distribution/feature-packs/adapter-feature-pack/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,16 @@
<artifactId>wildfly-feature-pack</artifactId>
<version>${wildfly.version}</version>
<type>zip</type>
<exclusions>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
</exclusion>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static ClassLoader resolveClassLoader(String libDir) {

// Detect if BC FIPS jars are present in the "client/lib" directory
boolean bcFipsJarPresent = Stream.of(jarsInDir).anyMatch(file -> file.getName().startsWith("bc-fips"));
String[] validJarPrefixes = bcFipsJarPresent ? new String[] {"keycloak-crypto-fips1402", "bc-fips", "bctls-fips"} : new String[] {"keycloak-crypto-default", "bcprov-jdk15on"};
String[] validJarPrefixes = bcFipsJarPresent ? new String[] {"keycloak-crypto-fips1402", "bc-fips", "bctls-fips"} : new String[] {"keycloak-crypto-default", "bcprov-jdk18on"};
URL[] usedJars = Stream.of(jarsInDir)
.filter(file -> {
for (String prefix : validJarPrefixes) {
Expand Down
2 changes: 1 addition & 1 deletion integration/client-cli/client-cli-dist/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<includes>
<include>org.keycloak:keycloak-crypto-default</include>
<include>org.keycloak:keycloak-crypto-fips1402</include>
<include>org.bouncycastle:bcprov-jdk15on</include>
<include>org.bouncycastle:bcprov-jdk18on</include>
</includes>
<outputDirectory>keycloak-client-tools/bin/client/lib</outputDirectory>
</dependencySet>
Expand Down
2 changes: 1 addition & 1 deletion integration/client-cli/client-cli-dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
<exclusions>
<exclusion>
<groupId>*</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static ClassLoader resolveClassLoader(String libDir) {

// Detect if BC FIPS jars are present in the "client/lib" directory
boolean bcFipsJarPresent = Stream.of(jarsInDir).anyMatch(file -> file.getName().startsWith("bc-fips"));
String[] validJarPrefixes = bcFipsJarPresent ? new String[] {"keycloak-crypto-fips1402", "bc-fips", "bctls-fips"} : new String[] {"keycloak-crypto-default", "bcprov-jdk15on"};
String[] validJarPrefixes = bcFipsJarPresent ? new String[] {"keycloak-crypto-fips1402", "bc-fips", "bctls-fips"} : new String[] {"keycloak-crypto-default", "bcprov-jdk18on"};
URL[] usedJars = Stream.of(jarsInDir)
.filter(file -> {
for (String prefix : validJarPrefixes) {
Expand Down
4 changes: 2 additions & 2 deletions operator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@
<!-- FIXME: Adding BC for now as removing the Bouncycastle dependencies from the operator makes it unusable on K3s and possibly on other kubernetes distributions (e.g. Rancher is based on K3s). -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<artifactId>bcpkix-jdk18on</artifactId>
</dependency>

<!-- Test -->
Expand Down
11 changes: 0 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
<jboss.aesh.version>0.66.19</jboss.aesh.version>
<apache.httpcomponents.version>4.5.14</apache.httpcomponents.version>
<jboss.dmr.version>1.5.1.Final</jboss.dmr.version>
<bouncycastle-bcprov-jdk15on.version>1.70</bouncycastle-bcprov-jdk15on.version>

<!-- TODO Are these correct versions? -->
<bouncycastle.pkixfips.version>1.0.7</bouncycastle.pkixfips.version>
Expand Down Expand Up @@ -353,16 +352,6 @@
<artifactId>xsom</artifactId>
<version>${org.glassfish.jaxb.xsom.version}</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>${bouncycastle-bcprov-jdk15on.version}</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>${bouncycastle-bcprov-jdk15on.version}</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-fips</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private static Optional<String> resolveIgnoredArtifacts(Optional<String> value,

if (profile.getFeatures().get(Feature.FIPS)) {
ignoredArtifacts.addAll(List.of(
"org.bouncycastle:bcprov-jdk15on", "org.bouncycastle:bcpkix-jdk15on", "org.bouncycastle:bcutil-jdk15on", "org.keycloak:keycloak-crypto-default"));
"org.bouncycastle:bcprov-jdk18on", "org.bouncycastle:bcpkix-jdk18on", "org.bouncycastle:bcutil-jdk18on", "org.keycloak:keycloak-crypto-default"));
} else {
ignoredArtifacts.addAll(List.of(
"org.keycloak:keycloak-crypto-fips1402", "org.bouncycastle:bc-fips", "org.bouncycastle:bctls-fips", "org.bouncycastle:bcpkix-fips"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ private WorkspaceModule createWorkspaceModule(String keycloakVersion) {
.addExclusion("org.jboss.logmanager", "log4j-jboss-logmanager");

if (fipsEnabled) {
serverDependency.addExclusion("org.bouncycastle", "bcprov-jdk15on");
serverDependency.addExclusion("org.bouncycastle", "bcpkix-jdk15on");
serverDependency.addExclusion("org.bouncycastle", "bcprov-jdk18on");
serverDependency.addExclusion("org.bouncycastle", "bcpkix-jdk18on");
serverDependency.addExclusion("org.keycloak", "keycloak-crypto-default");
} else {
serverDependency.addExclusion("org.keycloak", "keycloak-crypto-fips1402");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
4 changes: 2 additions & 2 deletions testsuite/integration-arquillian/tests/base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
<artifactId>keycloak-util-embedded-ldap</artifactId>
<exclusions>
<exclusion>
<groupId>bouncycastle</groupId>
<artifactId>bcprov-jdk15</artifactId>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
</exclusion>
</exclusions>
</dependency>
Expand Down
6 changes: 3 additions & 3 deletions testsuite/integration-arquillian/tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<app.server.2.debug.suspend>n</app.server.2.debug.suspend>
<app.server.2.jboss.jvm.debug.args>-agentlib:jdwp=transport=dt_socket,server=y,suspend=${app.server.2.debug.suspend},address=localhost:${app.server.2.debug.port}</app.server.2.jboss.jvm.debug.args>
<app.server.memory.Xms>64m</app.server.memory.Xms>
<app.server.memory.Xmx>512m</app.server.memory.Xmx>
<app.server.memory.Xmx>768m</app.server.memory.Xmx>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this change is safe. Seems like newer versions of BC are more memory demanding (see a failing test without this change). Is that something we want to risk as it might be directly affecting users.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's good point. Hopefully it affects just the app-server (which may not be that important AFAIK due the adapter tests executed on embedded undertow by default?).

Isn't it possible that app-server has both jdk15on and jdk18on dependencies and that being the cause of those issues?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We run with app-server-wildfly by default.

I did a little bit more digging into this. I realized we're actually not including any BC dependencies with the WF/EAP adapter. We use the default BC module that's already present in WF. You can simply double check that by building the adapters dist and checking the JARs included. There are actually no 3rd party deps bundled in our adapters dist. That means WF/EAP adapter should not be affected by this change at all.

The reason for the out of memory test failures is that we're including the BC deps in our test app WARs. The newer versions of BC libs are a few MBs larger. Hence I believe we're reaching the memory limit because of this.

However, where we are also including the BC deps is the Tomcat and Jetty adapters. Those are affected by this upgrade. This is NOT tested in GHA. @mposolda @miquelsi Do we need to run the full internal pipeline to test this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running internal adapter pipeline can be nice, however our java adapters are deprecated. So not 100% sure it is strictly needed if it is too much work... IMO any performance/memory "regression" specific only to java adapters is fine due their deprecation (as long as it does not affect the Keycloak server).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mposolda Are you then fine with merging this? :) It'd be nice to have it in 22.0.1 to fix #21664

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, ok. I am approving

<app.server.memory.settings>-Xms${app.server.memory.Xms} -Xmx${app.server.memory.Xmx} -XX:MetaspaceSize=${surefire.memory.metaspace} -XX:MaxMetaspaceSize=${surefire.memory.metaspace.max}</app.server.memory.settings>
<app.server.ssl.required>false</app.server.ssl.required>
<app.server.truststore>${app.server.keystore.dir}/keycloak.truststore</app.server.truststore>
Expand Down Expand Up @@ -1810,11 +1810,11 @@

<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<artifactId>bcpkix-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
Expand Down
4 changes: 2 additions & 2 deletions testsuite/utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<artifactId>bcpkix-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
Expand Down