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

Disable TokenUtilsEncryptTest#testFailAlgorithm on Java 17+ #18790

Merged
merged 1 commit into from
Jul 19, 2021
Merged

Disable TokenUtilsEncryptTest#testFailAlgorithm on Java 17+ #18790

merged 1 commit into from
Jul 19, 2021

Conversation

famod
Copy link
Member

@famod famod commented Jul 18, 2021

Relates to #18372 (comment)

A fix upstream would obviously be much nicer than this XML manipulation. 😉

@famod famod requested review from sberyozkin and radcortez July 18, 2021 23:22
@sberyozkin
Copy link
Member

@famod, missed your comment, sorry,

2021-07-09T02:41:37.1781961Z Expected exception of type class org.jose4j.jwt.consumer.InvalidJwtException but got org.jose4j.lang.InvalidAlgorithmException: A128KW is an unknown, unsupported or unavailable alg algorithm (not one of [RSA1_5, RSA-OAEP, RSA-OAEP-256, dir, ECDH-ES, A128GCMKW, A192GCMKW, A256GCMKW]).

Interesting, this is a strange error because something like dir is not an algorithm known to Java (dir - is just a direct encryption without wrapping the generated encryption key).

Let me look at it a bit more

@famod
Copy link
Member Author

famod commented Jul 19, 2021

@sberyozkin thanks for taking a closer look!
Unless this problem is fixable quickly, I suggest we merge this PR in a timely manner because there should be no negative side effects and it can be reverted easily later.

gsmet
gsmet previously requested changes Jul 19, 2021
Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spotted some minor issues. I agree we should merge it.

@sberyozkin
Copy link
Member

sberyozkin commented Jul 19, 2021

@famod, @gsmet I don't think it should be ignored.

It is not dropped but the name has changed. Rather than merging it as is, I'd suggest to add a BC dependency for this case

https://bugs.openjdk.java.net/browse/JDK-8248268.

I'll open a Jose4j issue (to support AES/KW/NoPadding)

Copy link
Member

@sberyozkin sberyozkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose to investigate an option to use a BC library for now instead of ignoring the test and also open a specific issue to make sure it is run without BC in due time

@famod
Copy link
Member Author

famod commented Jul 19, 2021

@sberyozkin Well, yesterday I did try adding:

                <groupId>org.bouncycastle</groupId>
                <artifactId>bcprov-jdk15on</artifactId>

in test scope but AFAICS, this didn't change anything, maybe because it has to be "installed" explicitly?

@sberyozkin
Copy link
Member

@famod Can you please try passing a system property quarkus.security.security-providers=BC (and also use a normal scope for the dep, as I'm not sure the test one is sufficient) ?

@famod
Copy link
Member Author

famod commented Jul 19, 2021

@sberyozkin unfortunately, the following didn't work:

diff --git a/tcks/microprofile-jwt/pom.xml b/tcks/microprofile-jwt/pom.xml
index b12da6ace4..d9d393d8ad 100644
--- a/tcks/microprofile-jwt/pom.xml
+++ b/tcks/microprofile-jwt/pom.xml
@@ -24,6 +24,7 @@
                     <systemPropertyVariables>
                         <!-- Disable quarkus optimization -->
                         <quarkus.arc.remove-unused-beans>false</quarkus.arc.remove-unused-beans>
+                        <quarkus.security.security-providers>BC</quarkus.security.security-providers>
                         <mp.jwt.tck.jwks.baseURL>http://localhost:8081/</mp.jwt.tck.jwks.baseURL>
                     </systemPropertyVariables>
                     <!-- This workaround allows us to run a single test using
@@ -122,6 +123,11 @@
             </exclusions>
         </dependency>

+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcprov-jdk15on</artifactId>
+        </dependency>
+
         <!-- Minimal test dependencies to *-deployment artifacts for consistent build order -->
         <dependency>
             <groupId>io.quarkus</groupId>

Might be related to testng, checking...

@famod
Copy link
Member Author

famod commented Jul 19, 2021

Setting system properties like this should just work for TestNG, so that's not it.

@sberyozkin
Copy link
Member

@famod OK, let me drop my change request, thanks, perhaps BC does not provide its own implementation. I'll just follow up with a Jose4J issue

@sberyozkin
Copy link
Member

@famod
Copy link
Member Author

famod commented Jul 19, 2021

Ok, thanks! I'll create a housekeeping issue to clean this up eventually.

@famod famod requested a review from gsmet July 19, 2021 17:33
@famod famod dismissed gsmet’s stale review July 19, 2021 19:51

Changes applied

@famod famod merged commit d64efc0 into quarkusio:main Jul 19, 2021
@quarkus-bot quarkus-bot bot added this to the 2.2 - main milestone Jul 19, 2021
@famod famod deleted the ea-jdk-jwt branch July 19, 2021 19:52
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

Successfully merging this pull request may close these issues.

3 participants