[java-idp-oidc] 01/03: Included ECDH-* -compatible encryption key (EC) for testing.
Henri Mikkonen
henri.mikkonen at iki.fi
Tue Mar 28 15:07:34 UTC 2023
This is an automated email from the git hooks/post-receive script.
hjmikkon pushed a commit to branch main
in repository java-idp-oidc.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-oidc.git;a=commit;h=e4159b5569c1983302b386c965905f263bb9b224
commit e4159b5569c1983302b386c965905f263bb9b224
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Tue Mar 28 17:33:27 2023 +0300
Included ECDH-* -compatible encryption key (EC) for testing.
---
.../idp/plugin/oidc/op/profile/flow/KeySetFlowTest.java | 5 ++++-
.../src/test/resources/conf/oidc-credentials.xml | 4 ++++
.../src/test/resources/credentials/idp-encryption-ec.jwk | 9 +++++++++
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/flow/KeySetFlowTest.java b/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/flow/KeySetFlowTest.java
index daac458d..ace09fe7 100644
--- a/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/flow/KeySetFlowTest.java
+++ b/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/flow/KeySetFlowTest.java
@@ -45,6 +45,7 @@ public class KeySetFlowTest extends AbstractOidcFlowTest {
Resource ecSigKey = new FileSystemResource("src/test/resources/credentials/idp-signing-es.jwk");
Resource ec384SigKey = new FileSystemResource("src/test/resources/credentials/idp-signing-es384.jwk");
Resource ec512SigKey = new FileSystemResource("src/test/resources/credentials/idp-signing-es521.jwk");
+ Resource ecEncKey = new FileSystemResource("src/test/resources/credentials/idp-encryption-ec.jwk");
public KeySetFlowTest() {
super(FLOW_ID);
@@ -58,7 +59,7 @@ public class KeySetFlowTest extends AbstractOidcFlowTest {
final JWKSet jwkSet = JWKSet.parse(response.toHTTPResponse().getContent());
final List<JWK> keys = jwkSet.getKeys();
Assert.assertNotNull(keys);
- Assert.assertEquals(keys.size(), 5);
+ Assert.assertEquals(keys.size(), 6);
final JWK rsaSigJwk = JWK.parse(IOUtils.toString(rsaSigKey.getInputStream(), "UTF-8"));
Assert.assertTrue(listContainsPublicJwk(keys, rsaSigJwk));
final JWK rsaEncJwk = JWK.parse(IOUtils.toString(rsaEncKey.getInputStream(), "UTF-8"));
@@ -69,6 +70,8 @@ public class KeySetFlowTest extends AbstractOidcFlowTest {
Assert.assertTrue(listContainsPublicJwk(keys, ec384SigJwk));
final JWK ec512SigJwk = JWK.parse(IOUtils.toString(ec512SigKey.getInputStream(), "UTF-8"));
Assert.assertTrue(listContainsPublicJwk(keys, ec512SigJwk));
+ final JWK ecEncJwk = JWK.parse(IOUtils.toString(ecEncKey.getInputStream(), "UTF-8"));
+ Assert.assertTrue(listContainsPublicJwk(keys, ecEncJwk));
}
protected boolean listContainsPublicJwk(final List<JWK> list, final JWK jwk) {
diff --git a/idp-oidc-extension-impl/src/test/resources/conf/oidc-credentials.xml b/idp-oidc-extension-impl/src/test/resources/conf/oidc-credentials.xml
index e72a019f..663dc553 100644
--- a/idp-oidc-extension-impl/src/test/resources/conf/oidc-credentials.xml
+++ b/idp-oidc-extension-impl/src/test/resources/conf/oidc-credentials.xml
@@ -26,6 +26,9 @@
<bean id="shibboleth.oidc.DefaultRSAEncryptionCredential" parent="shibboleth.JWKCredential"
p:resource="%{idp.signing.oidc.rsa.enc.key}" />
+ <bean id="shibboleth.oidc.DefaultECEncryptionCredential" parent="shibboleth.JWKCredential"
+ p:resource="/credentials/idp-encryption-ec.jwk" />
+
<!--
Lists ALL of your OP's response signing credentials for the default security configuration.
If you define additional signing credentials make sure to include them within this list.
@@ -43,6 +46,7 @@
-->
<util:list id="shibboleth.oidc.EncryptionCredentials">
<ref bean="shibboleth.oidc.DefaultRSAEncryptionCredential" />
+ <ref bean="shibboleth.oidc.DefaultECEncryptionCredential" />
</util:list>
<!--
diff --git a/idp-oidc-extension-impl/src/test/resources/credentials/idp-encryption-ec.jwk b/idp-oidc-extension-impl/src/test/resources/credentials/idp-encryption-ec.jwk
new file mode 100644
index 00000000..713fb9ed
--- /dev/null
+++ b/idp-oidc-extension-impl/src/test/resources/credentials/idp-encryption-ec.jwk
@@ -0,0 +1,9 @@
+{
+ "kty": "EC",
+ "d": "_hmRa4MW4KUu5z7e5dKHjR0h1-aSOVqsTe1CsKPRTCY",
+ "use": "enc",
+ "crv": "P-256",
+ "kid": "defaultECEncryptionCredential",
+ "x": "39LQhnWNxWO_0V3t8ZLOUhVt9cXCExNdxWNfypsEWNU",
+ "y": "H-ybUQBhaNx4IfdGOC0Bl6Hbxwz2Xf8BnRUzHkz9HeE"
+}
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list