Skip to content

Commit 4820361

Browse files
authored
Update oauth2-oidc-sdk and nimbus-jose-jwt (#48537)
Update two dependencies for our OpenID Connect realm implementation to their latest versions
1 parent 84f4f39 commit 4820361

File tree

6 files changed

+18
-11
lines changed

6 files changed

+18
-11
lines changed

x-pack/plugin/security/build.gradle

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ dependencies {
5656
compile 'com.google.guava:guava:19.0'
5757

5858
// Dependencies for oidc
59-
compile "com.nimbusds:oauth2-oidc-sdk:6.5"
60-
compile "com.nimbusds:nimbus-jose-jwt:4.41.2"
59+
compile "com.nimbusds:oauth2-oidc-sdk:6.16.5"
60+
compile "com.nimbusds:nimbus-jose-jwt:8.2"
6161
compile "com.nimbusds:lang-tag:1.4.4"
6262
compile "com.sun.mail:jakarta.mail:1.6.3"
6363
compile "net.jcip:jcip-annotations:1.0"
@@ -82,7 +82,7 @@ dependencies {
8282
testCompile('org.apache.kerby:kerb-crypto:1.1.1')
8383
testCompile('org.apache.kerby:kerb-util:1.1.1')
8484
testCompile('org.apache.kerby:token-provider:1.1.1')
85-
testCompile('com.nimbusds:nimbus-jose-jwt:4.41.2')
85+
testCompile('com.nimbusds:nimbus-jose-jwt:8.2')
8686
testCompile('net.jcip:jcip-annotations:1.0')
8787
testCompile('org.apache.kerby:kerb-admin:1.1.1')
8888
testCompile('org.apache.kerby:kerb-server:1.1.1')
@@ -270,7 +270,13 @@ thirdPartyAudit {
270270
// [missing classes] SLF4j includes an optional class that depends on an extension class (!)
271271
'org.slf4j.ext.EventData',
272272
// Optional dependency of oauth2-oidc-sdk that we don't need since we do not support AES-SIV for JWE
273-
'org.cryptomator.siv.SivMode'
273+
'org.cryptomator.siv.SivMode',
274+
// Optional dependency of nimbus-jose-jwt for handling Ed25519 signatures and ECDH with X25519 (RFC 8037)
275+
'com.google.crypto.tink.subtle.Ed25519Sign',
276+
'com.google.crypto.tink.subtle.Ed25519Sign$KeyPair',
277+
'com.google.crypto.tink.subtle.Ed25519Verify',
278+
'com.google.crypto.tink.subtle.X25519'
279+
274280
)
275281

276282
ignoreViolations (

x-pack/plugin/security/licenses/nimbus-jose-jwt-4.41.2.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3cc99de85969253f2f085c39d87124e21011ae74
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
690bf0290fe0c03dabfb43566dbd334f78ddce84

x-pack/plugin/security/licenses/oauth2-oidc-sdk-6.5.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.

x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/oidc/OpenIdConnectAuthenticatorTests.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.nimbusds.jose.crypto.ECDSASigner;
1111
import com.nimbusds.jose.crypto.MACSigner;
1212
import com.nimbusds.jose.crypto.RSASSASigner;
13+
import com.nimbusds.jose.jwk.Curve;
1314
import com.nimbusds.jose.jwk.ECKey;
1415
import com.nimbusds.jose.jwk.JWK;
1516
import com.nimbusds.jose.jwk.JWKSet;
@@ -971,7 +972,7 @@ private Tuple<Key, JWKSet> getRandomJwkForType(String type) throws Exception {
971972

972973
} else if (type.equals("ES")) {
973974
hashSize = randomFrom(256, 384, 512);
974-
ECKey.Curve curve = curveFromHashSize(hashSize);
975+
Curve curve = curveFromHashSize(hashSize);
975976
KeyPairGenerator gen = KeyPairGenerator.getInstance("EC");
976977
gen.initialize(curve.toECParameterSpec());
977978
KeyPair keyPair = gen.generateKeyPair();
@@ -986,13 +987,13 @@ private Tuple<Key, JWKSet> getRandomJwkForType(String type) throws Exception {
986987
return new Tuple(key, new JWKSet(jwk));
987988
}
988989

989-
private ECKey.Curve curveFromHashSize(int size) {
990+
private Curve curveFromHashSize(int size) {
990991
if (size == 256) {
991-
return ECKey.Curve.P_256;
992+
return Curve.P_256;
992993
} else if (size == 384) {
993-
return ECKey.Curve.P_384;
994+
return Curve.P_384;
994995
} else if (size == 512) {
995-
return ECKey.Curve.P_521;
996+
return Curve.P_521;
996997
} else {
997998
throw new IllegalArgumentException("Invalid hash size:" + size);
998999
}

0 commit comments

Comments
 (0)