Replies: 5 comments 17 replies
-
Beta Was this translation helpful? Give feedback.
-
I have an update following my discussion with Copilot, although I'm not entirely certain about its accuracy. It appears the issue stems from the use of multiple class loaders. Specifically, the Additionally, I noticed that the previous fix was ineffective when the |
Beta Was this translation helpful? Give feedback.
-
@cuichenli I've added a test showing how to confirm BC FipsMode is working as expected, see #40211. |
Beta Was this translation helpful? Give feedback.
-
@sberyozkin thanks for your help, i have updated my repo to follow the test you made but still, the test is failing: https://github.com/cuichenli/quarkus-fips/tree/follow-example one main difference i can notice is that you set up the BC related stuff in |
Beta Was this translation helpful? Give feedback.
-
We have got yet another issue, when FIPS and kubernetes dev services used together, the unit test would not event start. Example: https://github.com/cuichenli/quarkus-fips/tree/kubernetes-client To reproduce the issue, set your
Once the dev service is created, the kubernetes-client extension will wait forever to connect to the kubernetes api server. By checking the source code of https://github.com/dajudge/kindcontainer, i noticed that it will run |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I apologize for the somewhat ambiguous title of this message. The issue we're encountering is intricate, but I'll do my best to clarify it for you. We've observed that when incorporating
bouncycastle fips
into our Quarkus application, it's causing unit test failures, which I suspect are related to the manner in which dependencies are managed by Quarkus.For illustration, consider the repository at https://github.com/cuichenli/quarkus-fips. Running the tests on the latest commit should result in success; however, if we remove the line in application.properties or if we remove the java file src/main, the test fails at: https://github.com/cuichenli/quarkus-fips/blob/master/app/src/test/java/org/example/AppTest.java#L43.
To provide further details, here's how we encountered the issue, as I want to ensure we're addressing it correctly:
Initially, we had a basic setup with an empty src directory and some elementary test code. You can view this initial setup at https://github.com/cuichenli/quarkus-fips/tree/init. At this point, the unit test was failing. Our investigation led us to discover that the value of a ThreadLocal was being altered during the keyGenerator.init(256); call, which caused the test to fail. Although I don't have access to the BouncyCastle source code to show the direct cause, the change in the ThreadLocal value was observed without any thread switching—the
CryptoServicesRegistrar.threadFipsMode
changed fromtrue
tonull
within the function call.To circumvent this, we examined decompiled BouncyCastle code and found that setting a JVM argument could enforce a default value across all threads. This adjustment marks our second stage of troubleshooting, the details of which can be found at https://github.com/cuichenli/quarkus-fips/tree/use-jvm-args. The test no longer failed at the previous line, but the expected exception was not being caught. After some refinement, by altering the caught exception type, the test passed as seen at https://github.com/cuichenli/quarkus-fips/tree/catch-assertionerror.
The behavior seemed unusual, after some investigation, we noticed it could be a potential classloader issue. We then configured the classloader to prioritize parent classes and reverted some earlier changes, as at https://github.com/cuichenli/quarkus-fips/tree/use-parent-first, but the tests began to fail again.
Interestingly, creating a dummy file in the src directory allowed the tests to pass once more, and now we are on the latest code.
I've shared the full context of the issue above and would be immensely grateful for any insights or assistance in understanding what exactly is happening on the Quarkus side. Your guidance will also help in verifying that we're approaching the resolution correctly.
Thank you for your time and support.
Beta Was this translation helpful? Give feedback.
All reactions