Fix SSL_pending() and SSL_has_pending() with DTLS
authorMatt Caswell <matt@openssl.org>
Mon, 25 Jul 2022 14:59:38 +0000 (15:59 +0100)
committerHugo Landau <hlandau@openssl.org>
Wed, 17 Aug 2022 15:41:20 +0000 (16:41 +0100)
commit1b89d835ab8a3c3e971049d090b71a52649b1423
treebab3d26a1f7424d6b3d52ca09b580307a39f681b
parentba8fd22b358ce0467f4893bc8f925c6272964628
Fix SSL_pending() and SSL_has_pending() with DTLS

If app data is received before a Finished message in DTLS then we buffer
it to return later. The function SSL_pending() is supposed to tell you
how much processed app data we have already buffered, and SSL_has_pending()
is supposed to tell you if we have any data buffered (whether processed or
not, and whether app data or not).

Neither SSL_pending() or SSL_has_pending() were taking account of this
DTLS specific app data buffer.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18975)
ssl/record/rec_layer_s3.c
ssl/ssl_lib.c