version 1.296, 2018/07/27 05:34:42 |
version 1.297, 2018/08/12 20:19:13 |
|
|
|
|
#include "xmalloc.h" |
#include "xmalloc.h" |
#include "ssh.h" |
#include "ssh.h" |
|
#include "ssherr.h" |
#include "compat.h" |
#include "compat.h" |
#include "cipher.h" |
#include "cipher.h" |
#include "pathnames.h" |
#include "pathnames.h" |
|
|
fill_default_options(Options * options) |
fill_default_options(Options * options) |
{ |
{ |
char *all_cipher, *all_mac, *all_kex, *all_key; |
char *all_cipher, *all_mac, *all_kex, *all_key; |
|
int r; |
|
|
if (options->forward_agent == -1) |
if (options->forward_agent == -1) |
options->forward_agent = 0; |
options->forward_agent = 0; |
|
|
all_mac = mac_alg_list(','); |
all_mac = mac_alg_list(','); |
all_kex = kex_alg_list(','); |
all_kex = kex_alg_list(','); |
all_key = sshkey_alg_list(0, 0, 1, ','); |
all_key = sshkey_alg_list(0, 0, 1, ','); |
if (kex_assemble_names(&options->ciphers, |
#define ASSEMBLE(what, defaults, all) \ |
KEX_CLIENT_ENCRYPT, all_cipher) != 0 || |
do { \ |
kex_assemble_names(&options->macs, |
if ((r = kex_assemble_names(&options->what, \ |
KEX_CLIENT_MAC, all_mac) != 0 || |
defaults, all)) != 0) \ |
kex_assemble_names(&options->kex_algorithms, |
fatal("%s: %s: %s", __func__, #what, ssh_err(r)); \ |
KEX_CLIENT_KEX, all_kex) != 0 || |
} while (0) |
kex_assemble_names(&options->hostbased_key_types, |
ASSEMBLE(ciphers, KEX_SERVER_ENCRYPT, all_cipher); |
KEX_DEFAULT_PK_ALG, all_key) != 0 || |
ASSEMBLE(macs, KEX_SERVER_MAC, all_mac); |
kex_assemble_names(&options->pubkey_key_types, |
ASSEMBLE(kex_algorithms, KEX_SERVER_KEX, all_kex); |
KEX_DEFAULT_PK_ALG, all_key) != 0) |
ASSEMBLE(hostbased_key_types, KEX_DEFAULT_PK_ALG, all_key); |
fatal("%s: kex_assemble_names failed", __func__); |
ASSEMBLE(pubkey_key_types, KEX_DEFAULT_PK_ALG, all_key); |
|
#undef ASSEMBLE |
free(all_cipher); |
free(all_cipher); |
free(all_mac); |
free(all_mac); |
free(all_kex); |
free(all_kex); |