Tor not compiling after version 0.4.7.13 on FreeBSD?

Tor version 0.4.7.13 was the last version I could get to compile on FreeBSD 13.x and 14.x It is also the latest version in FreeBSD pkg so they may be having a problem building as well.

The version of OpenSSL for FreeBSD 13.x I’m building against is OpenSSL 1.1.1t-freebsd 7 Feb 2023

Has anyone had success compiling 0.4.8.x on FreeBSD 13.2 or 14?

On 0.4.8.6 for example ./configure works with no errors on FreeBSD 13.2 but once I compile I get these errors:

--- src/tools/tor-gencert ---
ld: error: undefined symbol: EVP_PKEY_CTX_set_hkdf_md
>>> referenced by crypto_hkdf.c:93 (src/lib/crypt_ops/crypto_hkdf.c:93)
>>>               libtor_crypt_ops_a-crypto_hkdf.o:(crypto_expand_key_material_rfc5869_sha256) in archive src/lib/libtor-crypt-ops.a
--- src/test/test-ntor-cl ---
--- src/tools/tor-gencert ---

ld: error: undefined symbol: EVP_PKEY_CTX_set1_hkdf_salt
>>> referenced by crypto_hkdf.c:96 (src/lib/crypt_ops/crypto_hkdf.c:96)
>>>               libtor_crypt_ops_a-crypto_hkdf.o:(crypto_expand_key_material_rfc5869_sha256) in archive src/lib/libtor-crypt-ops.a

ld: error: undefined symbol: EVP_PKEY_CTX_set1_hkdf_key
>>> referenced by crypto_hkdf.c:99 (src/lib/crypt_ops/crypto_hkdf.c:99)
>>>               libtor_crypt_ops_a-crypto_hkdf.o:(crypto_expand_key_material_rfc5869_sha256) in archive src/lib/libtor-crypt-ops.a

ld: error: undefined symbol: EVP_PKEY_CTX_add1_hkdf_info
>>> referenced by crypto_hkdf.c:102 (src/lib/crypt_ops/crypto_hkdf.c:102)
>>>               libtor_crypt_ops_a-crypto_hkdf.o:(crypto_expand_key_material_rfc5869_sha256) in archive src/lib/libtor-crypt-ops.a
--- src/test/test-timers ---
--- src/test/libtor-testing.a ---
--- src/test/test-hs-ntor-cl ---
--- src/tools/tor-gencert ---
cc: error: linker command failed with exit code 1 (use -v to see invocation)
--- src/test/libtor-testing.a ---
  AR       src/test/libtor-testing.a
--- src/test/test-ntor-cl ---
  CCLD     src/test/test-ntor-cl
--- src/tools/tor-gencert ---
*** [src/tools/tor-gencert] Error code 1

make[1]: stopped in /root/build/tor-0.4.8.6
--- src/test/test-timers ---
  CCLD     src/test/test-timers
--- src/test/test-hs-ntor-cl ---
  CCLD     src/test/test-hs-ntor-cl
--- src/test/bench.o ---
src/test/bench.c:668:20: warning: 'EC_KEY_new_by_curve_name' is deprecated [-Wdeprecated-declarations]
    EC_KEY *dh_a = EC_KEY_new_by_curve_name(nid);
                   ^
/usr/local/include/openssl/ec.h:1001:1: note: 'EC_KEY_new_by_curve_name' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_by_curve_name(int nid);
^
/usr/local/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/local/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
src/test/bench.c:669:20: warning: 'EC_KEY_new_by_curve_name' is deprecated [-Wdeprecated-declarations]
    EC_KEY *dh_b = EC_KEY_new_by_curve_name(nid);
                   ^
/usr/local/include/openssl/ec.h:1001:1: note: 'EC_KEY_new_by_curve_name' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_by_curve_name(int nid);
^
/usr/local/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/local/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
src/test/bench.c:675:5: warning: 'EC_KEY_generate_key' is deprecated [-Wdeprecated-declarations]
    EC_KEY_generate_key(dh_a);
    ^
