12 Commits

Author SHA1 Message Date
Azat Khuzhin
7652cf4068 ssl: do not triger EOF if some data had been successfully read
Previously in case when evbuffer_reserve_space() returns > 1, but
it was able to read only 1 IO vector, it will try to read the next one,
got 0 (EOF for mbedTLS or SSL_ERROR_ZERO_RETURN for OpenSSL) and will
trigger EOF, while instead, it should trigger EV_READ w/o EOF and only
after EOF.
2023-05-14 16:53:13 +02:00
Azat Khuzhin
6375dcb46d ssl: rename err_is_ok to handshake_is_ok (internal API) 2023-05-14 16:49:18 +02:00
Dmitry Ilyin
88317a4ef8 Add helpers and all regress tests are passed 2022-10-04 17:49:22 +03:00
William Marlow
384c52e6be Initial Mbed-TLS 3 support to get the GitHub Actions working again
mingw has upgraded to Mbed-TLS 3.1.0, so all the mingw tests that need
Mbed-TLS currently don't work.

v2: add missing mbedtls/version.h into test/regress_mbedtls.c
v3: suppress #warning "Including compat-2.x.h is deprecated" for mbedtls/compat-2.x.h
2022-07-09 20:47:04 +03:00
Azat Khuzhin
f02fa33948 Support disabled renegotiation in mbedTLS
Patch from: @Kurruk007
Fixes: #1161
2021-04-30 10:16:23 +03:00
Azat Khuzhin
7e0fc878c5 Introduce new API for flags of the SSL bufferevent
Introduce more generic API (like for evbuffer):
- bufferevent_ssl_set_flags()
- bufferevent_ssl_clear_flags()
- bufferevent_ssl_get_flags()

And deprecate existing:
- bufferevent_openssl_get_allow_dirty_shutdown()
- bufferevent_openssl_set_allow_dirty_shutdown()
- bufferevent_mbedtls_get_allow_dirty_shutdown()
- bufferevent_mbedtls_set_allow_dirty_shutdown()
2020-10-31 22:51:40 +03:00
okhowang(王沛文)
85c6759926 fix: compat mbedtls < 2.4 2020-07-24 17:19:14 +08:00
Azat Khuzhin
948ad30435 Fix bufferevent_get_{openssl,mbedtls}_error()
The bufferevent_get_openssl_error() returns unsigned long, so returning
-1 on error in unclear. Let's use 0.

Fixes: #1028
2020-07-23 23:41:31 +03:00
Azat Khuzhin
5671575a1c Join le_ssl_ops.post_init with le_ssl_ops.init 2020-07-22 23:08:50 +03:00
okhowang(王沛文)
d095b834a9 Merge ssl implementations (openssl and mbedtls)
This patch splits common part out to avoid copy-paste from the
- bufferevent_openssl.c
- bufferevent_mbedtls.c

It uses VFS/bufferevent-like approach, i.e. structure of callbacks.
2020-07-22 23:03:17 +03:00
okhowang(王沛文)
028385f685 fix build system and add test and cleanup code 2020-07-22 22:53:23 +03:00
Jesse Fang
b28effa950 mbedtls based SSL implementation
prototype is libevent-2.1.11-stable libevent_openssl.c
2020-07-22 22:52:58 +03:00