Hi ports@, The attached patch gets net/tor 0.2.9.9 building and passing tests again on -current. I believe it would also be acceptable to upstream. It is also required to test the Tor Browser 6.5 update, which I will post next.
Feedback most welcome. Pax, -A -- https://haqistan.net/~attila | attila@{stalphonsos.com,haqistan.net} pgp: 0x62A729CF | C2CE 2487 03AC 4C2F 101D 09C1 4068 D5D5 62A7 29CF
Index: tor/patches/patch-src_test_test_tortls_c =================================================================== RCS file: tor/patches/patch-src_test_test_tortls_c diff -N tor/patches/patch-src_test_test_tortls_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ tor/patches/patch-src_test_test_tortls_c 26 Jan 2017 17:54:19 -0000 @@ -0,0 +1,65 @@ +$OpenBSD$ + +OPENSSL_OPAQUE should be turned on for LibreSSL as of r1.114 of ssl.h +Also hoist a function used by OPAQUE tests out of an #ifndef OPAQUE +--- src/test/test_tortls.c.orig Thu Jan 26 11:51:15 2017 ++++ src/test/test_tortls.c Thu Jan 26 12:50:07 2017 +@@ -46,6 +46,10 @@ ENABLE_GCC_WARNING(redundant-decls) + #define SSL_STATE_STR "before/accept initialization" + #endif + ++#if defined(LIBRESSL_VERSION_NUMBER) ++#define OPENSSL_OPAQUE ++#endif ++ + #ifndef OPENSSL_OPAQUE + static SSL_METHOD * + give_me_a_test_method(void) +@@ -723,6 +727,23 @@ test_tortls_get_my_certs(void *ignored) + (void)1; + } + ++static SSL_CIPHER * ++get_cipher_by_name(const char *name) ++{ ++ int i; ++ const SSL_METHOD *method = SSLv23_method(); ++ int num = method->num_ciphers(); ++ for (i = 0; i < num; ++i) { ++ const SSL_CIPHER *cipher = method->get_cipher(i); ++ const char *ciphername = SSL_CIPHER_get_name(cipher); ++ if (!strcmp(ciphername, name)) { ++ return (SSL_CIPHER *)cipher; ++ } ++ } ++ ++ return NULL; ++} ++ + #ifndef OPENSSL_OPAQUE + static void + test_tortls_get_ciphersuite_name(void *ignored) +@@ -739,23 +760,6 @@ test_tortls_get_ciphersuite_name(void *ignored) + done: + tor_free(ctx->ssl); + tor_free(ctx); +-} +- +-static SSL_CIPHER * +-get_cipher_by_name(const char *name) +-{ +- int i; +- const SSL_METHOD *method = SSLv23_method(); +- int num = method->num_ciphers(); +- for (i = 0; i < num; ++i) { +- const SSL_CIPHER *cipher = method->get_cipher(i); +- const char *ciphername = SSL_CIPHER_get_name(cipher); +- if (!strcmp(ciphername, name)) { +- return (SSL_CIPHER *)cipher; +- } +- } +- +- return NULL; + } + + static SSL_CIPHER *