mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 19:24:42 +02:00
Fix to make sure provided sigalgo list doesn't overflow the buffer.
This commit is contained in:
@@ -4906,8 +4906,11 @@ static int TLSX_SignatureAlgorithms_Parse(WOLFSSL *ssl, byte* input,
|
|||||||
if (length != OPAQUE16_LEN + len)
|
if (length != OPAQUE16_LEN + len)
|
||||||
return BUFFER_ERROR;
|
return BUFFER_ERROR;
|
||||||
|
|
||||||
XMEMCPY(suites->hashSigAlgo, input, len);
|
/* truncate hashSigAlgo list if too long */
|
||||||
suites->hashSigAlgoSz = len;
|
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);
|
return TLSX_SignatureAlgorithms_MapPss(ssl, input, len);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user