diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2017-08-24 17:44:33 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2017-08-24 18:01:41 +0200 |
commit | 4c602f225574d0da5833aa7ddf9bffe642046b7b (patch) | |
tree | f0aeade8b40da683817ebe62080e53f0f1ffcda9 /src/options.c | |
parent | 6803c2f86d5a8f419d854dbffb78c10fda611ed2 (diff) | |
download | libssh-4c602f225574d0da5833aa7ddf9bffe642046b7b.tar.gz libssh-4c602f225574d0da5833aa7ddf9bffe642046b7b.tar.xz libssh-4c602f225574d0da5833aa7ddf9bffe642046b7b.zip |
options: Use ssh_key_type_e in ssh_options_set_algo()
Review with 'git show -b'
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/options.c')
-rw-r--r-- | src/options.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/options.c b/src/options.c index f0e67783..9346b6d1 100644 --- a/src/options.c +++ b/src/options.c @@ -162,22 +162,24 @@ int ssh_options_copy(ssh_session src, ssh_session *dest) { return 0; } -int ssh_options_set_algo(ssh_session session, int algo, - const char *list) { - char *p = NULL; - - p = ssh_keep_known_algos(algo, list); - if (p == NULL) { - ssh_set_error(session, SSH_REQUEST_DENIED, - "Setting method: no algorithm for method \"%s\" (%s)", - ssh_kex_get_description(algo), list); - return -1; - } +int ssh_options_set_algo(ssh_session session, + enum ssh_kex_types_e algo, + const char *list) +{ + char *p = NULL; + + p = ssh_keep_known_algos(algo, list); + if (p == NULL) { + ssh_set_error(session, SSH_REQUEST_DENIED, + "Setting method: no algorithm for method \"%s\" (%s)", + ssh_kex_get_description(algo), list); + return -1; + } - SAFE_FREE(session->opts.wanted_methods[algo]); - session->opts.wanted_methods[algo] = p; + SAFE_FREE(session->opts.wanted_methods[algo]); + session->opts.wanted_methods[algo] = p; - return 0; + return 0; } /** |