diff options
author | Azat Khuzhin <azat@libevent.org> | 2022-07-09 23:27:23 +0300 |
---|---|---|
committer | Azat Khuzhin <azat@libevent.org> | 2022-07-10 10:07:39 +0300 |
commit | c22f2757449f47ce661b3cdbb8a105d7721b4a5a (patch) | |
tree | c35a2aad764b4f05fe97e7da3c35254a5948d9d8 /sample | |
parent | a29570a1e2d1164f5286bbfe1c6a18e5e87ffc1e (diff) | |
download | libevent-c22f2757449f47ce661b3cdbb8a105d7721b4a5a.tar.gz |
Use OPENSSL_VERSION_NUMBER over OPENSSL_VERSION_MAJOR (for compatibility)
Since OpenSSL 3.0 there is new OPENSSL_VERSION_MAJOR, but previous
releases does not have it.
So let's use plain old OPENSSL_VERSION_NUMBER to avoid more preprocessor
macros.
Diffstat (limited to 'sample')
-rw-r--r-- | sample/becat.c | 4 | ||||
-rw-r--r-- | sample/le-proxy.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sample/becat.c b/sample/becat.c index c6daf90a..501690da 100644 --- a/sample/becat.c +++ b/sample/becat.c @@ -188,7 +188,7 @@ static void ssl_ctx_free(struct ssl_context *ssl) static int ssl_load_key(struct ssl_context *ssl) { int err = 1; -#if OPENSSL_VERSION_MAJOR >= 3 +#if OPENSSL_VERSION_NUMBER >= 0x30000000 ssl->pkey = EVP_RSA_gen(4096); err = ssl->pkey == NULL; #else @@ -391,7 +391,7 @@ static void be_ssl_errors(struct bufferevent *bev) while ((err = bufferevent_get_openssl_error(bev))) { const char *msg = ERR_reason_error_string(err); const char *lib = ERR_lib_error_string(err); -#if OPENSSL_VERSION_MAJOR >= 3 +#if OPENSSL_VERSION_NUMBER >= 0x30000000 error("ssl/err=%d/%s in %s\n", err, msg, lib); #else const char *func = ERR_func_error_string(err); diff --git a/sample/le-proxy.c b/sample/le-proxy.c index 881d3a59..1aa7d648 100644 --- a/sample/le-proxy.c +++ b/sample/le-proxy.c @@ -113,7 +113,7 @@ eventcb(struct bufferevent *bev, short what, void *ctx) ERR_reason_error_string(err); const char *lib = (const char*) ERR_lib_error_string(err); -#if OPENSSL_VERSION_MAJOR >= 3 +#if OPENSSL_VERSION_NUMBER >= 0x30000000 fprintf(stderr, "%s in %s\n", msg, lib); #else |