-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Substitute BouncyCastle self-tests which rely on SecureRandom #16105
Conversation
d918327
to
6339576
Compare
Can you please rebase onto Thanks |
Hmm, it affects other tests - looks like the introduction of bouncy castle specific extensions is the way to go... |
For now I've conditioned the substitutions code for it to apply only if the specific BC package is available. I feel adding the extensions would be the right thing to do soon (as @gastaldi and @stuartwdouglas proposed awhile back) - but we are talking about 4 extensions here (BC, BC TLS, BC FIPS, BC FIPS TLS) so I'd rather take care of it in a follow up step a bit later on. |
6339576
to
bd681c2
Compare
bd681c2
to
ecc9e4d
Compare
I did a minor optimization to the substitutions code to restrict the package check for the static set to contain only just about 15 Strings and added the re-init requests for a couple of classes which cause BC FIPS related |
@@ -16,3 +16,6 @@ quarkus.log.category."org.bouncycastle.jsse".min-level=TRACE | |||
quarkus.log.category."org.bouncycastle.jsse".level=TRACE | |||
quarkus.log.file.enable=true | |||
quarkus.log.file.format=%C - %s%n | |||
|
|||
#quarkus.native.additional-build-args=--trace-object-instantiation=org.bouncycastle.crypto.fips.FipsSecureRandom | |||
quarkus.native.additional-build-args=--trace-object-instantiation=java.security.SecureRandom |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI you can do --trace-object-instantiation=java.security.SecureRandom\\,org.bouncycastle.crypto.fips.FipsSecureRandom
to trace both (see second note in https://github.com/quarkusio/quarkus/blob/main/docs/src/main/asciidoc/writing-native-applications-tips.adoc#delaying-class-initialization)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zakkak Thanks, will keep it in mind :-), I left the SecureRandom
tracing as it points out to JceSecurity
; going forward I'll keep combining several classes when tracing - thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's comment this line maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented it out and collapsed into a single property configuration as suggested by @zakkak
@@ -16,3 +16,6 @@ quarkus.log.category."org.bouncycastle.jsse".min-level=TRACE | |||
quarkus.log.category."org.bouncycastle.jsse".level=TRACE | |||
quarkus.log.file.enable=true | |||
quarkus.log.file.format=%C - %s%n | |||
|
|||
#quarkus.native.additional-build-args=--trace-object-instantiation=org.bouncycastle.crypto.fips.FipsSecureRandom | |||
quarkus.native.additional-build-args=--trace-object-instantiation=java.security.SecureRandom |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's comment this line maybe?
e93f04a
to
94aa129
Compare
Failing Jobs
Test Failures⚙️ JVM Tests - JDK 8 #📦 integration-tests/kafka# Tests: 10
+ Success: 8
- Failures: 0
- Errors: 2
! Skipped: 0 ❌
|
Fixes #15889
This PR adds self-tests substitutions as suggested by @galderz (except that they return
true
) and a note has been added to the BC FIPS subsection about the affected classes as IMHO, given that FIPS implies a stricter crypto security, users who will work with this option will need to be aware of every affected algorithm