mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-07 02:39:48 +09:00
feat: test null hostkey on ci
Signed-off-by: Gauravsingh Sisodia <xaerru@gmail.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Jakub Jelen
parent
d730b40b91
commit
fd1c3e8878
14
src/kex.c
14
src/kex.c
@@ -796,6 +796,8 @@ int ssh_set_client_kex(ssh_session session)
|
||||
const char *wanted = NULL;
|
||||
int ok;
|
||||
int i;
|
||||
bool gssapi_null_alg = false;
|
||||
char *hostkeys = NULL;
|
||||
|
||||
/* Skip if already set, for example for the rekey or when we do the guessing
|
||||
* it could have been already used to make some protocol decisions. */
|
||||
@@ -831,6 +833,9 @@ int ssh_set_client_kex(ssh_session session)
|
||||
/* Prefix the default algorithms with gsskex algs */
|
||||
session->opts.wanted_methods[SSH_KEX] =
|
||||
ssh_prefix_without_duplicates(default_methods[SSH_KEX], gssapi_algs);
|
||||
|
||||
gssapi_null_alg = true;
|
||||
|
||||
SAFE_FREE(gssapi_algs);
|
||||
}
|
||||
#endif
|
||||
@@ -847,6 +852,15 @@ int ssh_set_client_kex(ssh_session session)
|
||||
ssh_set_error_oom(session);
|
||||
return SSH_ERROR;
|
||||
}
|
||||
if (gssapi_null_alg) {
|
||||
hostkeys = ssh_append_without_duplicates(client->methods[i], "null");
|
||||
if (hostkeys == NULL) {
|
||||
ssh_set_error_oom(session);
|
||||
return SSH_ERROR;
|
||||
}
|
||||
SAFE_FREE(client->methods[i]);
|
||||
client->methods[i] = hostkeys;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user