etnt commented on code in PR #933:
URL: https://github.com/apache/mina-sshd/pull/933#discussion_r4348380995
##########
sshd-core/src/test/java/org/apache/sshd/common/signature/SignatureFactoriesTest.java:
##########
@@ -199,4 +216,21 @@ protected void testKeyPairProvider(
s.auth().verify(AUTH_TIMEOUT.multipliedBy(3));
}
}
+
+ @ParameterizedTest(name = "mldsa={0}")
+ @EnumSource(MLDSAParameterSets.class)
+ void mldsaUserPublicKeyAuth(MLDSAParameterSets params) throws Exception {
+ BuiltinSignatures factory =
BuiltinSignatures.fromFactoryName(params.getSshName());
+ Assumptions.assumeTrue(factory.isSupported());
+ KeyPair hostKey =
SecurityUtils.getKeyPairGenerator(params.getJceName()).generateKeyPair();
+ KeyPair userKey =
SecurityUtils.getKeyPairGenerator(params.getJceName()).generateKeyPair();
+ sshd.setKeyPairProvider(KeyPairProvider.wrap(hostKey));
+ client.setSignatureFactories(Collections.singletonList(factory));
+ try (ClientSession s = client.connect(getCurrentTestName(),
TEST_LOCALHOST, port)
+ .verify(CONNECT_TIMEOUT).getSession()) {
+ s.addPublicKeyIdentity(userKey);
+ s.auth().verify(AUTH_TIMEOUT);
+ assertTrue(s.isAuthenticated());
+ }
Review Comment:
the server setup skips ML-DSA factories that are already in the list, so
there are no duplicates. testKeyPairProvider and mldsaUserPublicKeyAuth
now restore the previous key pair provider and client signature factories
in a finally block.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]