mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 19:54:40 +02:00
Merge pull request #851 from toddouska/nosessid
don't send session ID on server side if session cache is off unless w…
This commit is contained in:
@@ -17945,6 +17945,8 @@ int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
int sendSz;
|
int sendSz;
|
||||||
int ret;
|
int ret;
|
||||||
byte sessIdSz = ID_LEN;
|
byte sessIdSz = ID_LEN;
|
||||||
|
byte echoId = 0; /* ticket echo id flag */
|
||||||
|
byte cacheOff = 0; /* session cache off flag */
|
||||||
|
|
||||||
length = VERSION_SZ + RAN_LEN
|
length = VERSION_SZ + RAN_LEN
|
||||||
+ ID_LEN + ENUM_LEN
|
+ ID_LEN + ENUM_LEN
|
||||||
@@ -17962,6 +17964,7 @@ int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
return BUFFER_ERROR;
|
return BUFFER_ERROR;
|
||||||
}
|
}
|
||||||
length -= (ID_LEN - sessIdSz); /* adjust ID_LEN assumption */
|
length -= (ID_LEN - sessIdSz); /* adjust ID_LEN assumption */
|
||||||
|
echoId = 1;
|
||||||
}
|
}
|
||||||
#endif /* HAVE_SESSION_TICKET */
|
#endif /* HAVE_SESSION_TICKET */
|
||||||
#else
|
#else
|
||||||
@@ -17970,6 +17973,22 @@ int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* is the session cahce off at build or runtime */
|
||||||
|
#ifdef NO_SESSION_CACHE
|
||||||
|
cacheOff = 1;
|
||||||
|
#else
|
||||||
|
if (ssl->options.sessionCacheOff == 1) {
|
||||||
|
cacheOff = 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* if no session cache don't send a session ID unless we're echoing
|
||||||
|
* an ID as part of session tickets */
|
||||||
|
if (echoId == 0 && cacheOff == 1) {
|
||||||
|
length -= ID_LEN; /* adjust ID_LEN assumption */
|
||||||
|
sessIdSz = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* check for avalaible size */
|
/* check for avalaible size */
|
||||||
if ((ret = CheckAvailableSize(ssl, MAX_HELLO_SZ)) != 0)
|
if ((ret = CheckAvailableSize(ssl, MAX_HELLO_SZ)) != 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
Reference in New Issue
Block a user