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
Modifier and TypeFieldDescriptionstatic final AttributeRepository.AttributeKey<Integer>
SessionAttributeRepository.AttributeKey
storing the version if the server supports host-bound public key authentication.static final DefaultClientKexExtensionHandler
Default singleton instance.static final AttributeRepository.AttributeKey<Set<String>>
SessionAttributeRepository.AttributeKey
storing the algorithms announced by the server as known.Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
handleKexExtensionRequest
(Session session, int index, int count, String name, byte[] data) Invoked byKexExtensionHandler.handleKexExtensionsMessage(Session, Buffer)
in order to handle a specific extension.protected void
handleServerSignatureAlgorithms
(Session session, Collection<String> serverAlgorithms) Perform updates after a server-sig-algs extension has been received.boolean
isKexExtensionsAvailable
(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 Details
-
INSTANCE
Default singleton instance. -
SERVER_ALGORITHMS
SessionAttributeRepository.AttributeKey
storing the algorithms announced by the server as known. -
HOSTBOUND_AUTHENTICATION
SessionAttributeRepository.AttributeKey
storing 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:
isKexExtensionsAvailable
in interfaceKexExtensionHandler
- Parameters:
session
- TheSession
about to execute KEXphase
- TheKexExtensionHandler.AvailabilityPhase
hint as to why the query is being made- Returns:
true
whether 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:KexExtensionHandler
Invoked byKexExtensionHandler.handleKexExtensionsMessage(Session, Buffer)
in order to handle a specific extension.- Specified by:
handleKexExtensionRequest
in interfaceKexExtensionHandler
- Parameters:
session
- TheSession
through which the message was receivedindex
- The 0-based extension indexcount
- The total extensions in the messagename
- The extension namedata
- The extension data- Returns:
true
whether 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_ALGORITHMS
of thesession
.- Parameters:
session
- the message was received forserverAlgorithms
- signature algorithm names announced by the server
-