forked from wolfSSL/wolfssl
Refactor SendStatelessReply 1.3 branch into new function
This commit is contained in:
29
src/dtls.c
29
src/dtls.c
@ -470,15 +470,16 @@ static void FindPskSuiteFromExt(const WOLFSSL* ssl, TLSX* extensions,
|
||||
}
|
||||
#endif
|
||||
|
||||
static int SendStatelessReply(const WOLFSSL* ssl, WolfSSL_CH* ch, byte isTls13,
|
||||
#ifdef WOLFSSL_DTLS13
|
||||
|
||||
#ifndef WOLFSSL_SEND_HRR_COOKIE
|
||||
#error "WOLFSSL_SEND_HRR_COOKIE has to be defined to use DTLS 1.3 server"
|
||||
#endif
|
||||
|
||||
static int SendStatelessReplyDtls13(const WOLFSSL* ssl, WolfSSL_CH* ch,
|
||||
PskInfo* pskInfo)
|
||||
{
|
||||
int ret;
|
||||
(void)isTls13;
|
||||
(void)pskInfo;
|
||||
#ifdef WOLFSSL_DTLS13
|
||||
if (isTls13) {
|
||||
#ifdef WOLFSSL_SEND_HRR_COOKIE
|
||||
int ret = -1;
|
||||
if (ch->cookie.size == 0) {
|
||||
TLSX* parsedExts = NULL;
|
||||
WolfSSL_ConstVector tlsx;
|
||||
@ -699,9 +700,19 @@ dtls13_cleanup:
|
||||
}
|
||||
else
|
||||
ret = SendAlert((WOLFSSL*)ssl, alert_fatal, illegal_parameter);
|
||||
#else
|
||||
#error "WOLFSSL_SEND_HRR_COOKIE has to be defined to use DTLS 1.3 server"
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int SendStatelessReply(const WOLFSSL* ssl, WolfSSL_CH* ch, byte isTls13,
|
||||
PskInfo* pskInfo)
|
||||
{
|
||||
int ret;
|
||||
(void)isTls13;
|
||||
(void)pskInfo;
|
||||
#ifdef WOLFSSL_DTLS13
|
||||
if (isTls13) {
|
||||
ret = SendStatelessReplyDtls13(ssl, ch, pskInfo);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user