public class DefaultServerKexExtensionHandler extends AbstractLoggingBean implements KexExtensionHandler
KexExtensionHandler handling the
ServerSignatureAlgorithms KEX extension.KexExtensionHandler.AvailabilityPhase, KexExtensionHandler.KexPhase| Modifier and Type | Field and Description |
|---|---|
static AttributeRepository.AttributeKey<Boolean> |
CLIENT_REQUESTED_EXT_INFO
Session
AttributeRepository.AttributeKey storing whether the client requested to get the EXT_INFO message. |
static AttributeRepository.AttributeKey<Boolean> |
EXT_INFO_SENT_AT_NEWKEYS
Session
AttributeRepository.AttributeKey storing whether the server sent an EXT_INFO message at KexPhase#NEWKEYS. |
static DefaultServerKexExtensionHandler |
INSTANCE
Default singleton instance.
|
log| Constructor and Description |
|---|
DefaultServerKexExtensionHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
collectExtensions(Session session,
KexExtensionHandler.KexPhase phase,
BiConsumer<String,Object> marshaller)
Collects extension info records, handing them off to the given
marshaller for writing into an
KexExtensions.SSH_MSG_EXT_INFO message. |
void |
handleKexInitProposal(Session session,
boolean initiator,
Map<KexProposalOption,String> proposal)
Invoked when a peer is ready to send the KEX options proposal or has received such a proposal.
|
void |
sendKexExtensions(Session session,
KexExtensionHandler.KexPhase phase)
Invoked in order to allow the handler to send an
SSH_MSG_EXT_INFO message. |
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithandleKexCompressionMessage, handleKexExtensionNegotiation, handleKexExtensionRequest, handleKexExtensionsMessage, isKexExtensionsAvailablepublic static final DefaultServerKexExtensionHandler INSTANCE
public static final AttributeRepository.AttributeKey<Boolean> CLIENT_REQUESTED_EXT_INFO
AttributeRepository.AttributeKey storing whether the client requested to get the EXT_INFO message. Possible values
are:
nullBoolean.TRUEBoolean.FALSEpublic static final AttributeRepository.AttributeKey<Boolean> EXT_INFO_SENT_AT_NEWKEYS
AttributeRepository.AttributeKey storing whether the server sent an EXT_INFO message at KexPhase#NEWKEYS. A
server is supposed to send the message at that point only on the very first NEWKEYS message. Possible values are:
null or Boolean.FALSEKexPhase#NEWKEYS was not done yet.Boolean.TRUEKexPhase#NEWKEYS was done.public void handleKexInitProposal(Session session, boolean initiator, Map<KexProposalOption,String> proposal) throws Exception
KexExtensionHandlerisKexExtensionsAvailable returns false for
the session.handleKexInitProposal in interface KexExtensionHandlersession - The Session initiating or receiving the proposalinitiator - true if the proposal is about to be sent, false if this is a proposal received
from the peer.proposal - The proposal contents - Caveat emptor: the proposal is modifiable i.e., the
handler can modify it before being sent or before being processed (if incoming)Exception - If failed to handle the requestpublic void sendKexExtensions(Session session, KexExtensionHandler.KexPhase phase) throws Exception
KexExtensionHandlerSSH_MSG_EXT_INFO message. Note: this method is
called only if isKexExtensionsAvailable returns true for the session.sendKexExtensions in interface KexExtensionHandlersession - The Sessionphase - The phase at which the handler is invokedException - If failed to handle the invocationpublic void collectExtensions(Session session, KexExtensionHandler.KexPhase phase, BiConsumer<String,Object> marshaller)
marshaller for writing into an
KexExtensions.SSH_MSG_EXT_INFO message.
This default implementation marshals a ServerSignatureAlgorithms extension if the phase is
KexPhase#NEWKEYS.
session - Session to send the KEX extension information forphase - KexPhase of the SSH protocolmarshaller - BiConsumer writing the extensions into an SSH messageCopyright © 2008–2024 The Apache Software Foundation. All rights reserved.