Async Sniffer: Fix for decryption after second handshake

This commit is contained in:
Lealem Amedie
2022-12-02 13:11:23 -08:00
parent efd194ea74
commit ed69bb33a6

View File

@ -4692,15 +4692,17 @@ static int DecryptTls(WOLFSSL* ssl, byte* plain, const byte* input,
int ret = 0;
#ifdef WOLFSSL_ASYNC_CRYPT
ret = wolfSSL_AsyncPop(ssl, &ssl->decrypt.state);
if (ret != WC_NOT_PENDING_E) {
/* check for still pending */
if (ret == WC_PENDING_E)
return ret;
if (ssl->decrypt.state != CIPHER_STATE_BEGIN) {
ret = wolfSSL_AsyncPop(ssl, &ssl->decrypt.state);
if (ret != WC_NOT_PENDING_E) {
/* check for still pending */
if (ret == WC_PENDING_E)
return ret;
ssl->error = 0; /* clear async */
ssl->error = 0; /* clear async */
/* let failures through so CIPHER_STATE_END logic is run */
/* let failures through so CIPHER_STATE_END logic is run */
}
}
else
#endif