forked from wolfSSL/wolfssl
Change define name for sending HRR Cookie
This commit is contained in:
@@ -474,7 +474,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args)
|
|||||||
#ifdef WOLFSSL_EARLY_DATA
|
#ifdef WOLFSSL_EARLY_DATA
|
||||||
int earlyData = 0;
|
int earlyData = 0;
|
||||||
#endif
|
#endif
|
||||||
#ifdef WOLFSSL_HRR_COOKIE
|
#ifdef WOLFSSL_SEND_HRR_COOKIE
|
||||||
int hrrCookie = 0;
|
int hrrCookie = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -751,7 +751,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'J' :
|
case 'J' :
|
||||||
#ifdef WOLFSSL_HRR_COOKIE
|
#ifdef WOLFSSL_SEND_HRR_COOKIE
|
||||||
hrrCookie = 1;
|
hrrCookie = 1;
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
@@ -1093,7 +1093,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args)
|
|||||||
wolfSSL_KeepArrays(ssl);
|
wolfSSL_KeepArrays(ssl);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WOLFSSL_HRR_COOKIE
|
#ifdef WOLFSSL_SEND_HRR_COOKIE
|
||||||
if (hrrCookie && wolfSSL_send_hrr_cookie(ssl, NULL, 0) != SSL_SUCCESS) {
|
if (hrrCookie && wolfSSL_send_hrr_cookie(ssl, NULL, 0) != SSL_SUCCESS) {
|
||||||
err_sys("unable to set use of cookie with HRR msg");
|
err_sys("unable to set use of cookie with HRR msg");
|
||||||
}
|
}
|
||||||
|
@@ -4550,7 +4550,7 @@ void SSL_ResourceFree(WOLFSSL* ssl)
|
|||||||
ShrinkInputBuffer(ssl, FORCED_FREE);
|
ShrinkInputBuffer(ssl, FORCED_FREE);
|
||||||
if (ssl->buffers.outputBuffer.dynamicFlag)
|
if (ssl->buffers.outputBuffer.dynamicFlag)
|
||||||
ShrinkOutputBuffer(ssl);
|
ShrinkOutputBuffer(ssl);
|
||||||
#if defined(WOLFSSL_HRR_COOKIE) && !defined(NO_WOLFSSL_SERVER)
|
#if defined(WOLFSSL_SEND_HRR_COOKIE) && !defined(NO_WOLFSSL_SERVER)
|
||||||
XFREE(ssl->buffers.tls13CookieSecret.buffer, ssl->heap,
|
XFREE(ssl->buffers.tls13CookieSecret.buffer, ssl->heap,
|
||||||
DYNAMIC_TYPE_COOKIE_PWD);
|
DYNAMIC_TYPE_COOKIE_PWD);
|
||||||
#endif
|
#endif
|
||||||
|
10
src/tls13.c
10
src/tls13.c
@@ -2376,7 +2376,7 @@ int SendTls13ClientHello(WOLFSSL* ssl)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WOLFSSL_TLS13_DRAFT_18
|
#ifndef WOLFSSL_TLS13_DRAFT_18
|
||||||
#ifdef WOLFSSL_HRR_COOKIE
|
#ifdef WOLFSSL_SEND_HRR_COOKIE
|
||||||
/* Create Cookie extension using the hash of the first ClientHello.
|
/* Create Cookie extension using the hash of the first ClientHello.
|
||||||
*
|
*
|
||||||
* ssl SSL/TLS object.
|
* ssl SSL/TLS object.
|
||||||
@@ -2455,7 +2455,7 @@ static int RestartHandshakeHash(WOLFSSL* ssl)
|
|||||||
WOLFSSL_MSG("Restart Hash");
|
WOLFSSL_MSG("Restart Hash");
|
||||||
WOLFSSL_BUFFER(hash, hashSz);
|
WOLFSSL_BUFFER(hash, hashSz);
|
||||||
|
|
||||||
#ifdef WOLFSSL_HRR_COOKIE
|
#ifdef WOLFSSL_SEND_HRR_COOKIE
|
||||||
if (ssl->options.sendCookie) {
|
if (ssl->options.sendCookie) {
|
||||||
byte cookie[OPAQUE8_LEN + MAX_DIGEST_SIZE + OPAQUE16_LEN * 2];
|
byte cookie[OPAQUE8_LEN + MAX_DIGEST_SIZE + OPAQUE16_LEN * 2];
|
||||||
TLSX* ext;
|
TLSX* ext;
|
||||||
@@ -3116,7 +3116,7 @@ static int DoPreSharedKeys(WOLFSSL* ssl, const byte* input, word32 helloSz,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(WOLFSSL_TLS13_DRAFT_18) && defined(WOLFSSL_HRR_COOKIE)
|
#if !defined(WOLFSSL_TLS13_DRAFT_18) && defined(WOLFSSL_SEND_HRR_COOKIE)
|
||||||
/* Check that the Cookie data's integrity.
|
/* Check that the Cookie data's integrity.
|
||||||
*
|
*
|
||||||
* ssl SSL/TLS object.
|
* ssl SSL/TLS object.
|
||||||
@@ -3387,7 +3387,7 @@ static int DoTls13ClientHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
|
|
||||||
if (TLSX_Find(ssl->extensions, TLSX_SUPPORTED_VERSIONS) == NULL)
|
if (TLSX_Find(ssl->extensions, TLSX_SUPPORTED_VERSIONS) == NULL)
|
||||||
ssl->version.minor = pv.minor;
|
ssl->version.minor = pv.minor;
|
||||||
#ifdef WOLFSSL_HRR_COOKIE
|
#ifdef WOLFSSL_SEND_HRR_COOKIE
|
||||||
if (ssl->options.sendCookie &&
|
if (ssl->options.sendCookie &&
|
||||||
ssl->options.serverState == SERVER_HELLO_RETRY_REQUEST) {
|
ssl->options.serverState == SERVER_HELLO_RETRY_REQUEST) {
|
||||||
TLSX* ext;
|
TLSX* ext;
|
||||||
@@ -6674,7 +6674,7 @@ int wolfSSL_connect_TLSv13(WOLFSSL* ssl)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WOLFSSL_HRR_COOKIE) && !defined(NO_WOLFSSL_SERVER)
|
#if defined(WOLFSSL_SEND_HRR_COOKIE) && !defined(NO_WOLFSSL_SERVER)
|
||||||
/* Send a cookie with the HelloRetryRequest to avoid storing state.
|
/* Send a cookie with the HelloRetryRequest to avoid storing state.
|
||||||
*
|
*
|
||||||
* ssl SSL/TLS object.
|
* ssl SSL/TLS object.
|
||||||
|
@@ -2691,7 +2691,7 @@ typedef struct Buffers {
|
|||||||
int certChainCnt;
|
int certChainCnt;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef WOLFSSL_HRR_COOKIE
|
#ifdef WOLFSSL_SEND_HRR_COOKIE
|
||||||
buffer tls13CookieSecret; /* HRR cookie secret */
|
buffer tls13CookieSecret; /* HRR cookie secret */
|
||||||
#endif
|
#endif
|
||||||
#ifdef WOLFSSL_DTLS
|
#ifdef WOLFSSL_DTLS
|
||||||
|
Reference in New Issue
Block a user