Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PreShared Key support in Bouncy Castle JSSE Provider #1604

Open
sbernard31 opened this issue Mar 14, 2024 · 2 comments
Open

PreShared Key support in Bouncy Castle JSSE Provider #1604

sbernard31 opened this issue Mar 14, 2024 · 2 comments
Assignees

Comments

@sbernard31
Copy link

I understand that Bouncy Castle have support of PSK over (D)TLS.
But If I get it correctly this in not included in BouncyCastleJsseProvider Provider ?

Is there a way to get PSK available through JSSE API ?
If no, Is there plan about that ?
I see there is some side project which tries to achieve that but I don't really like the idea to rely on this kind of small project. (and they only support SSLSocketFactory not SSLEngine)

(Sorry If asked many question about what is supported in Bouncy Castle because I'm currently try to understand if I should try to use it in Leshan an open source java implementation of LWM2M)

@cipherboy cipherboy self-assigned this Mar 26, 2024
@cipherboy
Copy link
Collaborator

cipherboy commented Mar 26, 2024

@sbernard31 Likely this is an issue for OpenJDK; per https://bugs.openjdk.org/browse/JDK-8049402, it doesn't look like it supports point 4 ("Out-of-band PSK establishment") in the interfaces. Without interfaces from the JDK itself, it is (likely) impossible to implement this through the JSSE API... Unless perhaps we hack a fake, non-X509 (for PSK only) X509Certificate KeyManager class that we can detect in our underlying implementation. This is rather ugly and unlikely to be accepted, plus would make interoperability with any later JDK-provided PSK-in-JSSE harder, if they provide something different than our KeyManager in typing.

I'd suggest perhaps commenting on that issue if directly using the underlying BC TLS implementation isn't feasible.

Note that this is achieved by that project by creating a custom SSLSocket/... interface that wraps our direct TLS implementation. It doesn't really support general interfaces for PSK. My 2c

@sbernard31
Copy link
Author

@cipherboy Thx for your answer 🙏

I get your point. I understand that missing API for PSK in JSSE API is an issue.
I try to discuss about that on security-dev mailing list of OpenJDK : https://mail.openjdk.org/pipermail/security-dev/2024-March/038906.html

But I also see there is project which deal with current API implementing KeyManager.
See : PSKKeyManager from conscrypt project.

I know this is not ideal because we should have a common interface like X509KeyManager in OpenJDK but do you think this could be a way ? I mean Bouncy Castle could create it's own PSKKeyManager for JSSE.
Then eventually we can try to push it in OpenJDK ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants