mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
tests: Avoid prefix matching when selecting algorithmms
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Sahana Prasad <sahana@redhat.com>
This commit is contained in:
@@ -858,6 +858,7 @@ static void torture_rekey_guess_all_combinations(void **state)
|
|||||||
const char *supported = NULL;
|
const char *supported = NULL;
|
||||||
struct ssh_tokens_st *s_tok = NULL;
|
struct ssh_tokens_st *s_tok = NULL;
|
||||||
uint64_t rekey_limit = 0;
|
uint64_t rekey_limit = 0;
|
||||||
|
char *p = NULL;
|
||||||
int rc, i, j;
|
int rc, i, j;
|
||||||
|
|
||||||
/* The rekey limit is 1/2 of the transferred file size so we will likely get
|
/* The rekey limit is 1/2 of the transferred file size so we will likely get
|
||||||
@@ -875,8 +876,12 @@ static void torture_rekey_guess_all_combinations(void **state)
|
|||||||
s_tok = ssh_tokenize(supported, ',');
|
s_tok = ssh_tokenize(supported, ',');
|
||||||
assert_non_null(s_tok);
|
assert_non_null(s_tok);
|
||||||
for (i = 0; s_tok->tokens[i]; i++) {
|
for (i = 0; s_tok->tokens[i]; i++) {
|
||||||
/* Skip algorithms not supported by the OpenSSH server */
|
/* Skip algorithms not supported by the OpenSSH server.
|
||||||
if (strstr(OPENSSH_KEX, s_tok->tokens[i]) == NULL) {
|
* Check also for prefix matches to distinguish vendor-specific names
|
||||||
|
* such as sntrup761x25519-sha512 and the @openssh.com alias */
|
||||||
|
if ((p = strstr(OPENSSH_KEX, s_tok->tokens[i])) == NULL ||
|
||||||
|
(*(p + strlen(s_tok->tokens[i])) != ',' &&
|
||||||
|
*(p + strlen(s_tok->tokens[i])) != '\0')) {
|
||||||
SSH_LOG(SSH_LOG_INFO, "Server: %s [skipping]", s_tok->tokens[i]);
|
SSH_LOG(SSH_LOG_INFO, "Server: %s [skipping]", s_tok->tokens[i]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user