]> git.kaiwu.me - nginx.git/commitdiff
SSL: fixed testing OPENSSL_VERSION_NUMBER for OpenSSL 3.0+.
authorSergey Kandaurov <pluknet@nginx.com>
Tue, 8 Jul 2025 14:07:04 +0000 (18:07 +0400)
committerSergey Kandaurov <s.kandaurov@f5.com>
Tue, 23 Dec 2025 18:40:33 +0000 (22:40 +0400)
Prior to OpenSSL 3.0, OPENSSL_VERSION_NUMBER used the following format:

MNNFFPPS: major minor fix patch status

Where the status nibble (S) has 0+ for development and f for release.

The format was changed in OpenSSL 3.0.0, where it is always zero:

MNN00PP0: major minor patch

src/event/ngx_event_openssl.c
src/event/ngx_event_openssl.h

index 72aadd058b218a859442a23714ef9d55ce7205ae..613a86327cabe00d8a86b5df14c89069c3d9964e 100644 (file)
@@ -1376,7 +1376,7 @@ ngx_ssl_dhparam(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *file)
     if (SSL_CTX_set0_tmp_dh_pkey(ssl->ctx, dh) != 1) {
         ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
                       "SSL_CTX_set0_tmp_dh_pkey(\"%s\") failed", file->data);
-#if (OPENSSL_VERSION_NUMBER >= 0x3000001fL)
+#if (OPENSSL_VERSION_NUMBER >= 0x30000010L)
         EVP_PKEY_free(dh);
 #endif
         BIO_free(bio);
index 3664d37b1fa5e33d3097b0ec063c6fb2339ebe56..fe5107fb6915036dd19c83af7b0aeca3836aab90 100644 (file)
@@ -96,7 +96,7 @@
 #endif
 
 
-#if (OPENSSL_VERSION_NUMBER < 0x3000000fL)
+#if (OPENSSL_VERSION_NUMBER < 0x30000000L)
 #define SSL_group_to_name(s, nid)    NULL
 #endif