This patch set provides mbed TLS support.
The interface part (include/event2/bufferevent_ssl.h) LGTM, so this can
be safely merged (although there are some bits left).
Includes:
- bufferevent_mbedtls_*
- regress_mbedtls tests
Left:
- regress_http https_mbedtls support
- ChangeLog entry
* mbedtls:
test: rename ssl/* -> openssl/*
Join le_ssl_ops.post_init with le_ssl_ops.init
Update LICENSE for ssl-client-mbedtls.c
Merge ssl implementations (openssl and mbedtls)
add mbedtls to CI
fix build system and add test and cleanup code
mbed TLS cmake support
simple https client example using mbedtls
mbedtls based SSL implementation
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.
Rather than trying to detect (potentially very old) GCC versions, just
test whether the flag works with the compiler, and add it to CLFAGS if
so.
-Werror is used to convert unknown flag warnings into errors, and
prevent their addition to CLFAGS.
Fixes main/fork under ASAN (LSAN if to be precise)
* fix-signal-leak:
select: requires reinit (otherwise it leaks signal handlers)
poll: requires reinit (otherwise it leaks signal handlers)
UBSAN reports:
test/regress_buffer.c:2360:2: runtime error: null pointer passed as argument 1, which is declared to never be null
/usr/include/string.h:140:33: note: nonnull attribute specified here
tinytest uses another way of detecting test failures, it uses pipe
between child and parent, and if the test function in child returns OK
it writes OK flag into pipe, and reads it in parent.
However sanitizers uses atexit handlers to detect leaks, and this will
not detect failures in case of exit() will be called from the atexit
handlers, fix this by checking status after waitpid().
This allows the object methods to be properly inherited and called via
`super(..)`, addressing breakage with python 2.x, introduced in
cfcc093606e747a5d250787012bac0b149c60d6d.
Fixes#1042.
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
In case of OPT pseudo-RR `class` field is treated as a requestor's UDP
payload size, and class will have 512 (DNS_MAX_UDP_SIZE), and data is
NULL:
(gdb) p *item
$4 = {
next = 0x0,
name = 0x602000000130 "",
type = 41,
class = 512,
ttl = 0,
is_name = 0 '\000',
datalen = 0,
data = 0x0
}
And UBSAN will reports:
../evdns.c:2493:5: runtime error: null pointer passed as argument 2, which is declared to never be null
#0 0x7ffff70b65bb in evdns_server_request_format_response ../evdns.c:2493
#1 0x7ffff70b706b in evdns_server_request_respond ../evdns.c:2529
#2 0x5555557975ab in regress_dns_server_cb ../test/regress_testutils.c:263
#3 0x7ffff70a8489 in request_parse ../evdns.c:1576
#4 0x7ffff70aa445 in server_udp_port_read ../evdns.c:1726
#5 0x7ffff70ac5cc in server_port_ready_callback ../evdns.c:1849
#6 0x7ffff6d3054c in event_persist_closure ../event.c:1645
#7 0x7ffff6d311cd in event_process_active_single_queue ../event.c:1704
#8 0x7ffff6d33258 in event_process_active ../event.c:1805
#9 0x7ffff6d361b5 in event_base_loop ../event.c:2047
#10 0x7ffff6d334ac in event_base_dispatch ../event.c:1839
#11 0x555555739df2 in test_edns ../test/regress_dns.c:2639
#12 0x5555557b9e96 in testcase_run_bare_ ../test/tinytest.c:173
#13 0x5555557ba8f0 in testcase_run_one ../test/tinytest.c:333
#14 0x5555557bc9a0 in tinytest_main ../test/tinytest.c:527
#15 0x555555787faa in main ../test/regress_main.c:528
#16 0x7ffff606c001 in __libc_start_main (/usr/lib/libc.so.6+0x27001)
#17 0x55555569436d in _start (/src/le/libevent/.cmake-debug/bin/regress+0x14036d)
UBSAN reports:
evbuffer/remove_buffer_with_empty3: ../buffer.c:1443:3: runtime error: null pointer passed as argument 2, which is declared to never be null
#0 0x7ffff6cd0410 in evbuffer_pullup ../buffer.c:1443
#1 0x5555556d68b9 in test_evbuffer_remove_buffer_with_empty3 ../test/regress_buffer.c:408
#2 0x5555557b95ee in testcase_run_bare_ ../test/tinytest.c:173
#3 0x5555557ba048 in testcase_run_one ../test/tinytest.c:333
#4 0x5555557bc0f8 in tinytest_main ../test/tinytest.c:527
#5 0x555555787702 in main ../test/regress_main.c:528
#6 0x7ffff606c001 in __libc_start_main (/usr/lib/libc.so.6+0x27001)
#7 0x55555569436d in _start (/src/le/libevent/.cmake-debug/bin/regress+0x14036d)