diff options
author | Matt Johnston <matt@ucc.asn.au> | 2013-04-01 00:13:41 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2013-04-01 00:13:41 +0800 |
commit | e5072c6b120b49571f6bf0a989e1d8dc505a1cd9 (patch) | |
tree | 2fabadfdad839aa14943c8ce83d71d5fc846e673 /cli-session.c | |
parent | 32294978a32d666f771c5df324820c43bb733f55 (diff) | |
parent | 90cf7f012cdc6143752464bc9bb2b4a9f94f7132 (diff) |
merge from head roundtrip changes
--HG--
branch : kexguess
Diffstat (limited to 'cli-session.c')
-rw-r--r-- | cli-session.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/cli-session.c b/cli-session.c index c5252b5..600827f 100644 --- a/cli-session.c +++ b/cli-session.c @@ -41,6 +41,7 @@ static void cli_remoteclosed(); static void cli_sessionloop(); static void cli_session_init(); static void cli_finished(); +static void recv_msg_service_accept(void); struct clientsession cli_ses; /* GLOBAL */ @@ -158,11 +159,28 @@ static void cli_session_init() { } +static void send_msg_service_request(char* servicename) { + + TRACE(("enter send_msg_service_request: servicename='%s'", servicename)) + + CHECKCLEARTOWRITE(); + + buf_putbyte(ses.writepayload, SSH_MSG_SERVICE_REQUEST); + buf_putstring(ses.writepayload, servicename, strlen(servicename)); + + encrypt_packet(); + TRACE(("leave send_msg_service_request")) +} + +static void recv_msg_service_accept(void) { + // do nothing, if it failed then the server MUST have disconnected +} + /* This function drives the progress of the session - it initiates KEX, * service, userauth and channel requests */ static void cli_sessionloop() { - TRACE(("enter cli_sessionloop")) + TRACE2(("enter cli_sessionloop")) if (ses.lastpacket == SSH_MSG_KEXINIT && cli_ses.kex_state == KEX_NOTHING) { /* We initiate the KEXDH. If DH wasn't the correct type, the KEXINIT @@ -201,12 +219,6 @@ static void cli_sessionloop() { /* We've got the transport layer sorted, we now need to request * userauth */ send_msg_service_request(SSH_SERVICE_USERAUTH); - cli_ses.state = SERVICE_AUTH_REQ_SENT; - TRACE(("leave cli_sessionloop: sent userauth service req")) - return; - - /* userauth code */ - case SERVICE_AUTH_ACCEPT_RCVD: cli_auth_getmethods(); cli_ses.state = USERAUTH_REQ_SENT; TRACE(("leave cli_sessionloop: sent userauth methods req")) @@ -280,7 +292,7 @@ static void cli_sessionloop() { break; } - TRACE(("leave cli_sessionloop: fell out")) + TRACE2(("leave cli_sessionloop: fell out")) } |