comparison common-session.c @ 928:7cd89d4e0335

Add new monotonic_now() wrapper so that timeouts are unaffected by system clock changes
author Matt Johnston <matt@ucc.asn.au>
date Thu, 13 Mar 2014 23:50:09 +0800
parents 122fb3532038
children 9d40ed1da686
comparison
equal deleted inserted replaced
927:122fb3532038 928:7cd89d4e0335
395 /* Check all timeouts which are required. Currently these are the time for 395 /* Check all timeouts which are required. Currently these are the time for
396 * user authentication, and the automatic rekeying. */ 396 * user authentication, and the automatic rekeying. */
397 static void checktimeouts() { 397 static void checktimeouts() {
398 398
399 time_t now; 399 time_t now;
400 400 now = monotonic_now();
401 now = time(NULL);
402 401
403 if (ses.connect_time != 0 && now - ses.connect_time >= AUTH_TIMEOUT) { 402 if (ses.connect_time != 0 && now - ses.connect_time >= AUTH_TIMEOUT) {
404 dropbear_close("Timeout before auth"); 403 dropbear_close("Timeout before auth");
405 } 404 }
406 405