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).- Author:
- Apache MINA SSHD Project
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.sshd.common.kex.extension.KexExtensionHandler
KexExtensionHandler.AvailabilityPhase, KexExtensionHandler.KexPhase
-
-
Field Summary
Fields Modifier and Type Field Description static AttributeRepository.AttributeKey<Integer>HOSTBOUND_AUTHENTICATIONSessionAttributeRepository.AttributeKeystoring the version if the server supports host-bound public key authentication.static DefaultClientKexExtensionHandlerINSTANCEDefault singleton instance.static AttributeRepository.AttributeKey<Set<String>>SERVER_ALGORITHMSSessionAttributeRepository.AttributeKeystoring the algorithms announced by the server as known.-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
-
Constructor Summary
Constructors Constructor Description DefaultClientKexExtensionHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhandleKexExtensionRequest(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, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.kex.extension.KexExtensionHandler
handleKexCompressionMessage, handleKexExtensionNegotiation, handleKexExtensionsMessage, handleKexInitProposal, sendKexExtensions
-
-
-
-
Field Detail
-
INSTANCE
public static final DefaultClientKexExtensionHandler INSTANCE
Default singleton instance.
-
SERVER_ALGORITHMS
public static final AttributeRepository.AttributeKey<Set<String>> SERVER_ALGORITHMS
SessionAttributeRepository.AttributeKeystoring the algorithms announced by the server as known.
-
HOSTBOUND_AUTHENTICATION
public static final AttributeRepository.AttributeKey<Integer> HOSTBOUND_AUTHENTICATION
SessionAttributeRepository.AttributeKeystoring the version if the server supports host-bound public key authentication.
-
-
Method Detail
-
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
-
-