]> 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)
committerpluknet <pluknet@nginx.com>
Thu, 10 Jul 2025 15:00:45 +0000 (19:00 +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 fc7f26655f49961b732cb6c369e283444dfcdd18..ff604c562d6339037b8b49851d78d5b385ba6a19 100644 (file)
@@ -1374,7 +1374,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 61ce16dab88adbc903d1d7163d82f7aa4d019822..0c9e9e84012015ba78030af24be709cc9383e18d 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