Package org.apache.sshd.server.kex
Class DHGEXServer
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.common.kex.dh.AbstractDHKeyExchange
-
- org.apache.sshd.server.kex.AbstractDHServerKeyExchange
-
- org.apache.sshd.server.kex.DHGEXServer
-
- All Implemented Interfaces:
KeyExchange
,NamedResource
,SessionContextHolder
,SessionHolder<Session>
,ServerSessionHolder
public class DHGEXServer extends AbstractDHServerKeyExchange
- Author:
- Apache MINA SSHD Project
-
-
Field Summary
Fields Modifier and Type Field Description protected DHG
dh
protected byte
expected
protected DHFactory
factory
protected int
max
protected int
min
protected boolean
oldRequest
protected int
prf
static String
PROP_DHGEX_SERVER_MAX_KEY
static String
PROP_DHGEX_SERVER_MIN_KEY
-
Fields inherited from class org.apache.sshd.common.kex.dh.AbstractDHKeyExchange
e, f, h, hash, i_c, i_s, k, v_c, v_s
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Fields inherited from interface org.apache.sshd.common.kex.KeyExchange
GROUP_KEX_OPCODES_MAP, SIMPLE_KEX_OPCODES_MAP
-
Fields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DHGEXServer(DHFactory factory, Session session)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DHG
chooseDH(int min, int prf, int max)
protected DHG
getDH(BigInteger p, BigInteger g)
String
getName()
void
init(byte[] v_s, byte[] v_c, byte[] i_s, byte[] i_c)
Initialize the key exchange algorithm.protected List<Moduli.DhGroup>
loadModuliGroups()
static KeyExchangeFactory
newFactory(DHFactory factory)
boolean
next(int cmd, Buffer buffer)
Process the next packet-
Methods inherited from class org.apache.sshd.server.kex.AbstractDHServerKeyExchange
getServerKey, getServerSession
-
Methods inherited from class org.apache.sshd.common.kex.dh.AbstractDHKeyExchange
getH, getHash, getK, getSession, toString
-
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
getSimplifiedLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.session.SessionHolder
getSessionContext
-
-
-
-
Field Detail
-
PROP_DHGEX_SERVER_MIN_KEY
public static final String PROP_DHGEX_SERVER_MIN_KEY
- See Also:
- Constant Field Values
-
PROP_DHGEX_SERVER_MAX_KEY
public static final String PROP_DHGEX_SERVER_MAX_KEY
- See Also:
- Constant Field Values
-
factory
protected final DHFactory factory
-
dh
protected DHG dh
-
min
protected int min
-
prf
protected int prf
-
max
protected int max
-
expected
protected byte expected
-
oldRequest
protected boolean oldRequest
-
-
Method Detail
-
getName
public final String getName()
- Returns:
- The resource name
-
newFactory
public static KeyExchangeFactory newFactory(DHFactory factory)
-
init
public void init(byte[] v_s, byte[] v_c, byte[] i_s, byte[] i_c) throws Exception
Description copied from interface:KeyExchange
Initialize the key exchange algorithm.- Specified by:
init
in interfaceKeyExchange
- Overrides:
init
in classAbstractDHKeyExchange
- Parameters:
v_s
- the server identification stringv_c
- the client identification stringi_s
- the server key initialization packeti_c
- the client key initialization packet- Throws:
Exception
- if an error occurs
-
next
public boolean next(int cmd, Buffer buffer) throws Exception
Description copied from interface:KeyExchange
Process the next packet- Parameters:
cmd
- the commandbuffer
- the packet contents positioned after the command- Returns:
- a boolean indicating if the processing is complete or if more packets are to be received
- Throws:
Exception
- if an error occurs
-
loadModuliGroups
protected List<Moduli.DhGroup> loadModuliGroups() throws IOException
- Throws:
IOException
-
getDH
protected DHG getDH(BigInteger p, BigInteger g) throws Exception
- Throws:
Exception
-
-