Merge pull request #5595 from haydenroche5/async_ticket_dec_fix

Handle WC_PENDING_E from ticketEncCb in DoClientTicket properly.
This commit is contained in:
David Garske
2022-09-29 14:41:35 -07:00
committed by GitHub

View File

@ -34193,10 +34193,17 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
et->enc_ticket, inLen, &outLen,
ssl->ctx->ticketEncCtx);
}
if (ret != WOLFSSL_TICKET_RET_OK && ret != WOLFSSL_TICKET_RET_CREATE) {
if (ret != WOLFSSL_TICKET_RET_OK) {
#ifdef WOLFSSL_ASYNC_CRYPT
if (ret == WC_PENDING_E) {
return ret;
}
#endif /* WOLFSSL_ASYNC_CRYPT */
if (ret != WOLFSSL_TICKET_RET_CREATE) {
WOLFSSL_ERROR_VERBOSE(BAD_TICKET_KEY_CB_SZ);
return WOLFSSL_TICKET_RET_REJECT;
}
}
if (outLen > (int)inLen || outLen < (int)sizeof(InternalTicket)) {
WOLFSSL_MSG("Bad user ticket decrypt len");
WOLFSSL_ERROR_VERBOSE(BAD_TICKET_KEY_CB_SZ);