b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | --- a/src/libopensc/sc-ossl-compat.h |
| 2 | +++ b/src/libopensc/sc-ossl-compat.h |
| 3 | @@ -101,6 +101,21 @@ extern "C" { |
| 4 | #endif |
| 5 | |
| 6 | /* |
| 7 | + * 1.1.0 depracated ERR_load_crypto_strings(), SSL_load_error_strings(), ERR_free_strings() |
| 8 | + * and ENGINE_load_dynamic.EVP_CIPHER_CTX_cleanup and EVP_CIPHER_CTX_init are replaced |
| 9 | + * by EVP_CIPHER_CTX_reset. |
| 10 | + * But for compatability with LibreSSL and older OpenSSL. OpenSC uses the older functions |
| 11 | + */ |
| 12 | +#if OPENSSL_API_COMPAT >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) |
| 13 | +#define ERR_load_crypto_strings(x) {} |
| 14 | +#define SSL_load_error_strings(x) {} |
| 15 | +#define ERR_free_strings(x) {} |
| 16 | +#define ENGINE_load_dynamic(x) {} |
| 17 | +#define EVP_CIPHER_CTX_cleanup(x) EVP_CIPHER_CTX_reset(x) |
| 18 | +#define EVP_CIPHER_CTX_init(x) EVP_CIPHER_CTX_reset(x) |
| 19 | +#endif |
| 20 | + |
| 21 | +/* |
| 22 | * OpenSSL-1.1.0-pre5 has hidden the RSA and DSA structures |
| 23 | * One can no longer use statements like rsa->n = ... |
| 24 | * Macros and defines don't work on all systems, so use inline versions |