/usr/local/include/openssl/ec.h:1104:1: note: 'EC_KEY_generate_key' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int EC_KEY_generate_key(EC_KEY *key);
^
/usr/local/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/local/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
src/test/bench.c:676:5: warning: 'EC_KEY_generate_key' is deprecated [-Wdeprecated-declarations]
    EC_KEY_generate_key(dh_b);
    ^
/usr/local/include/openssl/ec.h:1104:1: note: 'EC_KEY_generate_key' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int EC_KEY_generate_key(EC_KEY *key);
^
/usr/local/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/local/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
src/test/bench.c:677:14: warning: 'ECDH_compute_key' is deprecated [-Wdeprecated-declarations]
    slen_a = ECDH_compute_key(secret_a, DH1024_KEY_LEN,
             ^
/usr/local/include/openssl/ec.h:1299:1: note: 'ECDH_compute_key' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int ECDH_compute_key(void *out, size_t outlen,
^
/usr/local/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/local/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
src/test/bench.c:678:31: warning: 'EC_KEY_get0_public_key' is deprecated [-Wdeprecated-declarations]
                              EC_KEY_get0_public_key(dh_b), dh_a,
                              ^
/usr/local/include/openssl/ec.h:1065:1: note: 'EC_KEY_get0_public_key' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key);
^
/usr/local/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/local/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
src/test/bench.c:680:14: warning: 'ECDH_compute_key' is deprecated [-Wdeprecated-declarations]
    slen_b = ECDH_compute_key(secret_b, DH1024_KEY_LEN,
             ^
/usr/local/include/openssl/ec.h:1299:1: note: 'ECDH_compute_key' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int ECDH_compute_key(void *out, size_t outlen,
^
/usr/local/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/local/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
src/test/bench.c:681:31: warning: 'EC_KEY_get0_public_key' is deprecated [-Wdeprecated-declarations]
                              EC_KEY_get0_public_key(dh_a), dh_b,
                              ^
/usr/local/include/openssl/ec.h:1065:1: note: 'EC_KEY_get0_public_key' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key);
^
/usr/local/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/local/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
src/test/bench.c:686:5: warning: 'EC_KEY_free' is deprecated [-Wdeprecated-declarations]
    EC_KEY_free(dh_a);
    ^
/usr/local/include/openssl/ec.h:1006:1: note: 'EC_KEY_free' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 void EC_KEY_free(EC_KEY *key);
^
/usr/local/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/local/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
src/test/bench.c:687:5: warning: 'EC_KEY_free' is deprecated [-Wdeprecated-declarations]
    EC_KEY_free(dh_b);
    ^
/usr/local/include/openssl/ec.h:1006:1: note: 'EC_KEY_free' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 void EC_KEY_free(EC_KEY *key);
^
/usr/local/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/local/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
--- src/test/test-hs-ntor-cl ---
ld: error: undefined symbol: EVP_PKEY_CTX_set_hkdf_md
>>> referenced by crypto_hkdf.c:93 (src/lib/crypt_ops/crypto_hkdf.c:93)
>>>               libtor_crypt_ops_a-crypto_hkdf.o:(crypto_expand_key_material_rfc5869_sha256) in archive libtor.a
--- src/test/test-ntor-cl ---
ld: error: undefined symbol: EVP_PKEY_CTX_set_hkdf_md
>>> referenced by crypto_hkdf.c:93 (src/lib/crypt_ops/crypto_hkdf.c:93)
>>>               libtor_crypt_ops_a-crypto_hkdf.o:(crypto_expand_key_material_rfc5869_sha256) in archive libtor.a
--- src/test/test-hs-ntor-cl ---

ld: error: undefined symbol: EVP_PKEY_CTX_set1_hkdf_salt
>>> referenced by crypto_hkdf.c:96 (src/lib/crypt_ops/crypto_hkdf.c:96)
>>>               libtor_crypt_ops_a-crypto_hkdf.o:(crypto_expand_key_material_rfc5869_sha256) in archive libtor.a

ld: error: undefined symbol: EVP_PKEY_CTX_set1_hkdf_key
>>> referenced by crypto_hkdf.c:99 (src/lib/crypt_ops/crypto_hkdf.c:99)
>>>               libtor_crypt_ops_a-crypto_hkdf.o:(crypto_expand_key_material_rfc5869_sha256) in archive libtor.a

ld: error: undefined symbol: EVP_PKEY_CTX_add1_hkdf_info
>>> referenced by crypto_hkdf.c:102 (src/lib/crypt_ops/crypto_hkdf.c:102)
>>>               libtor_crypt_ops_a-crypto_hkdf.o:(crypto_expand_key_material_rfc5869_sha256) in archive libtor.a
--- src/test/test-ntor-cl ---

ld: error: undefined symbol: EVP_PKEY_CTX_set1_hkdf_salt
>>> referenced by crypto_hkdf.c:96 (src/lib/crypt_ops/crypto_hkdf.c:96)
>>>               libtor_crypt_ops_a-crypto_hkdf.o:(crypto_expand_key_material_rfc5869_sha256) in archive libtor.a

ld: error: undefined symbol: EVP_PKEY_CTX_set1_hkdf_key
>>> referenced by crypto_hkdf.c:99 (src/lib/crypt_ops/crypto_hkdf.c:99)
>>>               libtor_crypt_ops_a-crypto_hkdf.o:(crypto_expand_key_material_rfc5869_sha256) in archive libtor.a

ld: error: undefined symbol: EVP_PKEY_CTX_add1_hkdf_info
>>> referenced by crypto_hkdf.c:102 (src/lib/crypt_ops/crypto_hkdf.c:102)
>>>               libtor_crypt_ops_a-crypto_hkdf.o:(crypto_expand_key_material_rfc5869_sha256) in archive libtor.a
--- src/test/test-hs-ntor-cl ---
cc: error: linker command failed with exit code 1 (use -v to see invocation)
--- src/test/test-ntor-cl ---
cc: error: linker command failed with exit code 1 (use -v to see invocation)
--- src/test/test-hs-ntor-cl ---
*** [src/test/test-hs-ntor-cl] Error code 1

make[1]: stopped in /root/build/tor-0.4.8.6
--- src/test/test-ntor-cl ---
*** [src/test/test-ntor-cl] Error code 1

make[1]: stopped in /root/build/tor-0.4.8.6
--- src/test/bench.o ---
10 warnings generated.
3 errors

make[1]: stopped in /root/build/tor-0.4.8.6

Hi

My response is about 1 month late and I hope is still of interest, though.

I understood you build on host (not jail) so I tested the following:

  • update a server from 13.0 to 13.2

  • base openssl

# openssl version
OpenSSL 1.1.1t-freebsd  7 Feb 2023
  • port openssl
# /usr/local/bin/openssl version
not found
  • build Tor 4.8.7 on host with default settings, no errors
  Oct 29 23:12:48.082 [notice] Tor 0.4.8.7 running on FreeBSD with \
  Libevent 2.1.12-stable, OpenSSL 3.0.12, Zlib 1.2.13, Liblzma 5.4.1, \
  Libzstd 1.5.5 and BSD 1302001 as libc.
  • port openssl after Tor build
# /usr/local/bin/openssl version
OpenSSL 3.0.12 24 Oct 2023 (Library: OpenSSL 3.0.12 24 Oct 2023)

It seems that Tor does build with security/openssl and neither uses base nor builds with security/openssl111 (3x one). Things might have changed since the op.

Btw currently Tor 4.8.7 pkg runs with OpenSSL 1.1.1t-freebsd 7 Feb 2023 from base.

Cheers, Felix

1 Like