forked from wolfSSL/wolfssl
for DTLS, retain the handshake resources until peer sends application data record
This commit is contained in:
@ -7689,6 +7689,12 @@ int ProcessReply(WOLFSSL* ssl)
|
||||
|
||||
case application_data:
|
||||
WOLFSSL_MSG("got app DATA");
|
||||
#ifdef WOLFSSL_DTLS
|
||||
if (ssl->options.dtls && ssl->options.dtlsHsRetain) {
|
||||
FreeHandshakeResources(ssl);
|
||||
ssl->options.dtlsHsRetain = 0;
|
||||
}
|
||||
#endif
|
||||
if ((ret = DoApplicationData(ssl,
|
||||
ssl->buffers.inputBuffer.buffer,
|
||||
&ssl->buffers.inputBuffer.idx))
|
||||
@ -7819,7 +7825,7 @@ int SendChangeCipher(WOLFSSL* ssl)
|
||||
|
||||
if (ssl->options.groupMessages)
|
||||
return 0;
|
||||
#ifdef WOLFSSL_DTLS
|
||||
#if defined(WOLFSSL_DTLS) && !defined(WOLFSSL_DEBUG_DTLS)
|
||||
else if (ssl->options.dtls) {
|
||||
/* If using DTLS, force the ChangeCipherSpec message to be in the
|
||||
* same datagram as the finished message. */
|
||||
|
22
src/ssl.c
22
src/ssl.c
@ -5985,7 +5985,16 @@ int wolfSSL_DTLS_SetCookieSecret(WOLFSSL* ssl,
|
||||
}
|
||||
}
|
||||
#endif /* NO_HANDSHAKE_DONE_CB */
|
||||
FreeHandshakeResources(ssl);
|
||||
|
||||
if (!ssl->options.dtls) {
|
||||
FreeHandshakeResources(ssl);
|
||||
}
|
||||
#ifdef WOLFSSL_DTLS
|
||||
else {
|
||||
ssl->options.dtlsHsRetain = 1;
|
||||
}
|
||||
#endif /* WOLFSSL_DTLS */
|
||||
|
||||
WOLFSSL_LEAVE("SSL_connect()", SSL_SUCCESS);
|
||||
return SSL_SUCCESS;
|
||||
|
||||
@ -6259,7 +6268,16 @@ int wolfSSL_DTLS_SetCookieSecret(WOLFSSL* ssl,
|
||||
}
|
||||
}
|
||||
#endif /* NO_HANDSHAKE_DONE_CB */
|
||||
FreeHandshakeResources(ssl);
|
||||
|
||||
if (!ssl->options.dtls) {
|
||||
FreeHandshakeResources(ssl);
|
||||
}
|
||||
#ifdef WOLFSSL_DTLS
|
||||
else {
|
||||
ssl->options.dtlsHsRetain = 1;
|
||||
}
|
||||
#endif /* WOLFSSL_DTLS */
|
||||
|
||||
WOLFSSL_LEAVE("SSL_accept()", SSL_SUCCESS);
|
||||
return SSL_SUCCESS;
|
||||
|
||||
|
@ -2255,6 +2255,9 @@ typedef struct Options {
|
||||
word16 createTicket:1; /* Server to create new Ticket */
|
||||
word16 useTicket:1; /* Use Ticket not session cache */
|
||||
#endif
|
||||
#ifdef WOLFSSL_DTLS
|
||||
word16 dtlsHsRetain:1; /* DTLS retaining HS data */
|
||||
#endif
|
||||
|
||||
/* need full byte values for this section */
|
||||
byte processReply; /* nonblocking resume */
|
||||
|
Reference in New Issue
Block a user