curl-curl/lib/vtls
Stefan Eissing 1cdac95e2e
openssl: fix handling of buffered data
`SSL_pending()` only checks if the *current* TLS packet has more data.
There might be more data in SSL's buffers.

`SSL_has_pending()` only checks if there is data in buffers, but does
*not* check if there is a complete TLS packet that can be decoded.

If we only check the first, we will poll on socket events without having
processed all data and may stall. If we only check the second, we would
busy loop without SSL_read() ever giving something.

Add the flag `connssl->input_pending` that is set on incoming data in
the BIO receive. Clear the flag when encountering a CURLE_AGAIN on
the filters receive (via SSL_read()) or see an EOF.

Ref: #17596
Closes #17601
2025-06-13 00:32:06 +02:00
..
.checksrc strparse: switch to curl_off_t as base data type 2025-02-15 21:58:48 +01:00
cipher_suite.c TLS: remove support for Secure Transport and BearSSL 2025-06-11 07:54:19 +02:00
cipher_suite.h TLS: remove support for Secure Transport and BearSSL 2025-06-11 07:54:19 +02:00
gtls.c tls: remove Curl_ssl false_start 2025-06-12 08:29:15 +02:00
gtls.h curlx: move into to curlx/ 2025-05-07 11:01:15 +02:00
hostcheck.c lib: include files using known path 2025-04-08 17:00:00 +02:00
hostcheck.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
keylog.c spelling: 'a' vs 'an' 2025-05-30 11:38:35 +02:00
keylog.h spelling: 'a' vs 'an' 2025-05-30 11:38:35 +02:00
mbedtls_threadlock.c lib: include files using known path 2025-04-08 17:00:00 +02:00
mbedtls_threadlock.h lib: include files using known path 2025-04-08 17:00:00 +02:00
mbedtls.c tls: remove Curl_ssl false_start 2025-06-12 08:29:15 +02:00
mbedtls.h lib: include files using known path 2025-04-08 17:00:00 +02:00
openssl.c openssl: fix handling of buffered data 2025-06-13 00:32:06 +02:00
openssl.h lib: include files using known path 2025-04-08 17:00:00 +02:00
rustls.c tls: remove Curl_ssl false_start 2025-06-12 08:29:15 +02:00
rustls.h lib: include files using known path 2025-04-08 17:00:00 +02:00
schannel_int.h lib: use BIT() instead of bool in structs more 2025-04-22 08:01:08 +02:00
schannel_verify.c spelling: call it null-terminate consistently 2025-05-30 17:29:45 +02:00
schannel.c tls: remove Curl_ssl false_start 2025-06-12 08:29:15 +02:00
schannel.h lib: include files using known path 2025-04-08 17:00:00 +02:00
vtls_int.h openssl: fix handling of buffered data 2025-06-13 00:32:06 +02:00
vtls_scache.c spelling: call it null-terminate consistently 2025-05-30 17:29:45 +02:00
vtls_scache.h spelling: 'a' vs 'an' 2025-05-30 11:38:35 +02:00
vtls_spack.c curlx: move into to curlx/ 2025-05-07 11:01:15 +02:00
vtls_spack.h lib: include files using known path 2025-04-08 17:00:00 +02:00
vtls.c tls: remove Curl_ssl false_start 2025-06-12 08:29:15 +02:00
vtls.h tls: remove Curl_ssl false_start 2025-06-12 08:29:15 +02:00
wolfssl.c tls: remove Curl_ssl false_start 2025-06-12 08:29:15 +02:00
wolfssl.h pytest: add pinnedpubkey test cases 2025-05-21 22:45:42 +02:00
x509asn1.c TLS: remove support for Secure Transport and BearSSL 2025-06-11 07:54:19 +02:00
x509asn1.h TLS: remove support for Secure Transport and BearSSL 2025-06-11 07:54:19 +02:00