[java-oidc-common] branch dev/JCOMOIDC-41 updated: Fix tests, lock opensaml to 4.2.0
Phil Smart
philip.smart at jisc.ac.uk
Wed Sep 28 15:22:05 UTC 2022
This is an automated email from the git hooks/post-receive script.
philsmart pushed a commit to branch dev/JCOMOIDC-41
in repository java-oidc-common.
View the commit online:
http://git.shibboleth.net/view/?p=java-oidc-common.git;a=commit;h=ec88fa4b38dab2614e01b8fa5089d23be36bdca6
The following commit(s) were added to refs/heads/dev/JCOMOIDC-41 by this push:
new ec88fa4 Fix tests, lock opensaml to 4.2.0
ec88fa4 is described below
commit ec88fa4b38dab2614e01b8fa5089d23be36bdca6
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Wed Sep 28 16:21:59 2022 +0100
Fix tests, lock opensaml to 4.2.0
---
.../oidc/security/impl/JWTDecrypterTest.java | 23 ++++++++++++++++++----
pom.xml | 2 +-
2 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/oidc-common-crypto-impl/src/test/java/net/shibboleth/oidc/security/impl/JWTDecrypterTest.java b/oidc-common-crypto-impl/src/test/java/net/shibboleth/oidc/security/impl/JWTDecrypterTest.java
index 015b06f..e1b414d 100644
--- a/oidc-common-crypto-impl/src/test/java/net/shibboleth/oidc/security/impl/JWTDecrypterTest.java
+++ b/oidc-common-crypto-impl/src/test/java/net/shibboleth/oidc/security/impl/JWTDecrypterTest.java
@@ -52,6 +52,7 @@ import com.nimbusds.jwt.SignedJWT;
import net.shibboleth.oidc.security.JWTDecryptionParameters;
import net.shibboleth.oidc.security.credential.BasicJWKCredential;
import net.shibboleth.oidc.security.credential.JOSEObjectCredentialResolver;
+import net.shibboleth.oidc.security.credential.JWKCredential;
import net.shibboleth.utilities.java.support.resolver.CriteriaSet;
import net.shibboleth.utilities.java.support.resolver.ResolverException;
@@ -121,7 +122,10 @@ public class JWTDecrypterTest {
.keyID("mock-key")
.build(),
new Payload(createdSignedJWT()));
- jweObject.encrypt(new AESEncrypter(CLIENT_SECRET.getBytes(StandardCharsets.UTF_8)));
+ final JWKCredential cred = JWKCredentialSupport.deriveSymmetricKeyForAlgAndEnc(
+ TestCredentialHelper.createClientSecretCredential(CLIENT_SECRET), JWEAlgorithm.DIR,
+ EncryptionMethod.A256GCM);
+ jweObject.encrypt(new AESEncrypter(cred.getSecretKey()));
final EncryptedJWT jwe = EncryptedJWT.parse(jweObject.serialize());
final var params = new JWTDecryptionParameters();
@@ -163,7 +167,10 @@ public class JWTDecrypterTest {
.keyID("mock-key")
.build(),
new Payload(createdSignedJWT()));
- jweObject.encrypt(new AESEncrypter(CLIENT_SECRET.getBytes(StandardCharsets.UTF_8)));
+ final JWKCredential cred = JWKCredentialSupport.deriveSymmetricKeyForAlgAndEnc(
+ TestCredentialHelper.createClientSecretCredential(CLIENT_SECRET), JWEAlgorithm.DIR,
+ EncryptionMethod.A256GCM);
+ jweObject.encrypt(new AESEncrypter(cred.getSecretKey()));
final EncryptedJWT jwe = EncryptedJWT.parse(jweObject.serialize());
final var params = new JWTDecryptionParameters();
@@ -184,7 +191,12 @@ public class JWTDecrypterTest {
.keyID("mock-key")
.build(),
new Payload(createdSignedJWT()));
- jweObject.encrypt(new DirectEncrypter(CLIENT_SECRET.getBytes(StandardCharsets.UTF_8)));
+
+
+ final JWKCredential cred = JWKCredentialSupport.deriveSymmetricKeyForAlgAndEnc(
+ TestCredentialHelper.createClientSecretCredential(CLIENT_SECRET), JWEAlgorithm.DIR,
+ EncryptionMethod.A256GCM);
+ jweObject.encrypt(new DirectEncrypter(cred.getSecretKey()));
final EncryptedJWT jwe = EncryptedJWT.parse(jweObject.serialize());
final var params = new JWTDecryptionParameters();
@@ -227,7 +239,10 @@ public class JWTDecrypterTest {
.keyID("mock-key")
.build(),
new Payload(createdSignedJWT()));
- jweObject.encrypt(new DirectEncrypter(CLIENT_SECRET.getBytes(StandardCharsets.UTF_8)));
+ final JWKCredential cred = JWKCredentialSupport.deriveSymmetricKeyForAlgAndEnc(
+ TestCredentialHelper.createClientSecretCredential(CLIENT_SECRET), JWEAlgorithm.DIR,
+ EncryptionMethod.A256GCM);
+ jweObject.encrypt(new DirectEncrypter(cred.getSecretKey()));
final EncryptedJWT jwe = EncryptedJWT.parse(jweObject.serialize());
final var params = new JWTDecryptionParameters();
diff --git a/pom.xml b/pom.xml
index 337553a..af42654 100644
--- a/pom.xml
+++ b/pom.xml
@@ -18,7 +18,7 @@
<idp.groupId>net.shibboleth.idp</idp.groupId>
<idp.version>4.2.0</idp.version>
<opensaml.groupId>org.opensaml</opensaml.groupId>
- <opensaml.version>4.2.1-SNAPSHOT</opensaml.version>
+ <opensaml.version>4.2.0</opensaml.version>
<java-support.version>8.3.1</java-support.version>
<nimbus-jose-jwt.version>9.14</nimbus-jose-jwt.version>
<oauth2-oidc-sdk.version>9.20</oauth2-oidc-sdk.version>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list