SSL: fixed MSVC compilation after ebd18ec181.

MSVC generates a compilation error in case #if/#endif is used in a macro
parameter.
This commit is contained in:
蕭澧邦 2024-11-03 14:36:17 +08:00 committed by Roman Arutyunyan
parent 29aec5720f
commit ea15896c1a
7 changed files with 42 additions and 14 deletions

View File

@ -4475,12 +4475,16 @@ ngx_http_grpc_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_value(conf->upstream.ssl_session_reuse, ngx_conf_merge_value(conf->upstream.ssl_session_reuse,
prev->upstream.ssl_session_reuse, 1); prev->upstream.ssl_session_reuse, 1);
#ifndef SSL_OP_NO_TLSv1_2
ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols, ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols,
(NGX_CONF_BITMASK_SET (NGX_CONF_BITMASK_SET
#ifndef SSL_OP_NO_TLSv1_2
|NGX_SSL_TLSv1|NGX_SSL_TLSv1_1 |NGX_SSL_TLSv1|NGX_SSL_TLSv1_1
#endif
|NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3)); |NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
#else
ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols,
(NGX_CONF_BITMASK_SET
|NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
#endif
ngx_conf_merge_str_value(conf->ssl_ciphers, prev->ssl_ciphers, ngx_conf_merge_str_value(conf->ssl_ciphers, prev->ssl_ciphers,
"DEFAULT"); "DEFAULT");

View File

@ -3942,12 +3942,16 @@ ngx_http_proxy_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_value(conf->upstream.ssl_session_reuse, ngx_conf_merge_value(conf->upstream.ssl_session_reuse,
prev->upstream.ssl_session_reuse, 1); prev->upstream.ssl_session_reuse, 1);
#ifndef SSL_OP_NO_TLSv1_2
ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols, ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols,
(NGX_CONF_BITMASK_SET (NGX_CONF_BITMASK_SET
#ifndef SSL_OP_NO_TLSv1_2
|NGX_SSL_TLSv1|NGX_SSL_TLSv1_1 |NGX_SSL_TLSv1|NGX_SSL_TLSv1_1
#endif
|NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3)); |NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
#else
ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols,
(NGX_CONF_BITMASK_SET
|NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
#endif
ngx_conf_merge_str_value(conf->ssl_ciphers, prev->ssl_ciphers, ngx_conf_merge_str_value(conf->ssl_ciphers, prev->ssl_ciphers,
"DEFAULT"); "DEFAULT");

View File

@ -651,12 +651,16 @@ ngx_http_ssl_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_value(conf->early_data, prev->early_data, 0); ngx_conf_merge_value(conf->early_data, prev->early_data, 0);
ngx_conf_merge_value(conf->reject_handshake, prev->reject_handshake, 0); ngx_conf_merge_value(conf->reject_handshake, prev->reject_handshake, 0);
#ifndef SSL_OP_NO_TLSv1_2
ngx_conf_merge_bitmask_value(conf->protocols, prev->protocols, ngx_conf_merge_bitmask_value(conf->protocols, prev->protocols,
(NGX_CONF_BITMASK_SET (NGX_CONF_BITMASK_SET
#ifndef SSL_OP_NO_TLSv1_2
|NGX_SSL_TLSv1|NGX_SSL_TLSv1_1 |NGX_SSL_TLSv1|NGX_SSL_TLSv1_1
#endif
|NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3)); |NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
#else
ngx_conf_merge_bitmask_value(conf->protocols, prev->protocols,
(NGX_CONF_BITMASK_SET
|NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
#endif
ngx_conf_merge_size_value(conf->buffer_size, prev->buffer_size, ngx_conf_merge_size_value(conf->buffer_size, prev->buffer_size,
NGX_SSL_BUFSIZE); NGX_SSL_BUFSIZE);

View File

@ -1877,12 +1877,16 @@ ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_value(conf->upstream.ssl_session_reuse, ngx_conf_merge_value(conf->upstream.ssl_session_reuse,
prev->upstream.ssl_session_reuse, 1); prev->upstream.ssl_session_reuse, 1);
#ifndef SSL_OP_NO_TLSv1_2
ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols, ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols,
(NGX_CONF_BITMASK_SET (NGX_CONF_BITMASK_SET
#ifndef SSL_OP_NO_TLSv1_2
|NGX_SSL_TLSv1|NGX_SSL_TLSv1_1 |NGX_SSL_TLSv1|NGX_SSL_TLSv1_1
#endif
|NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3)); |NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
#else
ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols,
(NGX_CONF_BITMASK_SET
|NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
#endif
ngx_conf_merge_str_value(conf->ssl_ciphers, prev->ssl_ciphers, ngx_conf_merge_str_value(conf->ssl_ciphers, prev->ssl_ciphers,
"DEFAULT"); "DEFAULT");

View File

@ -343,12 +343,16 @@ ngx_mail_ssl_merge_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_value(conf->prefer_server_ciphers, ngx_conf_merge_value(conf->prefer_server_ciphers,
prev->prefer_server_ciphers, 0); prev->prefer_server_ciphers, 0);
#ifndef SSL_OP_NO_TLSv1_2
ngx_conf_merge_bitmask_value(conf->protocols, prev->protocols, ngx_conf_merge_bitmask_value(conf->protocols, prev->protocols,
(NGX_CONF_BITMASK_SET (NGX_CONF_BITMASK_SET
#ifndef SSL_OP_NO_TLSv1_2
|NGX_SSL_TLSv1|NGX_SSL_TLSv1_1 |NGX_SSL_TLSv1|NGX_SSL_TLSv1_1
#endif
|NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3)); |NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
#else
ngx_conf_merge_bitmask_value(conf->protocols, prev->protocols,
(NGX_CONF_BITMASK_SET
|NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
#endif
ngx_conf_merge_uint_value(conf->verify, prev->verify, 0); ngx_conf_merge_uint_value(conf->verify, prev->verify, 0);
ngx_conf_merge_uint_value(conf->verify_depth, prev->verify_depth, 1); ngx_conf_merge_uint_value(conf->verify_depth, prev->verify_depth, 1);

View File

@ -2181,12 +2181,16 @@ ngx_stream_proxy_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_value(conf->ssl_session_reuse, ngx_conf_merge_value(conf->ssl_session_reuse,
prev->ssl_session_reuse, 1); prev->ssl_session_reuse, 1);
#ifndef SSL_OP_NO_TLSv1_2
ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols, ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols,
(NGX_CONF_BITMASK_SET (NGX_CONF_BITMASK_SET
#ifndef SSL_OP_NO_TLSv1_2
|NGX_SSL_TLSv1|NGX_SSL_TLSv1_1 |NGX_SSL_TLSv1|NGX_SSL_TLSv1_1
#endif
|NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3)); |NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
#else
ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols,
(NGX_CONF_BITMASK_SET
|NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
#endif
ngx_conf_merge_str_value(conf->ssl_ciphers, prev->ssl_ciphers, "DEFAULT"); ngx_conf_merge_str_value(conf->ssl_ciphers, prev->ssl_ciphers, "DEFAULT");

View File

@ -882,12 +882,16 @@ ngx_stream_ssl_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_value(conf->reject_handshake, prev->reject_handshake, 0); ngx_conf_merge_value(conf->reject_handshake, prev->reject_handshake, 0);
#ifndef SSL_OP_NO_TLSv1_2
ngx_conf_merge_bitmask_value(conf->protocols, prev->protocols, ngx_conf_merge_bitmask_value(conf->protocols, prev->protocols,
(NGX_CONF_BITMASK_SET (NGX_CONF_BITMASK_SET
#ifndef SSL_OP_NO_TLSv1_2
|NGX_SSL_TLSv1|NGX_SSL_TLSv1_1 |NGX_SSL_TLSv1|NGX_SSL_TLSv1_1
#endif
|NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3)); |NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
#else
ngx_conf_merge_bitmask_value(conf->protocols, prev->protocols,
(NGX_CONF_BITMASK_SET
|NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
#endif
ngx_conf_merge_uint_value(conf->verify, prev->verify, 0); ngx_conf_merge_uint_value(conf->verify, prev->verify, 0);
ngx_conf_merge_uint_value(conf->verify_depth, prev->verify_depth, 1); ngx_conf_merge_uint_value(conf->verify_depth, prev->verify_depth, 1);