fix: move ssh_gssapi_check_client_config() from ssh_options_set to ssh_options_apply

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:
Gauravsingh Sisodia
2025-08-08 11:48:38 +00:00
committed by Jakub Jelen
parent 5a99cf9c7f
commit 83114b636f

View File

@@ -1262,13 +1262,7 @@ int ssh_options_set(ssh_session session, enum ssh_options_e type,
return -1;
} else {
bool *x = (bool *)value;
rc = ssh_gssapi_check_client_config(session);
if (rc == SSH_OK) {
session->opts.gssapi_key_exchange = *x;
} else {
SSH_LOG(SSH_LOG_WARN, "Disabled GSSAPI key exchange");
session->opts.gssapi_key_exchange = false;
}
session->opts.gssapi_key_exchange = *x;
}
break;
case SSH_OPTIONS_GSSAPI_KEY_EXCHANGE_ALGS:
@@ -2147,6 +2141,16 @@ int ssh_options_apply(ssh_session session)
}
}
#ifdef WITH_GSSAPI
if (session->opts.gssapi_key_exchange) {
rc = ssh_gssapi_check_client_config(session);
if (rc != SSH_OK) {
SSH_LOG(SSH_LOG_WARN, "Disabled GSSAPI key exchange");
session->opts.gssapi_key_exchange = false;
}
}
#endif
return 0;
}