mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-04 21:24:43 +02:00
dtls: better sanitize incoming messages in stateless handling
This commit is contained in:
@@ -365,7 +365,8 @@ static int FindExtByType(WolfSSL_ConstVector* ret, word16 extType,
|
|||||||
ato16(exts.elements + idx, &type);
|
ato16(exts.elements + idx, &type);
|
||||||
idx += OPAQUE16_LEN;
|
idx += OPAQUE16_LEN;
|
||||||
idx += ReadVector16(exts.elements + idx, &ext);
|
idx += ReadVector16(exts.elements + idx, &ext);
|
||||||
if (idx > exts.size)
|
if (idx > exts.size ||
|
||||||
|
ext.elements + ext.size > exts.elements + exts.size)
|
||||||
return BUFFER_ERROR;
|
return BUFFER_ERROR;
|
||||||
if (type == extType) {
|
if (type == extType) {
|
||||||
XMEMCPY(ret, &ext, sizeof(ext));
|
XMEMCPY(ret, &ext, sizeof(ext));
|
||||||
@@ -498,7 +499,7 @@ static int TlsCheckSupportedVersion(const WOLFSSL* ssl,
|
|||||||
ch->extension, &tlsxFound);
|
ch->extension, &tlsxFound);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return ret;
|
return ret;
|
||||||
if (!tlsxFound) {
|
if (!tlsxFound || tlsxSupportedVersions.elements == NULL) {
|
||||||
*isTls13 = 0;
|
*isTls13 = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user