mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
Reuse ReadVector16
This commit is contained in:
13
src/dtls.c
13
src/dtls.c
@ -500,7 +500,6 @@ static int SendStatelessReplyDtls13(const WOLFSSL* ssl, WolfSSL_CH* ch,
|
|||||||
TLSX* parsedExts = NULL;
|
TLSX* parsedExts = NULL;
|
||||||
WolfSSL_ConstVector tlsx;
|
WolfSSL_ConstVector tlsx;
|
||||||
Suites suites;
|
Suites suites;
|
||||||
word16 len;
|
|
||||||
byte haveSA = 0;
|
byte haveSA = 0;
|
||||||
byte haveKS = 0;
|
byte haveKS = 0;
|
||||||
#if defined(HAVE_SESSION_TICKET) || !defined(NO_PSK)
|
#if defined(HAVE_SESSION_TICKET) || !defined(NO_PSK)
|
||||||
@ -553,14 +552,14 @@ static int SendStatelessReplyDtls13(const WOLFSSL* ssl, WolfSSL_CH* ch,
|
|||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
goto dtls13_cleanup;
|
goto dtls13_cleanup;
|
||||||
if (tlsx.size > OPAQUE16_LEN) {
|
if (tlsx.size > OPAQUE16_LEN) {
|
||||||
ato16(tlsx.elements, &len);
|
WolfSSL_ConstVector sigAlgs;
|
||||||
if (len != tlsx.size - OPAQUE16_LEN)
|
ReadVector16(tlsx.elements, &sigAlgs);
|
||||||
|
if (sigAlgs.size != tlsx.size - OPAQUE16_LEN)
|
||||||
ERROR_OUT(BUFFER_ERROR, dtls13_cleanup);
|
ERROR_OUT(BUFFER_ERROR, dtls13_cleanup);
|
||||||
if ((len % 2) != 0)
|
if ((sigAlgs.size % 2) != 0)
|
||||||
ERROR_OUT(BUFFER_ERROR, dtls13_cleanup);
|
ERROR_OUT(BUFFER_ERROR, dtls13_cleanup);
|
||||||
suites.hashSigAlgoSz = len;
|
suites.hashSigAlgoSz = (word16)sigAlgs.size;
|
||||||
XMEMCPY(suites.hashSigAlgo, tlsx.elements + OPAQUE16_LEN,
|
XMEMCPY(suites.hashSigAlgo, sigAlgs.elements, sigAlgs.size);
|
||||||
len);
|
|
||||||
haveSA = 1;
|
haveSA = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user