|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindbright.ssh2.SSH2Preferences
This class is a container for all protocol preferences and the
packet version used in the class SSH2Transport
. It can
be created using a hard-coded list of preferences or it can be
created from a java.util.Properties
instance. All
preferences for algorithms are comma separated lists in order of
preference (as defined in the trasport protocol spec.).
This class contains the negotiation logic to select preferences
from lists of client and server preferences. It also contains the
functionality to select a key exchange algorithm given the
available algorithms and host key types. These functions are used
from the SSH2Transport
class.
!!! TODO COMPLETE THIS LIST !!! The preferences that can be set are the following:
Property name | Description |
---|---|
kex-algorithms | Key exchange algorithms |
server-host-key-algorithms | Host key algorithms |
enc-algorithms-cli2srv | Encryption algorithms client to server |
enc-algorithms-srv2cli | Encryption algorithms server to client |
mac-algorithms-cli2srv | Mac algorithms client to server |
mac-algorithms-srv2cli | Mac algorithms server to client |
comp-algorithms-cli2srv | Compression algorithms client to server |
comp-algorithms-srv2cli | Compression algorithms server to client |
languages-cli2srv | Language tags client to server |
languages-srv2cli | Language tags server to client |
compression | Outgoing compression level 0-9 (default 6) |
package-version | Package version for protocol version string |
alive | Seconds between keepalive packets (default 0 = no keepalive packets sent) |
rx-init-win-sz | Initial receive window size |
rx-max-pkt-sz | Maximum size of packets we accept |
tx-max-pkt-sz | Maximum size of packets we send |
x11-displayt | X11 display MindTerm tries to connect to |
queued-rx-chan | Enable queuing on the receive channel |
default-pkt-sz | Default packet size |
pkt-pool-sz | Size of PDU pool |
term-min-lat | Use no-latency mode when writing to terminal |
int-in-buf-sz | Size of internal IO buffers |
queue-depth | Default depth of queues |
queue-hiwater | Highwater mark for queues |
log-level | Debug level 0-7 |
log-file | File to write debug messages to |
log-append | If "false" then the log-file is truncated |
The available algorithms are the following (provided their classes are included):
Type | Algorithms |
---|---|
Key exchange | diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1 |
Host key | ssh-dss,ssh-rsa |
Ciphers | 3des-cbc, 3des-ecb, 3des-cfb, 3des-ofb, 3des-ctr, blowfish-cbc, blowfish-ecb, blowfish-cfb, blowfish-ofb, blowfish-ctr, aes128-cbc, aes192-cbc, aes256-cbc, aes128-ctr, aes192-ctr, aes256-ctr, twofish128-cbc, twofish128-ctr, twofish192-cbc, twofish256-cbc, cast128-cbc, cast128-ecb, cast128-cfb, cast128-ofb, idea-cbc, idea-ecb, idea-cfb, idea-ofb, arcfour | Macs | hmac-sha1,hmac-md5,hmac-ripemd160,hmac-sha1-96,hmac-md5-96,hmac-ripemd160-96 |
SSH2Transport
,
SSH2Connection
Field Summary | |
static java.lang.String |
ALIVE
|
static java.lang.String |
CIPHERS_C2S
|
static java.lang.String |
CIPHERS_S2C
|
static java.lang.String |
COMP_C2S
|
static java.lang.String |
COMP_LEVEL
|
static java.lang.String |
COMP_S2C
|
static java.lang.String |
DEFAULT_PKT_SZ
Misc internal preferences |
static java.lang.String |
HOST_KEY_ALG
|
static java.lang.String |
INT_IO_BUF_SZ
|
static java.lang.String |
KEX_ALGORITHMS
Transport layer preferences |
static java.lang.String |
LANG_C2S
|
static java.lang.String |
LANG_S2C
|
static java.lang.String |
LOG_APPEND
|
static java.lang.String |
LOG_FILE
|
static java.lang.String |
LOG_LEVEL
|
static java.lang.String |
MACS_C2S
|
static java.lang.String |
MACS_S2C
|
static java.lang.String |
PKG_VERSION
|
static java.lang.String |
PKT_POOL_SZ
|
static java.lang.String |
QUEUE_DEPTH
|
static java.lang.String |
QUEUE_HIWATER
|
static java.lang.String |
QUEUED_RX_CHAN
|
static java.lang.String |
RX_INIT_WIN_SZ
Connection layer preferences |
static java.lang.String |
RX_MAX_PKT_SZ
|
static java.lang.String |
SO_TCP_NODELAY
|
static java.lang.String |
SOCK_OPT
Socket option preferences Examples: Enable TCP_NODELAY for the socket connected to the server: socketoption.transport.tcp-nodelay = true Enable TCP_NODELAY for all sockets to local forward '127.0.0.1:4711': socketoption.local.127.0.0.1.4711.tcp-nodelay = true |
static java.lang.String |
SOCK_OPT_LOCAL
|
static java.lang.String |
SOCK_OPT_REMOTE
|
static java.lang.String |
SOCK_OPT_TRANSPORT
|
static java.lang.String |
TERM_MIN_LAT
|
static java.lang.String |
TX_MAX_PKT_SZ
|
static java.lang.String |
X11_DISPLAY
|
Constructor Summary | |
SSH2Preferences()
|
|
SSH2Preferences(java.util.Properties props)
|
Method Summary | |
boolean |
canAgree(SSH2Preferences peerPrefs,
boolean weAreAServer)
|
java.lang.String |
getAgreedCipher(boolean transmitter,
boolean weAreAServer)
|
java.lang.String |
getAgreedCompression(boolean transmitter,
boolean weAreAServer)
|
java.lang.String |
getAgreedHostKeyAlgorithm()
|
java.lang.String |
getAgreedKEXAlgorithm()
|
java.lang.String |
getAgreedMac(boolean transmitter,
boolean weAreAServer)
|
static int |
getCipherKeyLen(java.lang.String cipherName)
|
static java.util.Properties |
getDefaultProperties()
|
java.lang.String |
getDisagreeType()
|
int |
getIntPreference(java.lang.String type)
|
static int |
getMacKeyLen(java.lang.String macName)
|
java.lang.String |
getPreference(java.lang.String type)
|
boolean |
isSupported(java.lang.String type,
java.lang.String item)
|
void |
readFrom(SSH2TransportPDU pdu)
|
boolean |
sameKEXGuess()
|
SSH2KeyExchanger |
selectKEXAlgorithm(SSH2Preferences peerPrefs,
boolean weAreAServer)
|
void |
setPreference(java.lang.String type,
java.lang.String value)
|
static java.lang.String |
ssh2ToJCECipher(java.lang.String prefCipher)
|
static java.lang.String |
ssh2ToJCEMac(java.lang.String prefMac)
|
void |
writeTo(SSH2TransportPDU pdu)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String PKG_VERSION
public static final java.lang.String KEX_ALGORITHMS
public static final java.lang.String HOST_KEY_ALG
public static final java.lang.String CIPHERS_C2S
public static final java.lang.String CIPHERS_S2C
public static final java.lang.String MACS_C2S
public static final java.lang.String MACS_S2C
public static final java.lang.String COMP_C2S
public static final java.lang.String COMP_S2C
public static final java.lang.String LANG_C2S
public static final java.lang.String LANG_S2C
public static final java.lang.String COMP_LEVEL
public static final java.lang.String ALIVE
public static final java.lang.String RX_INIT_WIN_SZ
public static final java.lang.String RX_MAX_PKT_SZ
public static final java.lang.String TX_MAX_PKT_SZ
public static final java.lang.String X11_DISPLAY
public static final java.lang.String QUEUED_RX_CHAN
public static final java.lang.String DEFAULT_PKT_SZ
public static final java.lang.String PKT_POOL_SZ
public static final java.lang.String TERM_MIN_LAT
public static final java.lang.String INT_IO_BUF_SZ
public static final java.lang.String QUEUE_DEPTH
public static final java.lang.String QUEUE_HIWATER
public static final java.lang.String LOG_LEVEL
public static final java.lang.String LOG_FILE
public static final java.lang.String LOG_APPEND
public static final java.lang.String SOCK_OPT
public static final java.lang.String SOCK_OPT_TRANSPORT
public static final java.lang.String SOCK_OPT_LOCAL
public static final java.lang.String SOCK_OPT_REMOTE
public static final java.lang.String SO_TCP_NODELAY
Constructor Detail |
public SSH2Preferences()
public SSH2Preferences(java.util.Properties props)
Method Detail |
public static java.util.Properties getDefaultProperties()
public void readFrom(SSH2TransportPDU pdu)
public void writeTo(SSH2TransportPDU pdu)
public java.lang.String getPreference(java.lang.String type)
public int getIntPreference(java.lang.String type)
public void setPreference(java.lang.String type, java.lang.String value)
public java.lang.String getAgreedKEXAlgorithm()
public java.lang.String getAgreedHostKeyAlgorithm()
public java.lang.String getAgreedCipher(boolean transmitter, boolean weAreAServer)
public java.lang.String getAgreedMac(boolean transmitter, boolean weAreAServer)
public java.lang.String getAgreedCompression(boolean transmitter, boolean weAreAServer)
public boolean isSupported(java.lang.String type, java.lang.String item)
public SSH2KeyExchanger selectKEXAlgorithm(SSH2Preferences peerPrefs, boolean weAreAServer) throws SSH2KEXFailedException
SSH2KEXFailedException
public boolean sameKEXGuess()
public boolean canAgree(SSH2Preferences peerPrefs, boolean weAreAServer)
public java.lang.String getDisagreeType()
public static java.lang.String ssh2ToJCECipher(java.lang.String prefCipher)
public static java.lang.String ssh2ToJCEMac(java.lang.String prefMac)
public static int getCipherKeyLen(java.lang.String cipherName)
public static int getMacKeyLen(java.lang.String macName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |