Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public void start(BundleContext context) throws Exception {
(Class.forName("org.bouncycastle.jsse.provider.BouncyCastleJsseProvider")).
getDeclaredConstructor().newInstance();
Security.insertProviderAt(jsseProvider, 1);
System.setProperty("org.bouncycastle.jsse.client.earlyKeyShares", "X25519,X25519MLKEM768");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu

file='core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreActivator.java'

printf '%s\n' '--- target context ---'
sed -n '60,105p' "$file"

printf '%s\n' '--- references to the property ---'
rg -n -C 3 'org\.bouncycastle\.jsse\.client\.earlyKeyShares|earlyKeyShares' .

printf '%s\n' '--- activator lifecycle and property setup ---'
rg -n -C 4 'class CarbonCoreActivator|start\(|stop\(|System\.setProperty|System\.getProperty' "$file"

Repository: wso2/carbon-kernel

Length of output: 6767


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- Bouncy Castle dependency declarations ---'
rg -n -i -C 3 'bouncycastle|bcprov|bctls|bcutil|jsse' --glob 'pom.xml' --glob '*.xml' --glob '*.properties' --glob '*.gradle' --glob '*.gradle.kts' .

printf '%s\n' '--- provider configuration constants and documentation ---'
rg -n -i -C 4 'JSSE_PROVIDER_BC|JSSE_PROVIDER|early key|earlyKeyShares|named group|BouncyCastle JSSE' \
  --glob '!target/**' --glob '!build/**' .

printf '%s\n' '--- relevant project documentation files ---'
git ls-files | rg -i '(^|/)(readme|security|configuration|deployment|carbon\.xml|defaults).*|bouncycastle|jsse'

Repository: wso2/carbon-kernel

Length of output: 27773


🌐 Web query:

Bouncy Castle JSSE org.bouncycastle.jsse.client.earlyKeyShares system property default

💡 Result:

The system property org.bouncycastle.jsse.client.earlyKeyShares does not have a defined default value; if the property is not explicitly set, the Bouncy Castle JSSE (BCJSSE) client behaves as if no early key shares are configured [1][2]. When this property is used, it accepts a comma-separated list of group names, following the same syntax as the standard jdk.tls.namedGroups property [1][2]. Any groups specified in this property must be independently enabled as supported groups—either by default or through other configurations such as jdk.tls.namedGroups or SSLParameters.namedGroups—otherwise, they will be ignored [1][2]. The property is read whenever a BCJSSE SSLContext is created and affects all client connections established using that context [1]. Alternatively, developers can control early key shares programmatically using the BCSSLParameters.earlyKeyShares property [1][3].

Citations:


Preserve an operator-supplied earlyKeyShares value.

org.bouncycastle.jsse.client.earlyKeyShares controls BCJSSE SSLContext creation. Set this default only when System.getProperty(...) == null; otherwise, the startup code overrides the operator’s TLS configuration.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreActivator.java`
at line 85, Update the startup logic in CarbonCoreActivator to set the
org.bouncycastle.jsse.client.earlyKeyShares default only when System.getProperty
for that key returns null, preserving any operator-supplied value.

Source: MCP tools

}

} else if (providerName.equals(ServerConstants.JCE_PROVIDER_BCFIPS)) {
Expand Down
2 changes: 1 addition & 1 deletion parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@
<hibernate.orbit.version>3.2.5.ga-wso2v1</hibernate.orbit.version>

<!-- bouncycastle -->
<bouncycastle.version>1.83.0.wso2v1</bouncycastle.version>
<bouncycastle.version>1.84.0.wso2v1</bouncycastle.version>
<imp.pkg.version.bcp>[1.0.0, 2.0.0)</imp.pkg.version.bcp>

<!--BPS specific-->
Expand Down
Loading