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
|
#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)
|
PskInfo* pskInfo)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret = -1;
|
||||||
(void)isTls13;
|
|
||||||
(void)pskInfo;
|
|
||||||
#ifdef WOLFSSL_DTLS13
|
|
||||||
if (isTls13) {
|
|
||||||
#ifdef WOLFSSL_SEND_HRR_COOKIE
|
|
||||||
if (ch->cookie.size == 0) {
|
if (ch->cookie.size == 0) {
|
||||||
TLSX* parsedExts = NULL;
|
TLSX* parsedExts = NULL;
|
||||||
WolfSSL_ConstVector tlsx;
|
WolfSSL_ConstVector tlsx;
|
||||||
@@ -699,9 +700,19 @@ dtls13_cleanup:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
ret = SendAlert((WOLFSSL*)ssl, alert_fatal, illegal_parameter);
|
ret = SendAlert((WOLFSSL*)ssl, alert_fatal, illegal_parameter);
|
||||||
#else
|
return ret;
|
||||||
#error "WOLFSSL_SEND_HRR_COOKIE has to be defined to use DTLS 1.3 server"
|
}
|
||||||
#endif
|
#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
|
else
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user