@@ -19640,18 +19640,12 @@ int DoApplicationData(WOLFSSL* ssl, byte* input, word32* inOutIdx, int sniff)
1964019640 *inOutIdx = idx;
1964119641#ifdef WOLFSSL_DTLS13
1964219642 if (ssl->options.connectState == WAIT_FINISHED_ACK) {
19643- /* Reset the processReply state since
19644- * we finished processing this message. */
19645- ssl->options.processReply = doProcessInit;
1964619643 /* DTLS 1.3 is waiting for an ACK but we can still return app data. */
1964719644 return APP_DATA_READY;
1964819645 }
1964919646#endif
1965019647#ifdef HAVE_SECURE_RENEGOTIATION
1965119648 if (IsSCR(ssl)) {
19652- /* Reset the processReply state since
19653- * we finished processing this message. */
19654- ssl->options.processReply = doProcessInit;
1965519649 /* If we are in a secure renegotiation then APP DATA is treated
1965619650 * differently */
1965719651 return APP_DATA_READY;
@@ -21211,7 +21205,13 @@ int ProcessReplyEx(WOLFSSL* ssl, int allowSocketErr)
2121121205 &ssl->buffers.inputBuffer.idx,
2121221206 NO_SNIFF)) != 0) {
2121321207 WOLFSSL_ERROR(ret);
21214- return ret;
21208+ #if defined(WOLFSSL_DTLS13) || \
21209+ defined(HAVE_SECURE_RENEGOTIATION)
21210+ /* Not really an error. We will return after cleaning
21211+ * up the processReply state. */
21212+ if (ret != APP_DATA_READY)
21213+ #endif
21214+ return ret;
2121521215 }
2121621216 break;
2121721217
@@ -21334,6 +21334,11 @@ int ProcessReplyEx(WOLFSSL* ssl, int allowSocketErr)
2133421334 * by higher layers. */
2133521335 if (ret != 0)
2133621336 return ret;
21337+ #endif
21338+ #if defined(WOLFSSL_DTLS13) || defined(HAVE_SECURE_RENEGOTIATION)
21339+ /* Signal to user that we have application data ready to read */
21340+ if (ret == APP_DATA_READY)
21341+ return ret;
2133721342#endif
2133821343 /* It is safe to shrink the input buffer here now. local vars will
2133921344 * be reset to the new starting value. */
0 commit comments