Created attachment 179675 [details] patch Building tor with libressl-devel currently graciously fails: src/test/test_tortls.c:449:13: error: no member named 'rwstate' in 'struct ssl_st' tls->ssl->rwstate = SSL_READING; ~~~~~~~~ ^ src/test/test_tortls.c:457:13: error: no member named 'rwstate' in 'struct ssl_st' tls->ssl->rwstate = SSL_READING; ~~~~~~~~ ^ src/test/test_tortls.c:465:13: error: no member named 'rwstate' in 'struct ssl_st' tls->ssl->rwstate = 0; ~~~~~~~~ ^ src/test/test_tortls.c:466:13: error: no member named 'shutdown' in 'struct ssl_st' tls->ssl->shutdown = SSL_RECEIVED_SHUTDOWN; ~~~~~~~~ ^ src/test/test_tortls.c:467:17: error: no member named 'warn_alert' in 'struct ssl3_state_st' tls->ssl->s3->warn_alert =SSL_AD_CLOSE_NOTIFY; ~~~~~~~~~~~~ ^ src/test/test_tortls.c:1138:11: error: no member named 'ssl_pending' in 'struct ssl_method_st' method->ssl_pending = fixed_ssl_pending; ~~~~~~ ^ src/test/test_tortls.c:1412:22: error: no member named 'sess_cert' in 'struct ssl_session_st' tls->ssl->session->sess_cert = (void *)sess; ~~~~~~~~~~~~~~~~~ ^ src/test/test_tortls.c:1552:24: error: no member named 'tls_session_secret_cb' in 'struct ssl_st' tt_assert(!tls->ssl->tls_session_secret_cb); ~~~~~~~~ ^ ./src/ext/tinytest_macros.h:111:37: note: expanded from macro 'tt_assert' #define tt_assert(b) tt_assert_msg((b), "assert("#b")") ^ ./src/ext/tinytest_macros.h:106:11: note: expanded from macro 'tt_assert_msg' tt_want_(b, msg, TT_EXIT_TEST_FUNCTION); ^ ./src/ext/tinytest_macros.h:91:8: note: expanded from macro 'tt_want_' if (!(b)) { \ ^ src/test/test_tortls.c:1561:24: error: no member named 'tls_session_secret_cb' in 'struct ssl_st' tt_assert(!tls->ssl->tls_session_secret_cb); ~~~~~~~~ ^ ./src/ext/tinytest_macros.h:111:37: note: expanded from macro 'tt_assert' #define tt_assert(b) tt_assert_msg((b), "assert("#b")") ^ ./src/ext/tinytest_macros.h:106:11: note: expanded from macro 'tt_assert_msg' tt_want_(b, msg, TT_EXIT_TEST_FUNCTION); ^ ./src/ext/tinytest_macros.h:91:8: note: expanded from macro 'tt_want_' if (!(b)) { \ ^ src/test/test_tortls.c:1685:23: error: no member named 'info_callback' in 'struct ssl_st' tt_assert(tls->ssl->info_callback == tor_tls_server_info_callback); ~~~~~~~~ ^ ./src/ext/tinytest_macros.h:111:37: note: expanded from macro 'tt_assert' #define tt_assert(b) tt_assert_msg((b), "assert("#b")") ^ ./src/ext/tinytest_macros.h:106:11: note: expanded from macro 'tt_assert_msg' tt_want_(b, msg, TT_EXIT_TEST_FUNCTION); ^ ./src/ext/tinytest_macros.h:91:8: note: expanded from macro 'tt_want_' if (!(b)) { \ ^ src/test/test_tortls.c:1688:23: error: no member named 'info_callback' in 'struct ssl_st' tt_assert(tls->ssl->info_callback == tor_tls_debug_state_callback); ~~~~~~~~ ^ ./src/ext/tinytest_macros.h:111:37: note: expanded from macro 'tt_assert' #define tt_assert(b) tt_assert_msg((b), "assert("#b")") ^ ./src/ext/tinytest_macros.h:106:11: note: expanded from macro 'tt_assert_msg' tt_want_(b, msg, TT_EXIT_TEST_FUNCTION); ^ ./src/ext/tinytest_macros.h:91:8: note: expanded from macro 'tt_want_' if (!(b)) { \ ^ src/test/test_tortls.c:1936:11: error: no member named 'ssl_read' in 'struct ssl_method_st' method->ssl_read = fixed_ssl_read; ~~~~~~ ^ src/test/test_tortls.c:1937:11: error: no member named 'ssl_shutdown' in 'struct ssl_method_st' method->ssl_shutdown = fixed_ssl_shutdown; ~~~~~~ ^ src/test/test_tortls.c:2048:13: error: no member named 'handshake_func' in 'struct ssl_st' tls->ssl->handshake_func = dummy_handshake_func; ~~~~~~~~ ^ src/test/test_tortls.c:2050:11: error: no member named 'ssl_read' in 'struct ssl_method_st' method->ssl_read = fixed_ssl_read; ~~~~~~ ^ src/test/test_tortls.c:2128:11: error: no member named 'ssl_write' in 'struct ssl_method_st' method->ssl_write = fixed_ssl_write; ~~~~~~ ^ src/test/test_tortls.c:2129:13: error: no member named 'handshake_func' in 'struct ssl_st' tls->ssl->handshake_func = dummy_handshake_func; ~~~~~~~~ ^ src/test/test_tortls.c:2137:13: error: no member named 'rwstate' in 'struct ssl_st' tls->ssl->rwstate = SSL_READING; ~~~~~~~~ ^ src/test/test_tortls.c:2144:13: error: no member named 'rwstate' in 'struct ssl_st' tls->ssl->rwstate = SSL_READING; ~~~~~~~~ ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. The attached patch fixes those errors, allowing the port to be built with {open,libre}ssl{,devel}. It's based on the patch used in OpenBSD ports.
Do you have the URL for this code in OpenBSD?
(In reply to Yuri Victorovich from comment #1) https://github.com/openbsd/ports/blob/master/net/tor/patches/patch-src_test_test_tortls_c
Thanks!
Created attachment 180050 [details] svn diff for security/tor security/tor: Fix SSL option and LibreSSL 2.5 - Modify --with-ssl option as per --help output - Add LibreSSL 2.5.1 patch from OpenBSD The patch is re-rolled with makepatch, annotated with original source
Created attachment 181002 [details] fix build of security/tor with libressl-devel I reworked the patch to correctly handle all versions of both libraries and took care to check LIBRESSL_VERSION_NUMBER is defined before checking its value. I have verified tor with my patch builds with openssl, openssl-devel, libressl, and libressl-devel. Only the last one of those should be affected by this patch. Also, --with-openssl-dir appears to be correct. from configure --help: --with-ssl-dir=PATH obsolete alias for --with-openssl-dir --with-openssl-dir=PATH specify path to openssl installation
This patch is no longer needed with the most recent update to security/tor.