forked from wolfSSL/wolfssl
don't retrieve or cache null sessions
This commit is contained in:
@@ -2572,7 +2572,10 @@ CYASSL_SESSION* GetSession(CYASSL* ssl, byte* masterSecret)
|
||||
int idx;
|
||||
|
||||
if (ssl->options.sessionCacheOff)
|
||||
return 0;
|
||||
return NULL;
|
||||
|
||||
if (ssl->options.haveSessionId == 0)
|
||||
return NULL;
|
||||
|
||||
row = HashSession(id) % SESSION_ROWS;
|
||||
|
||||
@@ -2635,6 +2638,9 @@ int AddSession(CYASSL* ssl)
|
||||
if (ssl->options.sessionCacheOff)
|
||||
return 0;
|
||||
|
||||
if (ssl->options.haveSessionId == 0)
|
||||
return 0;
|
||||
|
||||
row = HashSession(ssl->arrays.sessionID) % SESSION_ROWS;
|
||||
|
||||
if (LockMutex(&session_mutex) != 0)
|
||||
|
||||
Reference in New Issue
Block a user