summaryrefslogtreecommitdiffhomepage
path: root/common-session.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2015-08-03 21:59:40 +0800
committerMatt Johnston <matt@ucc.asn.au>2015-08-03 21:59:40 +0800
commitce59260ee9701d975baa4833534f1aedea6ba228 (patch)
treeac69e7fcd1e19abed7a4287599dc121e3c600670 /common-session.c
parent387ebccf369be1d5bcc4ed810ada8f7e0c62aba3 (diff)
Fix problem where auth timeout wasn't checked when waiting for ident
Diffstat (limited to 'common-session.c')
-rw-r--r--common-session.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common-session.c b/common-session.c
index 8ec7516..f2ccdf7 100644
--- a/common-session.c
+++ b/common-session.c
@@ -76,6 +76,7 @@ void common_session_init(int sock_in, int sock_out) {
update_channel_prio();
now = monotonic_now();
+ ses.connect_time = now;
ses.last_packet_time_keepalive_recv = now;
ses.last_packet_time_idle = now;
ses.last_packet_time_any_sent = 0;
@@ -486,6 +487,11 @@ static void checktimeouts() {
time_t now;
now = monotonic_now();
+ if (IS_DROPBEAR_SERVER && ses.connect_time != 0
+ && now - ses.connect_time >= AUTH_TIMEOUT) {
+ dropbear_close("Timeout before auth");
+ }
+
/* we can't rekey if we haven't done remote ident exchange yet */
if (ses.remoteident == NULL) {
return;