version 1.291, 2018/06/10 23:45:41 |
version 1.292, 2018/07/04 13:49:31 |
|
|
void |
void |
fill_default_options(Options * options) |
fill_default_options(Options * options) |
{ |
{ |
|
char *all_cipher, *all_mac, *all_kex, *all_key; |
|
|
if (options->forward_agent == -1) |
if (options->forward_agent == -1) |
options->forward_agent = 0; |
options->forward_agent = 0; |
if (options->forward_x11 == -1) |
if (options->forward_x11 == -1) |
|
|
options->fingerprint_hash = SSH_FP_HASH_DEFAULT; |
options->fingerprint_hash = SSH_FP_HASH_DEFAULT; |
if (options->update_hostkeys == -1) |
if (options->update_hostkeys == -1) |
options->update_hostkeys = 0; |
options->update_hostkeys = 0; |
if (kex_assemble_names(KEX_CLIENT_ENCRYPT, &options->ciphers) != 0 || |
|
kex_assemble_names(KEX_CLIENT_MAC, &options->macs) != 0 || |
/* Expand KEX name lists */ |
kex_assemble_names(KEX_CLIENT_KEX, &options->kex_algorithms) != 0 || |
all_cipher = cipher_alg_list(',', 0); |
kex_assemble_names(KEX_DEFAULT_PK_ALG, |
all_mac = mac_alg_list(','); |
&options->hostbased_key_types) != 0 || |
all_kex = kex_alg_list(','); |
kex_assemble_names(KEX_DEFAULT_PK_ALG, |
all_key = sshkey_alg_list(0, 0, 1, ','); |
&options->pubkey_key_types) != 0) |
if (kex_assemble_names(&options->ciphers, |
|
KEX_CLIENT_ENCRYPT, all_cipher) != 0 || |
|
kex_assemble_names(&options->macs, |
|
KEX_CLIENT_MAC, all_mac) != 0 || |
|
kex_assemble_names(&options->kex_algorithms, |
|
KEX_CLIENT_KEX, all_kex) != 0 || |
|
kex_assemble_names(&options->hostbased_key_types, |
|
KEX_DEFAULT_PK_ALG, all_key) != 0 || |
|
kex_assemble_names(&options->pubkey_key_types, |
|
KEX_DEFAULT_PK_ALG, all_key) != 0) |
fatal("%s: kex_assemble_names failed", __func__); |
fatal("%s: kex_assemble_names failed", __func__); |
|
free(all_cipher); |
|
free(all_mac); |
|
free(all_kex); |
|
free(all_key); |
|
|
#define CLEAR_ON_NONE(v) \ |
#define CLEAR_ON_NONE(v) \ |
do { \ |
do { \ |
|
|
dump_client_config(Options *o, const char *host) |
dump_client_config(Options *o, const char *host) |
{ |
{ |
int i; |
int i; |
char buf[8]; |
char buf[8], *all_key; |
|
|
/* This is normally prepared in ssh_kex2 */ |
/* This is normally prepared in ssh_kex2 */ |
if (kex_assemble_names(KEX_DEFAULT_PK_ALG, &o->hostkeyalgorithms) != 0) |
all_key = sshkey_alg_list(0, 0, 1, ','); |
|
if (kex_assemble_names( &o->hostkeyalgorithms, |
|
KEX_DEFAULT_PK_ALG, all_key) != 0) |
fatal("%s: kex_assemble_names failed", __func__); |
fatal("%s: kex_assemble_names failed", __func__); |
|
free(all_key); |
|
|
/* Most interesting options first: user, host, port */ |
/* Most interesting options first: user, host, port */ |
dump_cfg_string(oUser, o->user); |
dump_cfg_string(oUser, o->user); |