Fix to make sure provided sigalgo list doesn't overflow the buffer.
This commit is contained in:
parent
2b5c4ffa7f
commit
9f7e40ad5c
@ -4906,8 +4906,11 @@ static int TLSX_SignatureAlgorithms_Parse(WOLFSSL *ssl, byte* input,
|
||||
if (length != OPAQUE16_LEN + len)
|
||||
return BUFFER_ERROR;
|
||||
|
||||
XMEMCPY(suites->hashSigAlgo, input, len);
|
||||
/* truncate hashSigAlgo list if too long */
|
||||
suites->hashSigAlgoSz = len;
|
||||
if (suites->hashSigAlgoSz > WOLFSSL_MAX_SIGALGO)
|
||||
suites->hashSigAlgoSz = WOLFSSL_MAX_SIGALGO;
|
||||
XMEMCPY(suites->hashSigAlgo, input, suites->hashSigAlgoSz);
|
||||
|
||||
return TLSX_SignatureAlgorithms_MapPss(ssl, input, len);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user