diff options
author | Jakub Jelen <jjelen@redhat.com> | 2019-11-01 14:59:27 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-11-18 11:59:01 +0100 |
commit | c8a621c6063f205e631d83a8ccd4befc60056e93 (patch) | |
tree | a22b2067f408fb2b8d9dadfd0bb3b4d84dc785f6 /include/libssh | |
parent | ec67ad47ebe200ad8a6b508e8ca061a073a3fde1 (diff) | |
download | libssh-c8a621c6063f205e631d83a8ccd4befc60056e93.tar.gz libssh-c8a621c6063f205e631d83a8ccd4befc60056e93.tar.xz libssh-c8a621c6063f205e631d83a8ccd4befc60056e93.zip |
Use only one variable denoting the size of methods arrays
Previously, there was non-consistent usage of constans SSH_KEX_METHODS,
KEX_METHODS_SIZE and of magic number 10 to reference the arrays used
for algorithm negotiation by peers. This commit settles down to the single
constant and its usage throughout the whole codebase.
Fixes T195
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'include/libssh')
-rw-r--r-- | include/libssh/bind.h | 3 | ||||
-rw-r--r-- | include/libssh/session.h | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/include/libssh/bind.h b/include/libssh/bind.h index 4ca23760..6b5f19dd 100644 --- a/include/libssh/bind.h +++ b/include/libssh/bind.h @@ -22,6 +22,7 @@ #define BIND_H_ #include "libssh/priv.h" +#include "libssh/kex.h" #include "libssh/session.h" struct ssh_bind_struct { @@ -31,7 +32,7 @@ struct ssh_bind_struct { struct ssh_poll_handle_struct *poll; /* options */ - char *wanted_methods[10]; + char *wanted_methods[SSH_KEX_METHODS]; char *banner; char *ecdsakey; char *dsakey; diff --git a/include/libssh/session.h b/include/libssh/session.h index af02237d..22256150 100644 --- a/include/libssh/session.h +++ b/include/libssh/session.h @@ -213,7 +213,7 @@ struct ssh_session_struct { char *sshdir; char *knownhosts; char *global_knownhosts; - char *wanted_methods[10]; + char *wanted_methods[SSH_KEX_METHODS]; char *pubkey_accepted_types; char *ProxyCommand; char *custombanner; |