version 1.170, 2021/12/19 22:13:12 |
version 1.171, 2022/01/06 21:55:23 |
|
|
return (1); |
return (1); |
} |
} |
|
|
|
/* returns non-zero if proposal contains any algorithm from algs */ |
static int |
static int |
|
has_any_alg(const char *proposal, const char *algs) |
|
{ |
|
char *cp; |
|
|
|
if ((cp = match_list(proposal, algs, NULL)) == NULL) |
|
return 0; |
|
free(cp); |
|
return 1; |
|
} |
|
|
|
static int |
kex_choose_conf(struct ssh *ssh) |
kex_choose_conf(struct ssh *ssh) |
{ |
{ |
struct kex *kex = ssh->kex; |
struct kex *kex = ssh->kex; |
|
|
ext = match_list("ext-info-c", peer[PROPOSAL_KEX_ALGS], NULL); |
ext = match_list("ext-info-c", peer[PROPOSAL_KEX_ALGS], NULL); |
kex->ext_info_c = (ext != NULL); |
kex->ext_info_c = (ext != NULL); |
free(ext); |
free(ext); |
|
} |
|
|
|
/* Check whether client supports rsa-sha2 algorithms */ |
|
if (kex->server && (kex->flags & KEX_INITIAL)) { |
|
if (has_any_alg(peer[PROPOSAL_SERVER_HOST_KEY_ALGS], |
|
"rsa-sha2-256,rsa-sha2-256-cert-v01@openssh.com")) |
|
kex->flags |= KEX_RSA_SHA2_256_SUPPORTED; |
|
if (has_any_alg(peer[PROPOSAL_SERVER_HOST_KEY_ALGS], |
|
"rsa-sha2-512,rsa-sha2-512-cert-v01@openssh.com")) |
|
kex->flags |= KEX_RSA_SHA2_512_SUPPORTED; |
} |
} |
|
|
/* Algorithm Negotiation */ |
/* Algorithm Negotiation */ |