-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ClassCastException BCXDHPublicKey to XECPublicKey on JDK 17 #1824
Comments
Okay, I'm not sure what happened there. Would you check the latest beta at https://downloads.bouncycastle.org/betas you should find that's correct. One further question on this one - where did the 1.78.1 jar come from? I've just checked the one we're distributing and it's definitely got the files in there. |
Thank you very much for looking into it, now I got a bit worried where that .jar was coming from but opening up the in the local maven repository folder shows that the java 11+ classes are there indeed in 1.78.1 Now that this red herring is gone I have no idea why we're getting this ClassCastException. |
Okay, I'd suspect jpackage. Not that there is anything wrong with it, but the problem you will run into with a Java cryptography provider is that it has to be loaded by the system class loader as there will be situations where it does not trust anything else. In the past we have seen this cause class annotation issues so for example a class which should be okay will fail like your seeing because it is under an untrusted class loader. |
I looked a bit more into this because I was not sure why BC would kick in, also because the issue only seems to happen rarely (for now I can't reproduce it).
|
Hello,
We are observing this exception on a modular (packaged with jpackage) application running on JDK 17 and with BC 1.78.1
My understanding is that this is supposed to work because BC is released as a multi release jar.
However since 1.78 I see that the content of the Java 11 folder has changed in bcprov-jdk18on:
On 1.77 (and earlier versions) I see that the 11+ classes were packaged:
The osgi manifest was also added, maybe removing the 11+ classes was an unintended change?
Could you please advise if I'm misunderstanding the problem?
Thanks in advance!
The text was updated successfully, but these errors were encountered: