mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 18:50:28 +09:00
client: Reformat ssh_client_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:
committed by
Andreas Schneider
parent
a29d28d1f6
commit
82850b6ed1
13
src/client.c
13
src/client.c
@@ -405,8 +405,7 @@ static void ssh_client_connection_callback(ssh_session session)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
set_status(session, 0.4f);
|
set_status(session, 0.4f);
|
||||||
SSH_LOG(SSH_LOG_DEBUG,
|
SSH_LOG(SSH_LOG_DEBUG, "SSH server banner: %s", session->serverbanner);
|
||||||
"SSH server banner: %s", session->serverbanner);
|
|
||||||
|
|
||||||
/* Here we analyze the different protocols the server allows. */
|
/* Here we analyze the different protocols the server allows. */
|
||||||
rc = ssh_analyze_banner(session, 0);
|
rc = ssh_analyze_banner(session, 0);
|
||||||
@@ -439,7 +438,7 @@ static void ssh_client_connection_callback(ssh_session session)
|
|||||||
set_status(session, 0.6f);
|
set_status(session, 0.6f);
|
||||||
ssh_list_kex(&session->next_crypto->server_kex);
|
ssh_list_kex(&session->next_crypto->server_kex);
|
||||||
if (session->next_crypto->client_kex.methods[0] == NULL) {
|
if (session->next_crypto->client_kex.methods[0] == NULL) {
|
||||||
/* in rekeying state if next_crypto client_kex is empty */
|
/* in rekeying state if next_crypto client_kex might be empty */
|
||||||
rc = ssh_set_client_kex(session);
|
rc = ssh_set_client_kex(session);
|
||||||
if (rc != SSH_OK) {
|
if (rc != SSH_OK) {
|
||||||
goto error;
|
goto error;
|
||||||
@@ -461,18 +460,20 @@ static void ssh_client_connection_callback(ssh_session session)
|
|||||||
if (session->dh_handshake_state == DH_STATE_FINISHED) {
|
if (session->dh_handshake_state == DH_STATE_FINISHED) {
|
||||||
set_status(session, 1.0f);
|
set_status(session, 1.0f);
|
||||||
session->connected = 1;
|
session->connected = 1;
|
||||||
if (session->flags & SSH_SESSION_FLAG_AUTHENTICATED)
|
if (session->flags & SSH_SESSION_FLAG_AUTHENTICATED) {
|
||||||
session->session_state = SSH_SESSION_STATE_AUTHENTICATED;
|
session->session_state = SSH_SESSION_STATE_AUTHENTICATED;
|
||||||
else
|
} else {
|
||||||
session->session_state = SSH_SESSION_STATE_AUTHENTICATING;
|
session->session_state = SSH_SESSION_STATE_AUTHENTICATING;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case SSH_SESSION_STATE_AUTHENTICATING:
|
case SSH_SESSION_STATE_AUTHENTICATING:
|
||||||
break;
|
break;
|
||||||
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;
|
||||||
|
|||||||
Reference in New Issue
Block a user