FoxIO-LLC / ja4-nginx

Nginx fork modified to store some TLS handshake data. Intended for use in conjunction with the ja4-nginx-module: https://github.com/FoxIO-LLC/ja4-nginx-module
https://foxio.io
Other
5 stars 5 forks source link

nginx patch compilation error #2

Open txg911807 opened 4 months ago

txg911807 commented 4 months ago

Error prompt:

src/event/ngx_event_openssl.c: In function ‘ngx_SSL_client_features’: src/event/ngx_event_openssl.c:1831:9: error: ‘for’ loop initial declarations are only allowed in C99 mode for (int i = 0; i < num_sigalgs; ++i) { ^ src/event/ngx_event_openssl.c:1831:9: note: use option -std=c99 or -std=gnu99 to compile your code src/event/ngx_event_openssl.c: In function ‘ngx_SSL_early_cb_fn’: src/event/ngx_event_openssl.c:1883:5: error: ‘for’ loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < ext_len; i++) { ^ src/event/ngx_event_openssl.c:1898:9: error: ‘for’ loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < ext_len; i++) { ^ src/event/ngx_event_openssl.c:1905:17: error: redefinition of ‘i’ for (size_t i = 0; i < ext_len; i++) { ^ src/event/ngx_event_openssl.c:1883:17: note: previous definition of ‘i’ was here for (size_t i = 0; i < ext_len; i++) { ^ src/event/ngx_event_openssl.c:1905:5: error: ‘for’ loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < ext_len; i++) { ^ make[1]: [objs/src/event/ngx_event_openssl.o] Error 1 make[1]: Leaving directory `/home/nginx' make: [build] Error 2

Version information: https://github.com/FoxIO-LLC/ja4-nginx-module(mainhttps://github.com/FoxIO-LLC/ja4-openssl(master) NGINX(1.26)

Execution steps:

./auto/configure \ --add-module=/home/ja4-nginx/ja4-nginx-module/src \ --with-openssl=/home/ja4-nginx/ja4-openssl \ --with-threads \ --with-file-aio \ --with-http_ssl_module \ --with-http_v2_module \ --with-http_realip_module \ --with-http_addition_module \ --with-http_xslt_module=dynamic \ --with-http_image_filter_module=dynamic \ --with-http_geoip_module=dynamic \ --with-http_sub_module \ --with-http_dav_module \ --with-http_flv_module \ --with-http_mp4_module \ --with-http_gunzip_module \ --with-http_gzip_static_module \ --with-http_auth_request_module \ --with-http_random_index_module \ --with-http_secure_link_module \ --with-http_degradation_module \ --with-http_slice_module \ --with-http_stub_status_module \ --with-stream=dynamic \ --with-stream_ssl_module \ --with-stream_realip_module \ --with-stream_geoip_module=dynamic \ --with-stream_ssl_preread_module \ --with-compat \ --with-pcre-jit

make (The original version of nginx compiled properly)

txg911807 commented 4 months ago

Supplementary question:

/home/ja4-nginx/ja4-nginx-module/src/ngx_http_ssl_ja4_module.c: In function ‘ngx_ssl_ja4l_fp’: /home/ja4-nginx/ja4-nginx-module/src/ngx_http_ssl_ja4_module.c:1134:80: error: ‘propagation_delay_factor’ may be used uninitialized in this function [-Werror=maybe-uninitialized] ja4l->distance_miles = (ja4l->handshake_roundtrip_microseconds / 2) * 0.13 / propagation_delay_factor; ^ cc1: all warnings being treated as errors make[1]: [objs/addon/src/ngx_http_ssl_ja4_module.o] Error 1 make[1]: Leaving directory `/home/nginx' make: [build] Error 2

a605226760 commented 4 months ago

I have encountered the same problem:

./ja4-nginx-module/src/ngx_http_ssl_ja4_module.c ./ja4-nginx-module/src/ngx_http_ssl_ja4_module.c: In function ‘ngx_ssl_ja4l_fp’: ./ja4-nginx-module/src/ngx_http_ssl_ja4_module.c:1134:80: error: ‘propagation_delay_factor’ may be used uninitialized in this function [-Werror=maybe-uninitialized] ja4l->distance_miles = (ja4l->handshake_roundtrip_microseconds / 2) * 0.13 / propagation_delay_factor;