aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2017-08-24 17:43:01 +0200
committerAndreas Schneider <asn@cryptomilk.org>2017-08-24 18:01:41 +0200
commit6803c2f86d5a8f419d854dbffb78c10fda611ed2 (patch)
tree637bb1b4f8fc6943a4725d114579c4a49b2375e3 /src
parent316ee071cf4bd06a8cdeeaac417e137be0a3af0e (diff)
downloadlibssh-6803c2f86d5a8f419d854dbffb78c10fda611ed2.tar.gz
libssh-6803c2f86d5a8f419d854dbffb78c10fda611ed2.tar.xz
libssh-6803c2f86d5a8f419d854dbffb78c10fda611ed2.zip
kex: Use ssh_kex_types_e in ssh_verify_existing_algo()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src')
-rw-r--r--src/kex.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/kex.c b/src/kex.c
index 196f1b5e..9c60fbd5 100644
--- a/src/kex.c
+++ b/src/kex.c
@@ -721,10 +721,14 @@ error:
}
/* returns 1 if at least one of the name algos is in the default algorithms table */
-int ssh_verify_existing_algo(int algo, const char *name){
+int ssh_verify_existing_algo(enum ssh_kex_types_e algo, const char *name)
+{
char *ptr;
- if(algo>9 || algo <0)
+
+ if (algo > SSH_LANG_S_C) {
return -1;
+ }
+
ptr=ssh_find_matching(supported_methods[algo],name);
if(ptr){
free(ptr);