Skip to content

Commit

Permalink
style: format PublicKeyAuthenticationTest
Browse files Browse the repository at this point in the history
  • Loading branch information
liuziyu11 committed Feb 2, 2025
1 parent f1b2a6f commit 0bfda76
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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())
Expand All @@ -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()));

Expand Down Expand Up @@ -526,12 +525,11 @@ void testCertificateWithDifferentAlgorithms(String keyAlgorithm, int keySize, St

private static Stream<Arguments> 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"));
}
}

0 comments on commit 0bfda76

Please sign in to comment.