compat_openssl.h (868B)
1 /* Copyright (c) 2001, Matej Pfajfar. 2 * Copyright (c) 2001-2004, Roger Dingledine. 3 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson. 4 * Copyright (c) 2007-2021, The Tor Project, Inc. */ 5 /* See LICENSE for licensing information */ 6 7 #ifndef TOR_COMPAT_OPENSSL_H 8 #define TOR_COMPAT_OPENSSL_H 9 10 #include "orconfig.h" 11 12 #ifdef ENABLE_OPENSSL 13 14 #include <openssl/opensslv.h> 15 #include "lib/crypt_ops/crypto_openssl_mgt.h" 16 17 /** 18 * \file compat_openssl.h 19 * 20 * \brief compatibility definitions for working with different openssl forks 21 **/ 22 23 /* LibreSSL claims to be OpenSSL 2.0 but lacks this OpenSSL 1.1 API. */ 24 #if defined(LIBRESSL_VERSION_NUMBER) 25 #define RAND_OpenSSL() RAND_SSLeay() 26 #define OSSL_HANDSHAKE_STATE int 27 #endif 28 29 #define tor_OpenSSL_version_num() OpenSSL_version_num() 30 31 #endif /* defined(ENABLE_OPENSSL) */ 32 33 #endif /* !defined(TOR_COMPAT_OPENSSL_H) */