mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
Fixed issue with session id's in the future
git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@224 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
parent
5fcb19810a
commit
c0074b3044
16
ssl/tls1.c
16
ssl/tls1.c
@ -1667,8 +1667,10 @@ SSL_SESSION *ssl_session_update(int max_sessions, SSL_SESSION *ssl_sessions[],
|
||||
{
|
||||
if (ssl_sessions[i])
|
||||
{
|
||||
/* kill off any expired sessions */
|
||||
if (tm > ssl_sessions[i]->conn_time + SSL_EXPIRY_TIME)
|
||||
/* kill off any expired sessions (including those in
|
||||
the future) */
|
||||
if ((tm > ssl_sessions[i]->conn_time + SSL_EXPIRY_TIME) ||
|
||||
(tm < ssl_sessions[i]->conn_time))
|
||||
{
|
||||
session_free(ssl_sessions, i);
|
||||
continue;
|
||||
@ -1712,13 +1714,9 @@ SSL_SESSION *ssl_session_update(int max_sessions, SSL_SESSION *ssl_sessions[],
|
||||
}
|
||||
|
||||
/* ok, we've used up all of our sessions. So blow the oldest session away */
|
||||
if (oldest_sess != NULL)
|
||||
{
|
||||
oldest_sess->conn_time = tm;
|
||||
memset(oldest_sess->session_id, 0, sizeof(SSL_SESSION_ID_SIZE));
|
||||
memset(oldest_sess->master_secret, 0, sizeof(SSL_SECRET_SIZE));
|
||||
}
|
||||
|
||||
oldest_sess->conn_time = tm;
|
||||
memset(oldest_sess->session_id, 0, sizeof(SSL_SESSION_ID_SIZE));
|
||||
memset(oldest_sess->master_secret, 0, sizeof(SSL_SECRET_SIZE));
|
||||
SSL_CTX_UNLOCK(ssl->ssl_ctx->mutex);
|
||||
return oldest_sess;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user