diff common-session.c @ 1139:43a8ea69b24c

Fix problem where auth timeout wasn't checked when waiting for ident
author Matt Johnston <matt@ucc.asn.au>
date Mon, 03 Aug 2015 21:59:40 +0800
parents 6aeadee3f16b
children f6d3a16ecc71
line wrap: on
line diff
--- a/common-session.c	Mon Aug 03 21:17:23 2015 +0800
+++ b/common-session.c	Mon Aug 03 21:59:40 2015 +0800
@@ -76,6 +76,7 @@
 	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 @@
 	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;