forked from wolfSSL/wolfssl
Adds capture of ssl->arrays->sessionIDSz at DoServerHello.
This commit is contained in:
@ -9011,7 +9011,6 @@ static void PickHashSigAlgo(CYASSL* ssl,
|
|||||||
static int DoServerHello(CYASSL* ssl, const byte* input, word32* inOutIdx,
|
static int DoServerHello(CYASSL* ssl, const byte* input, word32* inOutIdx,
|
||||||
word32 helloSz)
|
word32 helloSz)
|
||||||
{
|
{
|
||||||
byte b;
|
|
||||||
byte cs0; /* cipher suite bytes 0, 1 */
|
byte cs0; /* cipher suite bytes 0, 1 */
|
||||||
byte cs1;
|
byte cs1;
|
||||||
ProtocolVersion pv;
|
ProtocolVersion pv;
|
||||||
@ -9077,18 +9076,20 @@ static void PickHashSigAlgo(CYASSL* ssl,
|
|||||||
i += RAN_LEN;
|
i += RAN_LEN;
|
||||||
|
|
||||||
/* session id */
|
/* session id */
|
||||||
b = input[i++];
|
ssl->arrays->sessionIDSz = input[i++];
|
||||||
|
|
||||||
if (b > ID_LEN) {
|
if (ssl->arrays->sessionIDSz > ID_LEN) {
|
||||||
CYASSL_MSG("Invalid session ID size");
|
CYASSL_MSG("Invalid session ID size");
|
||||||
|
ssl->arrays->sessionIDSz = 0;
|
||||||
return BUFFER_ERROR;
|
return BUFFER_ERROR;
|
||||||
}
|
}
|
||||||
else if (b) {
|
else if (ssl->arrays->sessionIDSz) {
|
||||||
if ((i - begin) + b > helloSz)
|
if ((i - begin) + ssl->arrays->sessionIDSz > helloSz)
|
||||||
return BUFFER_ERROR;
|
return BUFFER_ERROR;
|
||||||
|
|
||||||
XMEMCPY(ssl->arrays->sessionID, input + i, b);
|
XMEMCPY(ssl->arrays->sessionID, input + i,
|
||||||
i += b;
|
ssl->arrays->sessionIDSz);
|
||||||
|
i += ssl->arrays->sessionIDSz;
|
||||||
ssl->options.haveSessionId = 1;
|
ssl->options.haveSessionId = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user