-
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
FipsStatus.getMarker method does not work with bootstrap class loader #1904
Comments
What version of the FIPS provider is this with? java -Xbootclasspath/a:bc-fips-2.0.0.jar org.bouncycastle.util.DumpInfo produces: Version Info: BouncyCastle Security Provider (FIPS edition) v2.0.0 |
Looks like the issue is specific to java agents with bc-fips-2.0.0.jar appended to the boot class path using Instrumentation.appendToBootstrapClassLoaderSearch Below are the steps to reproduce this
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended |
So I've tried a couple of different things, but the problem seems to remain... I did find this worked though: java --module-path /tmp/bc-fips-2.0.0.jar -javaagent:TestAgent.jar org.bouncycastle.util.DumpInfo Is that any help, or does the additional use of --module-path cause problems? |
I run into the issue with BCFIPS 2.0.0. The method is trying to get resource from system class loader, which is not available because BCFIPS was added to bootstrap class loader in the agent and the resource is not passed to system class loader. |
I hate to say this, but the problem appears to be intractable. Any call to getResource() returns null under this case, even when the class is something like: I also think this is a bug, but it's not one of ours. I'd recommend reporting it to Oracle, if it hasn't been already. |
If using bootstrap class loader, the FipsStatus.getMarker() cannot work because it relies on system class loader.
Here is the context:
In the FipsStatus.getMarker(final Class sourceClass, final String markerName) implementation:
ClassLoader loader = sourceClass.getClassLoader();
ClassLoader.getSystemResource(markerName).toString();
Is it possible to have an improvement so that this method could work with bootstrap class loader?
sourceClass.getResource(markerName) may not work as bc libs may not have a module name.
Thanks!
The text was updated successfully, but these errors were encountered: