Undefined references to EVP_CIPHER_CTX_cleanup() with OpenSSL 1.1.0 no-deprecated
On my machine with OpenSSL 1.1.0 `no-deprecated', Tor 0.3.4.1-alpha fails to build. The failure happens when linking several utilities, with the following error:
src/common/libor-crypto.a(aes.o): In function `aes_cipher_free_': /home/quentin/Security/Code/Tor/tor/src/common/aes.c:121: undefined reference to `EVP_CIPHER_CTX_cleanup'
This appears to be due to src/common/aes.c not #include-ing "compat_openssl.h", and thus not having the OPENSSL_1_1_API #define. Simply adding
#include "compat_openssl.h" in aes.c fixes the build.
I have also checked that building still succeeds against OpenSSL 1.0.1 and 1.0.2 with this modification.