Tor- won't compile on OpenBSD 7.1

The sources for Tor (and earlier releases) will not compile on OpenBSD 7.1.

The OpenSSL version is: LibreSSL 3.5.2 .

The error returned is:

src/test/test_crypto_openssl.c:64:25: error: invalid application of ‘sizeof’ to an incomplete type ‘EVP_ENCODE_CTX’ (aka ‘struct evp_Encode_Ctx_st’)
src/test/test_crypto_openssl.c:53:46: note: expanded from macro ‘EVP_ENCODE_CTX_new’
#define EVP_ENCODE_CTX_new() tor_malloc_zero(sizeof(EVP_ENCODE_CTX))
^ ~~~~~~~~~~~~~~~~
./src/lib/malloc/malloc.h:59:49: note: expanded from macro ‘tor_malloc_zero’
#define tor_malloc_zero(size) tor_malloc_zero_(size)
/usr/include/openssl/ossl_typ.h:112:16: note: forward declaration of ‘struct evp_Encode_Ctx_st’
typedef struct evp_Encode_Ctx_st EVP_ENCODE_CTX;
1 error generated.
*** Error 1 in target ‘src/test/test-test_crypto_openssl.o’
*** Error 1 in . (Makefile:22364 ‘src/test/test-test_crypto_openssl.o’: @echo "
CC " src/test/test-test_crypto_openssl.o;cc -DHAVE_CON…)
*** Error 2 in /home/kheper/sources/tor- (Makefile:7468 ‘all’)

Hello and welcome to the Tor community forum.

What prevents you from using the ports tree version of Tor here? It’s my impression that it’s updated to They do apply some patches specifically related to the LibreSSL implementation that provides libssl and libcrypto on OpenBSD.


Nothing prevents me from using OpenBSD’s Tor package or port. A few programs, I like to compile by hand - tor being one of them. In the past, OpenBSD’s Tor package was far out of date. The 7.1 package version is I’ll apply the patches in the ports tree to the sources, then compile again. Thanks.

Excellent. Let us know if that doesn’t work out for you.


This topic was automatically closed 2 hours after the last reply. New replies are no longer allowed.

Please see this message from Gman999: