1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-13 04:42:23 +03:00

server: Reformat ssh_server_connection_callback

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Norbert Pocs <npocs@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2023-03-14 11:25:16 +01:00
parent d726eca7d2
commit 41c63fa88d

View File

@@ -335,7 +335,8 @@ ssh_get_key_params(ssh_session session,
* @brief A function to be called each time a step has been done in the * @brief A function to be called each time a step has been done in the
* connection. * connection.
*/ */
static void ssh_server_connection_callback(ssh_session session){ static void ssh_server_connection_callback(ssh_session session)
{
int rc; int rc;
switch (session->session_state) { switch (session->session_state) {
@@ -406,15 +407,16 @@ static void ssh_server_connection_callback(ssh_session session){
*/ */
if (session->extensions & SSH_EXT_NEGOTIATION && if (session->extensions & SSH_EXT_NEGOTIATION &&
session->session_state != SSH_SESSION_STATE_AUTHENTICATED) { session->session_state != SSH_SESSION_STATE_AUTHENTICATED) {
/* /*
* Only send an SSH_MSG_EXT_INFO message the first time the client * Only send an SSH_MSG_EXT_INFO message the first time the
* undergoes NEWKEYS. It is unexpected for this message to be sent * client undergoes NEWKEYS. It is unexpected for this message
* upon rekey, and may cause clients to log error messages. * to be sent upon rekey, and may cause clients to log error
* messages.
* *
* The session_state can not be used for this purpose because it is * The session_state can not be used for this purpose because it
* re-set to SSH_SESSION_STATE_KEXINIT_RECEIVED during rekey. So, * is re-set to SSH_SESSION_STATE_KEXINIT_RECEIVED during rekey.
* use the connected flag which transitions from non-zero below. * So, use the connected flag which transitions from non-zero
* below.
* *
* See also: * See also:
* - https://bugzilla.mindrot.org/show_bug.cgi?id=2929 * - https://bugzilla.mindrot.org/show_bug.cgi?id=2929
@@ -437,7 +439,8 @@ static void ssh_server_connection_callback(ssh_session session){
case SSH_SESSION_STATE_ERROR: case SSH_SESSION_STATE_ERROR:
goto error; goto error;
default: default:
ssh_set_error(session,SSH_FATAL,"Invalid state %d",session->session_state); ssh_set_error(session, SSH_FATAL, "Invalid state %d",
session->session_state);
} }
return; return;