Introduced in version 2.4.0
February 2, 2020 ยท View on GitHub
Major code re-factoring
SftpSubSystemFactory,ScpCommandFactoryand their respectiveBuilder(s) as well as theAbstractGitCommandFactoryuse aSupplier<CloseableExecutorService>instead of an executor instance in order to allow users to provide a "fresh" instance every time a new command instance is initiated and protect their instance from shutdown when session is destroyed:
CloseableExecutorService mySpecialExecutor = ...;
SftpSubsystemFactory factory = new SftpSubsystemFactory.Builder()
.withExecutorServiceProvider(() -> ThreadUtils.noClose(mySpecialExecutor))
.build();
server.setSubsystemFactories(Collections.singletonList(factory));
-
SubsystemFactoryis a proper interface and it has been refactored to contain acreateSubsystemmethod that accepts theChannelSessionthrough which the request has been made -
AbstractSftpSubsystemHelper#resolvePathResolutionFollowLinksis consulted wherever the standard does not specifically specify the behavior regarding symbolic links handling. -
UserAuthFactoryis a proper interface and it has been refactored to contain acreateUserAuthmethod that accepts the session instance through which the request is made. -
ChannelFactoryis a proper interface and it has been refactored to contain acreateChannelmethod that accepts the session instance through which the request is made. -
KeyExchangeFactoryis a proper interface and it has been refactored to contain acreateKeyExchangemethod that accepts the session instance through which the request is made. -
Signaturemethods accept aSessionContextargument representing the session context of their invocation (if any). -
Default MAC(s) list is set according to the ssh_config(5) order as first ones, where the supported MAC(s) that do no appear in it come last.
-
PasswordAuthenticatorhas ahandleClientPasswordChangeRequestmethod that is invoked if a password change has been indicated by the user during authentication via the "password" method - by default throwsUnsupportedOperationException.
Minor code helpers
-
SessionListenersupportssessionPeerIdentificationReceivedmethod that is invoked once successful peer version data is received. -
SessionListenersupportssessionEstablishedmethod that is invoked when initial constructor is executed. -
ChannelIdTrackingUnknownChannelReferenceHandlerextends the functionality of theDefaultUnknownChannelReferenceHandlerby tracking the initialized channels identifiers and being lenient only if command is received for a channel that was initialized in the past. -
The internal moduli used in Diffie-Hellman group exchange are cached - lazy-loaded the 1st time such an exchange occurs. The cache can be invalidated (and thus force a re-load) by invoking
Moduli#clearInternalModuliCache. -
DHGEXClientimplementation allows overriding the min./max. key sizes for a specific session Diffi-Helman group exchange via properties - seeDHGEXClient#PROP_DHGEX_CLIENT_MIN/MAX/PRF_KEY. Similar applies forDHGEXServerbut only for the message type=30 (old request). -
AbstractSignature#doInitSignatureis now provided also with theKeyinstance for which it is invoked. -
The
MacInformationinterface has an extraisEncryptThenMacmethod (default=false) to enable distinction of this mode. -
Provide configurable control over the client-side
ChannelSessionstdin pump chunk size. -
Client side
UserAuthKeyboardInteractiveallows configurable detection of plain-text password prompt. -
Moved a few informative getters from
SessiontoSessionContext.
Behavioral changes and enhancements
-
SSHD-926 - Add support for OpenSSH 'lsetstat@openssh.com' SFTP protocol extension.
-
SSHD-930 - Added configuration allowing the user to specify whether client should wait for the server's identification before sending its own.
-
SSHD-931 - Using an executor supplier instead of a specific instance in
SftpSubsystemFactoryandScpCommandFactory. -
SSHD-934 - Fixed ECDSA public key encoding into OpenSSH format.
-
SSHD-937 - Provide session instance when creating a subsystem, user authentication, channel.
-
SSHD-941 - Allow user to override min./max. key sizes for a specific session Diffi-Helman group exchange via properties.
-
SSHD-943 - Provide session instance when KEX factory is invoked in order to create a KeyExchange instance.
-
SSHD-945 - Added sshd-contrib code that uses SHA1 with DSA regardless of its key length.
-
SSHD-946 - Supporting 'encrypt-then-MAC' mode.
-
SSHD-947 - Added configuration allowing the user to specify whether client should wait for the server's identification before sending KEX-INIT message.
-
SSHD-948 - Do not accept password authentication if the session is not encrypted.
-
SSHD-949 - Session should use cipher block size and not IV size to calculate padding.
-
SSHD-953 - Parse and strip quoted command arguments when executing a server-side command via local shell.
-
SSHD-955 - Provide configurable control over auto-detected password prompt in client-side
UserAuthKeyboardInteractiveimplementation. -
SSHD-956 - Using
System#nanoTimeto measure session idle/authentication timeouts