version 1.273, 2018/07/03 13:07:58 |
version 1.274, 2018/07/03 13:20:25 |
|
|
static char * |
static char * |
key_sig_algorithm(struct ssh *ssh, const struct sshkey *key) |
key_sig_algorithm(struct ssh *ssh, const struct sshkey *key) |
{ |
{ |
char *allowed, *oallowed, *cp, *alg = NULL; |
char *allowed, *oallowed, *cp, *tmp, *alg = NULL; |
|
|
/* |
/* |
* The signature algorithm will only differ from the key algorithm |
* The signature algorithm will only differ from the key algorithm |
|
|
while ((cp = strsep(&allowed, ",")) != NULL) { |
while ((cp = strsep(&allowed, ",")) != NULL) { |
if (sshkey_type_from_name(cp) != key->type) |
if (sshkey_type_from_name(cp) != key->type) |
continue; |
continue; |
alg = match_list(cp, ssh->kex->server_sig_algs, NULL); |
tmp = match_list(sshkey_sigalg_by_name(cp), ssh->kex->server_sig_algs, NULL); |
|
if (tmp != NULL) |
|
alg = xstrdup(cp); |
|
free(tmp); |
if (alg != NULL) |
if (alg != NULL) |
break; |
break; |
} |
} |