comparison common-session.c @ 940:e9dfb6d15193

Fix auth timeout regression
author Matt Johnston <matt@ucc.asn.au>
date Wed, 09 Jul 2014 22:02:22 +0800
parents a0819ecfee0b
children 5daedffd0769
comparison
equal deleted inserted replaced
939:a0819ecfee0b 940:e9dfb6d15193
58 ses.sock_in = sock_in; 58 ses.sock_in = sock_in;
59 ses.sock_out = sock_out; 59 ses.sock_out = sock_out;
60 ses.maxfd = MAX(sock_in, sock_out); 60 ses.maxfd = MAX(sock_in, sock_out);
61 61
62 now = monotonic_now(); 62 now = monotonic_now();
63 ses.connect_time = now;
64 ses.last_packet_time_keepalive_recv = now; 63 ses.last_packet_time_keepalive_recv = now;
65 ses.last_packet_time_idle = now; 64 ses.last_packet_time_idle = now;
66 ses.last_packet_time_any_sent = 0; 65 ses.last_packet_time_any_sent = 0;
67 ses.last_packet_time_keepalive_sent = 0; 66 ses.last_packet_time_keepalive_sent = 0;
68 67
413 static void checktimeouts() { 412 static void checktimeouts() {
414 413
415 time_t now; 414 time_t now;
416 now = monotonic_now(); 415 now = monotonic_now();
417 416
418 if (now - ses.connect_time >= AUTH_TIMEOUT) {
419 dropbear_close("Timeout before auth");
420 }
421
422 /* we can't rekey if we haven't done remote ident exchange yet */ 417 /* we can't rekey if we haven't done remote ident exchange yet */
423 if (ses.remoteident == NULL) { 418 if (ses.remoteident == NULL) {
424 return; 419 return;
425 } 420 }
426 421