Class DefaultClientKexExtensionHandler
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.common.kex.extension.DefaultClientKexExtensionHandler
- All Implemented Interfaces:
KexExtensionHandler
public class DefaultClientKexExtensionHandler
extends AbstractLoggingBean
implements KexExtensionHandler
Detects if the server sends a
"server-sig-algs" and updates the client
session by adding the "rsa-sha2-256/512" signature
factories (if not already added).
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.sshd.common.kex.extension.KexExtensionHandler
KexExtensionHandler.AvailabilityPhase, KexExtensionHandler.KexPhase -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AttributeRepository.AttributeKey<Integer> SessionAttributeRepository.AttributeKeystoring the version if the server supports host-bound public key authentication.static final DefaultClientKexExtensionHandlerDefault singleton instance.static final AttributeRepository.AttributeKey<Set<String>> SessionAttributeRepository.AttributeKeystoring the algorithms announced by the server as known.Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanhandleKexExtensionRequest(Session session, int index, int count, String name, byte[] data) Invoked byKexExtensionHandler.handleKexExtensionsMessage(Session, Buffer)in order to handle a specific extension.protected voidhandleServerSignatureAlgorithms(Session session, Collection<String> serverAlgorithms) Perform updates after a server-sig-algs extension has been received.booleanisKexExtensionsAvailable(Session session, KexExtensionHandler.AvailabilityPhase phase) Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.sshd.common.kex.extension.KexExtensionHandler
handleKexCompressionMessage, handleKexExtensionNegotiation, handleKexExtensionsMessage, handleKexInitProposal, sendKexExtensions
-
Field Details
-
INSTANCE
Default singleton instance. -
SERVER_ALGORITHMS
SessionAttributeRepository.AttributeKeystoring the algorithms announced by the server as known. -
HOSTBOUND_AUTHENTICATION
SessionAttributeRepository.AttributeKeystoring the version if the server supports host-bound public key authentication.
-
-
Constructor Details
-
DefaultClientKexExtensionHandler
public DefaultClientKexExtensionHandler()
-
-
Method Details
-
isKexExtensionsAvailable
public boolean isKexExtensionsAvailable(Session session, KexExtensionHandler.AvailabilityPhase phase) throws IOException - Specified by:
isKexExtensionsAvailablein interfaceKexExtensionHandler- Parameters:
session- TheSessionabout to execute KEXphase- TheKexExtensionHandler.AvailabilityPhasehint as to why the query is being made- Returns:
truewhether to KEX extensions are supported/allowed for the session- Throws:
IOException- If failed to process the request
-
handleKexExtensionRequest
public boolean handleKexExtensionRequest(Session session, int index, int count, String name, byte[] data) throws IOException Description copied from interface:KexExtensionHandlerInvoked byKexExtensionHandler.handleKexExtensionsMessage(Session, Buffer)in order to handle a specific extension.- Specified by:
handleKexExtensionRequestin interfaceKexExtensionHandler- Parameters:
session- TheSessionthrough which the message was receivedindex- The 0-based extension indexcount- The total extensions in the messagename- The extension namedata- The extension data- Returns:
truewhether to proceed to the next extension or stop processing the rest- Throws:
IOException
-
handleServerSignatureAlgorithms
protected void handleServerSignatureAlgorithms(Session session, Collection<String> serverAlgorithms) Perform updates after a server-sig-algs extension has been received. The set of algorithms announced by the server is set as attributeSERVER_ALGORITHMSof thesession.- Parameters:
session- the message was received forserverAlgorithms- signature algorithm names announced by the server
-