mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-06 10:27:22 +09:00
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>
(cherry picked from commit c8a621c606)
This commit is contained in:
committed by
Andreas Schneider
parent
7856ae594b
commit
ab24d64241
@@ -154,7 +154,7 @@ int ssh_options_copy(ssh_session src, ssh_session *dest)
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
for (i = 0; i < SSH_KEX_METHODS; i++) {
|
||||
if (src->opts.wanted_methods[i] != NULL) {
|
||||
new->opts.wanted_methods[i] = strdup(src->opts.wanted_methods[i]);
|
||||
if (new->opts.wanted_methods[i] == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user