DTLS 1.3: Don't add HRR to ssl->dtls13Rtx

Signed-off-by: Marco Oliverio <marco@wolfssl.com>
This commit is contained in:
Juliusz Sosinowicz
2022-09-20 12:53:54 +02:00
committed by Marco Oliverio
parent 145086f776
commit c72d315325

View File

@ -811,7 +811,7 @@ static int Dtls13SendOneFragmentRtx(WOLFSSL* ssl,
enum HandShakeType handshakeType, word16 outputSize, byte* message,
word32 length, int hashOutput)
{
Dtls13RtxRecord* rtxRecord;
Dtls13RtxRecord* rtxRecord = NULL;
word16 recordHeaderLength;
byte isProtected;
int ret;
@ -819,20 +819,23 @@ static int Dtls13SendOneFragmentRtx(WOLFSSL* ssl,
isProtected = Dtls13TypeIsEncrypted(handshakeType);
recordHeaderLength = Dtls13GetRlHeaderLength(ssl, isProtected);
rtxRecord = Dtls13RtxNewRecord(ssl, message + recordHeaderLength,
(word16)(length - recordHeaderLength), handshakeType,
ssl->dtls13EncryptEpoch->nextSeqNumber);
if (rtxRecord == NULL)
return MEMORY_E;
if (handshakeType != hello_retry_request) {
rtxRecord = Dtls13RtxNewRecord(ssl, message + recordHeaderLength,
(word16)(length - recordHeaderLength), handshakeType,
ssl->dtls13EncryptEpoch->nextSeqNumber);
if (rtxRecord == NULL)
return MEMORY_E;
}
ret = Dtls13SendFragment(ssl, message, outputSize, (word16)length,
handshakeType, hashOutput, Dtls13SendNow(ssl, handshakeType));
if (ret == 0 || ret == WANT_WRITE)
Dtls13RtxAddRecord(&ssl->dtls13Rtx, rtxRecord);
else
Dtls13FreeRtxBufferRecord(ssl, rtxRecord);
if (rtxRecord != NULL) {
if (ret == 0 || ret == WANT_WRITE)
Dtls13RtxAddRecord(&ssl->dtls13Rtx, rtxRecord);
else
Dtls13FreeRtxBufferRecord(ssl, rtxRecord);
}
return ret;
}