From 0bfda7621db692589153427db7bb1cb4594eb77e Mon Sep 17 00:00:00 2001 From: liuziyu11 Date: Sat, 1 Feb 2025 07:35:19 +0800 Subject: [PATCH] style: format PublicKeyAuthenticationTest --- .../auth/PublicKeyAuthenticationTest.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/sshd-core/src/test/java/org/apache/sshd/common/auth/PublicKeyAuthenticationTest.java b/sshd-core/src/test/java/org/apache/sshd/common/auth/PublicKeyAuthenticationTest.java index f67e22f5c..134ab37e6 100644 --- a/sshd-core/src/test/java/org/apache/sshd/common/auth/PublicKeyAuthenticationTest.java +++ b/sshd-core/src/test/java/org/apache/sshd/common/auth/PublicKeyAuthenticationTest.java @@ -35,7 +35,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Stream; -import java.util.stream.StreamSupport; import org.apache.sshd.certificate.OpenSshCertificateBuilder; import org.apache.sshd.client.SshClient; @@ -468,7 +467,7 @@ void testCertificateWithDifferentAlgorithms(String keyAlgorithm, int keySize, St KeyPair userkey = CommonTestSupportUtils.generateKeyPair(keyAlgorithm, keySize); // 2. Generating CA key pair KeyPair caKeypair = CommonTestSupportUtils.generateKeyPair(keyAlgorithm, keySize); - + // 3. Building openSshCertificate OpenSshCertificate signedCert = OpenSshCertificateBuilder.userCertificate() .serial(System.currentTimeMillis()) @@ -486,7 +485,7 @@ void testCertificateWithDifferentAlgorithms(String keyAlgorithm, int keySize, St sshd.setPasswordAuthenticator(RejectAllPasswordAuthenticator.INSTANCE); sshd.setKeyboardInteractiveAuthenticator(KeyboardInteractiveAuthenticator.NONE); CoreTestSupportUtils.setupFullSignaturesSupport(sshd); - + sshd.setUserAuthFactories(Collections.singletonList( new org.apache.sshd.server.auth.pubkey.UserAuthPublicKeyFactory())); @@ -526,12 +525,11 @@ void testCertificateWithDifferentAlgorithms(String keyAlgorithm, int keySize, St private static Stream certificateAlgorithms() { return Stream.of( - // key size, signature algorithm, algorithm name - Arguments.of(KeyUtils.RSA_ALGORITHM, 2048, "rsa-sha2-512"), - Arguments.of(KeyUtils.RSA_ALGORITHM, 2048, "rsa-sha2-256"), - Arguments.of(KeyUtils.EC_ALGORITHM, 256, "ecdsa-sha2-nistp256"), - Arguments.of(KeyUtils.EC_ALGORITHM, 384, "ecdsa-sha2-nistp384"), - Arguments.of(KeyUtils.EC_ALGORITHM, 521, "ecdsa-sha2-nistp521") - ); + // key size, signature algorithm, algorithm name + Arguments.of(KeyUtils.RSA_ALGORITHM, 2048, "rsa-sha2-512"), + Arguments.of(KeyUtils.RSA_ALGORITHM, 2048, "rsa-sha2-256"), + Arguments.of(KeyUtils.EC_ALGORITHM, 256, "ecdsa-sha2-nistp256"), + Arguments.of(KeyUtils.EC_ALGORITHM, 384, "ecdsa-sha2-nistp384"), + Arguments.of(KeyUtils.EC_ALGORITHM, 521, "ecdsa-sha2-nistp521")); } }