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 /src/server.c | |
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 'src/server.c')
-rw-r--r-- | src/server.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server.c b/src/server.c index 14295fca..d34dee9d 100644 --- a/src/server.c +++ b/src/server.c @@ -166,7 +166,7 @@ int server_set_kex(ssh_session session) return -1; } - for (i = 0; i < 10; i++) { + for (i = 0; i < SSH_KEX_METHODS; i++) { wanted = session->opts.wanted_methods[i]; if (wanted == NULL) { if (ssh_fips_mode()) { @@ -195,7 +195,7 @@ int ssh_server_init_kex(ssh_session session) { } /* free any currently-set methods: server_set_kex will allocate new ones */ - for (i = 0; i < 10 /* SSH_KEX_METHODS */; i++) { + for (i = 0; i < SSH_KEX_METHODS; i++) { SAFE_FREE(session->next_crypto->server_kex.methods[i]); } |