mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 18:04:25 +09:00
dh: move state changes inside DH code
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
9c88769707
commit
154eb91914
@@ -274,7 +274,6 @@ static int dh_handshake(ssh_session session) {
|
|||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
session->dh_handshake_state = DH_STATE_INIT_SENT;
|
|
||||||
case DH_STATE_INIT_SENT:
|
case DH_STATE_INIT_SENT:
|
||||||
/* wait until ssh_packet_dh_reply is called */
|
/* wait until ssh_packet_dh_reply is called */
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ int ssh_client_curve25519_init(ssh_session session){
|
|||||||
}
|
}
|
||||||
/* register the packet callbacks */
|
/* register the packet callbacks */
|
||||||
ssh_packet_set_callbacks(session, &ssh_curve25519_client_callbacks);
|
ssh_packet_set_callbacks(session, &ssh_curve25519_client_callbacks);
|
||||||
|
session->dh_handshake_state = DH_STATE_INIT_SENT;
|
||||||
rc = ssh_packet_send(session);
|
rc = ssh_packet_send(session);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
|||||||
1
src/dh.c
1
src/dh.c
@@ -516,6 +516,7 @@ int ssh_client_dh_init(ssh_session session){
|
|||||||
|
|
||||||
/* register the packet callbacks */
|
/* register the packet callbacks */
|
||||||
ssh_packet_set_callbacks(session, &ssh_dh_client_callbacks);
|
ssh_packet_set_callbacks(session, &ssh_dh_client_callbacks);
|
||||||
|
session->dh_handshake_state = DH_STATE_INIT_SENT;
|
||||||
|
|
||||||
rc = ssh_packet_send(session);
|
rc = ssh_packet_send(session);
|
||||||
return rc;
|
return rc;
|
||||||
|
|||||||
Reference in New Issue
Block a user