mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 18:04:25 +09:00
CVE-2023-48795: Strip extensions from both kex lists for matching
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
0870c8db28
commit
5846e57538
16
src/kex.c
16
src/kex.c
@@ -961,11 +961,19 @@ int ssh_kex_select_methods (ssh_session session)
|
|||||||
enum ssh_key_exchange_e kex_type;
|
enum ssh_key_exchange_e kex_type;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Here we should drop the ext-info-c from the list so we avoid matching.
|
/* Here we should drop the extensions from the list so we avoid matching.
|
||||||
* it. We added it to the end, so we can just truncate the string here */
|
* it. We added it to the end, so we can just truncate the string here */
|
||||||
ext_start = strstr(client->methods[SSH_KEX], ","KEX_EXTENSION_CLIENT);
|
if (session->client) {
|
||||||
if (ext_start != NULL) {
|
ext_start = strstr(client->methods[SSH_KEX], "," KEX_EXTENSION_CLIENT);
|
||||||
ext_start[0] = '\0';
|
if (ext_start != NULL) {
|
||||||
|
ext_start[0] = '\0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (session->server) {
|
||||||
|
ext_start = strstr(server->methods[SSH_KEX], "," KEX_STRICT_SERVER);
|
||||||
|
if (ext_start != NULL) {
|
||||||
|
ext_start[0] = '\0';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < SSH_KEX_METHODS; i++) {
|
for (i = 0; i < SSH_KEX_METHODS; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user