Skip to content

Commit 6359fd0

Browse files
committed
[KYUUBI #1940] [TEST] Fix EngineSecurityAccessorSuite
### _Why are the changes needed?_ Currently, the UT failed in AArch64 JDK-17 with ``` EngineSecurityAccessorSuite: - test encrypt/decrypt, issue token/auth token *** FAILED *** java.security.NoSuchAlgorithmException: Cannot find any provider supporting AES/CTR/PKCS5PADDING at java.base/javax.crypto.Cipher.getInstance(Cipher.java:571) at org.apache.kyuubi.service.authentication.EngineSecurityAccessor.initializeForAuth(EngineSecurityAccessor.scala:43) at org.apache.kyuubi.service.authentication.EngineSecurityAccessor.<init>(EngineSecurityAccessor.scala:36) at org.apache.kyuubi.service.authentication.EngineSecurityAccessorSuite.$anonfun$new$2(EngineSecurityAccessorSuite.scala:34) at org.apache.kyuubi.service.authentication.EngineSecurityAccessorSuite.$anonfun$new$2$adapted(EngineSecurityAccessorSuite.scala:30) at scala.collection.immutable.List.foreach(List.scala:431) at org.apache.kyuubi.service.authentication.EngineSecurityAccessorSuite.$anonfun$new$1(EngineSecurityAccessorSuite.scala:30) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) at org.scalatest.OutcomeOf.outcomeOf(OutcomeOf.scala:85) at org.scalatest.OutcomeOf.outcomeOf$(OutcomeOf.scala:83) ... Cause: javax.crypto.NoSuchPaddingException: CTR mode must be used with NoPadding at java.base/com.sun.crypto.provider.CipherCore.setPadding(CipherCore.java:300) at java.base/com.sun.crypto.provider.AESCipher.engineSetPadding(AESCipher.java:225) at java.base/javax.crypto.Cipher$Transform.setModePadding(Cipher.java:388) at java.base/javax.crypto.Cipher.getInstance(Cipher.java:564) at org.apache.kyuubi.service.authentication.EngineSecurityAccessor.initializeForAuth(EngineSecurityAccessor.scala:43) at org.apache.kyuubi.service.authentication.EngineSecurityAccessor.<init>(EngineSecurityAccessor.scala:36) at org.apache.kyuubi.service.authentication.EngineSecurityAccessorSuite.$anonfun$new$2(EngineSecurityAccessorSuite.scala:34) at org.apache.kyuubi.service.authentication.EngineSecurityAccessorSuite.$anonfun$new$2$adapted(EngineSecurityAccessorSuite.scala:30) at scala.collection.immutable.List.foreach(List.scala:431) at org.apache.kyuubi.service.authentication.EngineSecurityAccessorSuite.$anonfun$new$1(EngineSecurityAccessorSuite.scala:30) ... ``` ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #1940 from pan3793/encrypt. Closes #1940 527aa44 [Cheng Pan] [TEST] Fix EngineSecurityAccessorSuite Authored-by: Cheng Pan <chengpan@apache.org> Signed-off-by: Cheng Pan <chengpan@apache.org>
1 parent 1774c3f commit 6359fd0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kyuubi-common/src/test/scala/org/apache/kyuubi/service/authentication/EngineSecurityAccessorSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class EngineSecurityAccessorSuite extends KyuubiFunSuite {
2727
classOf[UserDefinedEngineSecuritySecretProvider].getCanonicalName)
2828

2929
test("test encrypt/decrypt, issue token/auth token") {
30-
Seq("AES/CBC/PKCS5PADDING", "AES/CTR/PKCS5PADDING").foreach { cipher =>
30+
Seq("AES/CBC/PKCS5PADDING", "AES/CTR/NoPadding").foreach { cipher =>
3131
val newConf = conf.clone
3232
newConf.set(KyuubiConf.ENGINE_SECURITY_CRYPTO_CIPHER_TRANSFORMATION, cipher)
3333

0 commit comments

Comments
 (0)