mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-03 12:44:45 +02:00
simplify hello_request padSz calc with cached value
This commit is contained in:
@@ -4357,17 +4357,11 @@ static int DoHelloRequest(CYASSL* ssl, const byte* input, word32* inOutIdx,
|
||||
return BUFFER_ERROR;
|
||||
|
||||
if (ssl->keys.encryptionOn) {
|
||||
int padSz = ssl->keys.encryptSz - HANDSHAKE_HEADER_SZ -
|
||||
ssl->specs.hash_size;
|
||||
|
||||
if (ssl->options.tls1_1 && ssl->specs.cipher_type == block)
|
||||
padSz -= ssl->specs.block_size;
|
||||
|
||||
/* access beyond input + size should be checked against totalSz */
|
||||
if ((word32) (*inOutIdx + ssl->specs.hash_size + padSz) > totalSz)
|
||||
return INCOMPLETE_DATA;
|
||||
if (*inOutIdx + ssl->keys.padSz > totalSz)
|
||||
return BUFFER_E;
|
||||
|
||||
*inOutIdx += ssl->specs.hash_size + padSz;
|
||||
*inOutIdx += ssl->keys.padSz;
|
||||
}
|
||||
|
||||
if (ssl->options.side == CYASSL_SERVER_END) {
|
||||
|
Reference in New Issue
Block a user