@@ -15674,11 +15674,15 @@ int DoTls13HandShakeMsg(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1567415674 totalSz);
1567515675 #if defined(WOLFSSL_ASYNC_CRYPT) || defined(WOLFSSL_NONBLOCK_OCSP)
1567615676 if ((ret == WC_NO_ERR_TRACE(WC_PENDING_E) &&
15677- (ssl->kdfMsgStep == 0 || kdfStepEntry != 0)) ||
15677+ (ssl->kdfMsgStep == 0 || kdfStepEntry != 0) &&
15678+ ssl->options.processReply != 0 /* doProcessInit */) ||
1567815679 ret == WC_NO_ERR_TRACE(OCSP_WANT_READ)) {
15679- /* Re-present for in-handler pends and pre-dispatch drain pends;
15680- * a post-handler key-schedule pend must NOT replay (state is
15681- * committed; DoTls13MsgDerives() finishes it instead). */
15680+ /* Re-present for in-handler pends and pre-dispatch drain pends.
15681+ * Not for post-handler pends, which committed the message: a
15682+ * key-schedule pend (kdfMsgStep != 0) resumes through
15683+ * DoTls13MsgDerives(), and a post-handshake-auth send pend
15684+ * (processReply reset to doProcessInit) resumes through
15685+ * wolfSSL_negotiate(). */
1568215686 *inOutIdx = startIdx;
1568315687 }
1568415688 #endif
@@ -15710,10 +15714,11 @@ int DoTls13HandShakeMsg(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1571015714 ssl->pendingMsgSz);
1571115715 #if defined(WOLFSSL_ASYNC_CRYPT) || defined(WOLFSSL_NONBLOCK_OCSP)
1571215716 if ((ret == WC_NO_ERR_TRACE(WC_PENDING_E) &&
15713- (ssl->kdfMsgStep == 0 || kdfStepEntry != 0)) ||
15717+ (ssl->kdfMsgStep == 0 || kdfStepEntry != 0) &&
15718+ ssl->options.processReply != 0 /* doProcessInit */) ||
1571415719 ret == WC_NO_ERR_TRACE(OCSP_WANT_READ)) {
15715- /* Re-present the fragment; a post-handler key-schedule
15716- * pend falls through and consumes the message. */
15720+ /* Re-present the fragment; a post-handler pend falls
15721+ * through and consumes the message. */
1571715722 ssl->pendingMsgOffset -= inputLength;
1571815723 *inOutIdx -= inputLength;
1571915724 }
0 commit comments