b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | --- a/crypto.c |
| 2 | +++ b/crypto.c |
| 3 | @@ -14,6 +14,12 @@ |
| 4 | #include <openssl/pem.h> |
| 5 | #include <openssl/ssl.h> |
| 6 | |
| 7 | +#ifndef OPENSSL_VERSION |
| 8 | +#define OPENSSL_VERSION SSLEAY_VERSION |
| 9 | +#define OpenSSL_version(x) SSLeay_version(x) |
| 10 | +#define OpenSSL_version_num SSLeay |
| 11 | +#endif |
| 12 | + |
| 13 | /* |
| 14 | |
| 15 | This checks data in a struct string against a signature in a second |
| 16 | @@ -250,14 +256,18 @@ bail_out: |
| 17 | void |
| 18 | crypto_init(void) |
| 19 | { |
| 20 | +#if OPENSSL_VERSION_NUMBER < 0x10100000L |
| 21 | /* Just load the crypto library error strings, not SSL */ |
| 22 | ERR_load_crypto_strings(); |
| 23 | +#endif |
| 24 | } |
| 25 | |
| 26 | void |
| 27 | crypto_finish(void) |
| 28 | { |
| 29 | +#if OPENSSL_VERSION_NUMBER < 0x10100000L |
| 30 | ERR_free_strings(); |
| 31 | +#endif |
| 32 | } |
| 33 | |
| 34 | void |
| 35 | @@ -268,10 +278,10 @@ crypto_warn_openssl_version_changed(void |
| 36 | * OpenSSL library used. |
| 37 | * Output a warning if not. |
| 38 | */ |
| 39 | - if (SSLeay() != OPENSSL_VERSION_NUMBER) { |
| 40 | + if (OpenSSL_version_num() != OPENSSL_VERSION_NUMBER) { |
| 41 | log_info("Note: compiled using OpenSSL version '%s' headers, but linked to " |
| 42 | "OpenSSL version '%s' library", |
| 43 | OPENSSL_VERSION_TEXT, |
| 44 | - SSLeay_version(SSLEAY_VERSION)); |
| 45 | + OpenSSL_version(OPENSSL_VERSION)); |
| 46 | } |
| 47 | } |