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, warn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handleKexCompressionMessage, handleKexExtensionNegotiation, handleKexExtensionRequest, handleKexExtensionsMessage, isKexExtensionsAvailable
public 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:
null
Boolean.TRUE
Boolean.FALSE
public 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.FALSE
KexPhase#NEWKEYS
was not done yet.Boolean.TRUE
KexPhase#NEWKEYS
was done.public void handleKexInitProposal(Session session, boolean initiator, Map<KexProposalOption,String> proposal) throws Exception
KexExtensionHandler
isKexExtensionsAvailable
returns false
for
the session.handleKexInitProposal
in interface KexExtensionHandler
session
- 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
KexExtensionHandler
SSH_MSG_EXT_INFO
message. Note: this method is
called only if isKexExtensionsAvailable
returns true
for the session.sendKexExtensions
in interface KexExtensionHandler
session
- The Session
phase
- 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.