mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
options: Add option to specify host keys string.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
2ed9d2160d
commit
ad24427f03
@@ -324,7 +324,8 @@ enum ssh_options_e {
|
|||||||
SSH_OPTIONS_STRICTHOSTKEYCHECK,
|
SSH_OPTIONS_STRICTHOSTKEYCHECK,
|
||||||
SSH_OPTIONS_COMPRESSION,
|
SSH_OPTIONS_COMPRESSION,
|
||||||
SSH_OPTIONS_COMPRESSION_LEVEL,
|
SSH_OPTIONS_COMPRESSION_LEVEL,
|
||||||
SSH_OPTIONS_KEY_EXCHANGE
|
SSH_OPTIONS_KEY_EXCHANGE,
|
||||||
|
SSH_OPTIONS_HOSTKEYS
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
|||||||
@@ -334,6 +334,11 @@ int ssh_options_set_algo(ssh_session session, int algo,
|
|||||||
* comma-separated list). ex:
|
* comma-separated list). ex:
|
||||||
* "ecdh-sha2-nistp256,diffie-hellman-group1-sha1"
|
* "ecdh-sha2-nistp256,diffie-hellman-group1-sha1"
|
||||||
*
|
*
|
||||||
|
* - SSH_OPTIONS_HOSTKEYS:
|
||||||
|
* Set the preferred server host key types (const char *,
|
||||||
|
* comma-separated list). ex:
|
||||||
|
* "ssh-rsa,ssh-dsa,ecdh-sha2-nistp256"
|
||||||
|
*
|
||||||
* - SSH_OPTIONS_COMPRESSION_C_S:
|
* - SSH_OPTIONS_COMPRESSION_C_S:
|
||||||
* Set the compression to use for client to server
|
* Set the compression to use for client to server
|
||||||
* communication (const char *, "yes", "no" or a specific
|
* communication (const char *, "yes", "no" or a specific
|
||||||
@@ -685,6 +690,16 @@ int ssh_options_set(ssh_session session, enum ssh_options_e type,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SSH_OPTIONS_HOSTKEYS:
|
||||||
|
v = value;
|
||||||
|
if (v == NULL || v[0] == '\0') {
|
||||||
|
ssh_set_error_invalid(session);
|
||||||
|
return -1;
|
||||||
|
} else {
|
||||||
|
if (ssh_options_set_algo(session, SSH_HOSTKEYS, v) < 0)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case SSH_OPTIONS_COMPRESSION_C_S:
|
case SSH_OPTIONS_COMPRESSION_C_S:
|
||||||
v = value;
|
v = value;
|
||||||
if (v == NULL || v[0] == '\0') {
|
if (v == NULL || v[0] == '\0') {
|
||||||
|
|||||||
Reference in New Issue
Block a user