Repository navigation
Add ECDH-ES JWE Algorithm Provider - #23928
Conversation
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.saml.AudienceProtocolMappersTest#testAudienceResolveFullScope |
There was a problem hiding this comment.
@justin-tay Thank you. I added some review comments. Could you check them?
BCFIPSEcdhEsAlgorithmProvider, ElytronEcdhEsAlgorithmProvider, and BCEcdhEsAlgorithmProvider have a lot of shared codes.
Also, BCFIPSEcdhEsAlgorithmProviderTest, ElytronEcdhEsAlgorithmProviderTest, and BCEcdhEsAlgorithmProviderTest have a lot of shared codes.
It might be good if you consider designing those classes to reduce redundant codes.
There was a problem hiding this comment.
Could you replace 2016 with 2024 or 2023?
There was a problem hiding this comment.
Have replaced it with 2024.
There was a problem hiding this comment.
How about setting ecdhAlgorithm directly?
return createKeyWrapper(keyPair, ecdhAlgorithm, KeyUse.ENC);
There was a problem hiding this comment.
Have set the ecdhAlgorithm directly as suggested.
There was a problem hiding this comment.
How about the following (inserting a space) ?
if (Algorithm.ECDH_ES.equals(algorithm)) {
There was a problem hiding this comment.
Have fixed the formatting.
|
@tnorimat Thanks for the review! You are correct that there appears to be shared codes between the different |
|
@justin-tay I see, so we keep your original codes in each BC, BCFIPS and Elytron modules even if these have shared codes. |
|
@tnorimat @justin-tay The problem with duplicated code in crypto projects is old and it happens with other files (for example check |
There was a problem hiding this comment.
Thanks @justin-tay! For me it's OK now. Approved!
There was a problem hiding this comment.
LGTM
@justin-tay Thank you very much for your contribution.
There was a problem hiding this comment.
@justin-tay @rmartinc @tnorimat Thanks everyone for the review!
I have only small concern that this test adds huge amount of new test classes - like 25 new classes of KcOidcBrokerJWEEcdh* . I appreciate the good test coverage, but at the same time, it can be quite an overhead... Is it maybe possible to keep around 5-6 most relevant combinations and delete the rest of those test classes from this PR? WDYT?
|
@justin-tay Also just an update, that you don't need to care about squashing commits for now. I can squash the commits during merging the PR. |
|
@mposolda Thanks for the update! Have left in 8 of the tests and removed the rest. |
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.forms.BruteForceTest#testRaceAttackPermanentLockoutKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.actions.RequiredActionUpdateProfileTest#updateProfileKeycloak CI - Forms IT (firefox) |
|
@justin-tay Thanks! The update is needed in |
Closes keycloak#23596 Signed-off-by: Justin Tay <49700559+justin-tay@users.noreply.github.com>
Closes keycloak#23597 Signed-off-by: Justin Tay <49700559+justin-tay@users.noreply.github.com>
Signed-off-by: Justin Tay <49700559+justin-tay@users.noreply.github.com>
Signed-off-by: Justin Tay <49700559+justin-tay@users.noreply.github.com>
Signed-off-by: Justin Tay <49700559+justin-tay@users.noreply.github.com>
Signed-off-by: Justin Tay <49700559+justin-tay@users.noreply.github.com>
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.javascript.JavascriptAdapterTest#testSilentCheckSso |
There was a problem hiding this comment.
@justin-tay @tnorimat @rmartinc Thanks again to everyone for the participation on this PR!
Closes #23597, Closes #23596
This adds support for the ECDH-ES, ECDH-ES+A128KW, ECDH-ES+A192KW and ECDH-ES+A256KW JWE algorithms.
This required changes to the
JWEAlgorithmProviderinterface.For decoding the CEK the following parameters were needed
alg,enc,epk,apuandapvattributesFor encoding the CEK the following parameters were needed
alg,enc,apuandapvattributes and set theepk,apuandapvattributesThis also required changes to the
JWEHeaderto add theepk,apuandapvattributes and to make it mutable via a builder.