diff --git a/NEWS.md b/NEWS.md index 54f0a57..f775d3f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ ### SSLsplit develop +- Fix SSL sessions to actually time out (patch by @eunsoopark, issue #115). - Add XNU headers for OS X 10.11 El Capitan (issue #116). - Fix EV_READ event re-enable bug that could lead to stalled connections after throttling one direction (issue #109). diff --git a/ssl.c b/ssl.c index ec56676..280a9bf 100644 --- a/ssl.c +++ b/ssl.c @@ -1666,9 +1666,9 @@ ssl_session_is_valid(SSL_SESSION *sess) if ((curtime < 0) || ((time_t)curtime != curtimet)) return 0; timeout = SSL_SESSION_get_timeout(sess); - if (curtime > LONG_MAX - timeout) + if (curtime < timeout) return 0; - return (SSL_SESSION_get_time(sess) < curtime + timeout); + return (SSL_SESSION_get_time(sess) > curtime - timeout); } /*