Commit Graph

3829 Commits (f9cd50b782e860b54feee2b0ae8f0279058e85fe)
 

Author SHA1 Message Date
Glenn Strauss f9cd50b782 [core] modify path in-place checking for path-info 2 years ago
Glenn Strauss 81ef66eaf0 [multiple] buffer_has_slash_suffix()
buffer_has_slash_suffix()
buffer_has_pathsep_suffix()
2 years ago
Glenn Strauss 8e093e90f5 [core] http_response_physical_path_error()
consolidate code from error paths in
http_response_physical_path_check() into
http_response_physical_path_error()
2 years ago
Glenn Strauss c636e979e6 [mod_gnutls] quiet clang warning 2 years ago
Glenn Strauss 19bc88850e [multiple] add attrs from gcc -Wsuggest-attribute= 2 years ago
Glenn Strauss fe4310cc61 [mod_dirlisting, mod_trigger_b4_dl] use keyvalue
use keyvalue.[ch] for basic matching

consolidate PCRE logic and leverage PCRE study in keyvalue.[ch]

remove direct link to -lpcre from modules using keyvalue.[ch]
2 years ago
Glenn Strauss 7b9c5adda1 [multiple] PCRE w/ PCRE_STUDY_JIT_COMPILE (fixes #2361)
enabled by default
disable using server.feature-flags += ("server.pcre_jit" => "disable")

Available since pcre-8.20 (2011), and improved in pcre-8.32 (2012),
PCRE_STUDY_JIT_COMPILE can greatly speed up repeated execution of PCRE
patterns.  (https://zherczeg.github.io/sljit/pcre.html)

lighttpd continues to use pcre_exec() instead of pcre_jit_exec(),
even though doing so does not realize all of the performance increase
potentially available with PCRE_STUDY_JIT_COMPILE and pcre_jit_exec().

pcre_jit_exec() is available with PCRE 8.32 and later, if PCRE is
compiled with --enable-jit, but lighttpd does not currently use
pcre_jit_exec() since the PCRE library might not have been compiled
with --enable-jit (though this could be solved with a weak symbol).
Similarly, lighttpd does not currently configure the pcre_jit_stack.

(Using pcre_jit_exec() may be revisited in the future.)

x-ref:
  "add support for pcre JIT"
  https://redmine.lighttpd.net/issues/2361
2 years ago
Glenn Strauss 8845e1e67e [core] defer pcre_compile until after config parse 2 years ago
Glenn Strauss e8de53cb74 [core] fix chunkqueue_small_resp_optim partial rd 2 years ago
Glenn Strauss f5a62a0fd2 [core] http_response_handle_cachable() optim
short-circuit http_response_handle_cachable() if conditional request
headers are not present
2 years ago
Glenn Strauss c035eb7733 [multiple] prefer monotonic time for internal use
(this commit, actually switch to call new func to get monotonic time)
2 years ago
Glenn Strauss ea6e3445a7 [mod_nss] avoid NSS crash w/ config file error
NSS crashes with SIGFPE if SSL_REQUEST_CERTIFICATE is PR_TRUE,
but trust anchors have not been set with SSL_SetTrustAnchors()
(e.g. if ssl.verifyclient.activate = "enable" but ssl.ca-file
      has not been configured in lighttpd.conf)
2 years ago
Glenn Strauss aa81834bc3 [mod_openssl] skip cert chain build if self-issued
If cert is self-issued, then do not attempt to build certificate chain.

(Attempting to build certificate chain when chain is not provided, but
 ssl.ca-file is specified, is provided as backward compatible behavior
 from lighttpd versions prior to lighttpd 1.4.56)
2 years ago
Glenn Strauss 006c5efcf4 [core] optimize buffer_urldecode_path()
remove buffer_urldecode_query() (unused)
query string generally needs to be split on '&'
before decoding '+' and decoding %-encoding

remove int2hex() (unused, and not well-named for nibble-to-hex)
2 years ago
Glenn Strauss dbe3e2361b [multiple] prefer monotonic time for internal use
Note: monotonic time does not change while VM is suspended

Continue to use real time where required by HTTP protocol, for logging
and for other user-visible instances, such as mod_status, as well as for
external databases and caches.
2 years ago
Glenn Strauss fb5e0ff892 [core] check EAGAIN if unix socket connect() delay 2 years ago
Glenn Strauss 8b52995c1d [multiple] use binary '|' to reconstruct ts 2 years ago
Glenn Strauss 8c7dbf1a21 [core] remove stream.[ch]
- remove stream.[ch] (was used only by configfile.c)
- read config files into memory; no big gain from mmap
  (config files are typically small files)
2 years ago
Glenn Strauss 86ede08134 [core] _WIN32 impl of read-only mmap(), munmap() 2 years ago
Glenn Strauss ac1fee6b30 [core] adjust stat_cache_get_entry() conditions 2 years ago
Glenn Strauss 03cf18ab8e [core] use epoll_create1() if available 2 years ago
Glenn Strauss 574c47ee66 [core] add some ifdefs in algo_hmac.c 2 years ago
Glenn Strauss b9e1e93fb1 [core] http_cgi_encode_varname()
move and rename from buffer.c to http_cgi.c:
buffer_copy_string_encoded_cgi_varnames() -> http_cgi_encode_varname()
2 years ago
Glenn Strauss 5c2f5577b4 [core] save parsed listen addrs at startup
save parsed listen addrs at startup for reuse at runtime

srv_socket->srv_token is normalized at startup and contains IP and port.
save offset to colon, if present, or else length of string (unix socket)

At runtime, srv_token_colon can be quickly used as length of IP string
(without port) or, if not length of string, offset of stringified port
following the colon.
2 years ago
Glenn Strauss c95f832f99 [core] http_cgi.[ch] CGI interfaces (RFC 3875)
collect Common Gateway Interface (CGI) interfaces (RFC 3875)
2 years ago
Glenn Strauss 1f96e59d03 [core] http_cgi_local_redir() rename
rename http_response_process_local_redir() -> http_cgi_local_redir()

adjust some checks for local redir
2 years ago
Glenn Strauss 7138de92f9 [core] quiet coverity warning 2 years ago
Glenn Strauss c6304bb43c [mod_openssl] use newer openssl 3.0.0 interfaces
avoid interfaces deprecated in openssl 3.0.0

some newer interfaces might be present in openssl 1.1.1,
but might not be present in alt TLS libs (libressl or boringssl),
so retrict use to >= openssl 3.0.0
2 years ago
Glenn Strauss af7c054b51 [core] ignore server.event-handler = "libev"
ignore server.event-handler = "libev" if lighttpd not built with libev
(no longer an error)

On most platforms, native event handling in lighttpd is more performant
than the overhead of libev, which usually uses the same underlying
OS system interface for event notification
2 years ago
Glenn Strauss bc3a2b4e47 [TLS] fix crash for (broken) nested $SERVER[] cfg
fix crash for (broken) nested $SERVER["socket"] config

$SERVER["socket"] belongs in the global scope and should not be
nested in any other conditional config logic.  Even so, lighttpd
should not crash when such misconfiguration occurs.

x-ref:
  "Lighttpd multiple SSL hosts using Server Name Indication (SNI)"
  https://redmine.lighttpd.net/boards/2/topics/9612
2 years ago
Glenn Strauss cc35c03c3c [core] RFC 7233 Range handling for non-streaming
RFC 7233 Range handling for all non-streaming responses,
including (non-streaming) dynamic responses

(previously Range responses handled only for static files)
2 years ago
Glenn Strauss d68e639b71 [core] http_range.[ch] RFC 7233 Range handling
(import from one of my development branches from 2015)
2 years ago
Glenn Strauss ce74705cea [core] chunkqueue_append_cq_range() 2 years ago
Glenn Strauss 7df6fb5ec8 [mod_deflate] do not cache 206 Partial Content 2 years ago
Glenn Strauss 12ac70d0fe [mod_auth] send 401 if digest algo not supported
client browsers might remember prior algorithm if algorithm changed;
send 401 Unauthorized to reset client browser
(sending 400 Bad Request was not user friendly)
2 years ago
Glenn Strauss a1bb0c0d52 [autoconf] add ajp13 to build msgs 2 years ago
Glenn Strauss 8bf9dac1f5 [mod_secdownload] use http_auth_const_time_memeq()
code reuse
2 years ago
Glenn Strauss dda40a15df [mod_secdownload] use algo_hmac.[ch] 2 years ago
Glenn Strauss c5003c26c8 [core] algo_hmac.[ch] wrapper (portability)
hash-based message authentication code (HMAC) wrapper
2 years ago
Glenn Strauss 830d7e0561 [core] fix -fsanitize=undefined pedantic warning (fixes #3069)
cast to unsigned before << 4 to avoid (pedantic) undefined behavior
of (time_t) (which is signed integral type) on 32-bit signed time_t
The high bit gets shifted into the sign-bit, which is technically
undefined behavior in C, but is defined behavior in C++.

x-ref:
  "pedantic warning from -fsanitize=undefined"
  https://redmine.lighttpd.net/issues/3069
2 years ago
Glenn Strauss f9ff15a013 [core] mark config registration funcs cold 2 years ago
Glenn Strauss b59b17aaec [core] rename local var 2 years ago
Glenn Strauss 086945bfb0 [core] allow '*' in "*:80" socket spec 2 years ago
Glenn Strauss 28fc51c747 [build] augment configure.ac msgs to remove FAM (#3068)
augment configure.ac msgs to remove FAM on linux and *bsd

x-ref:
  "stat-cache-fam feature appears disabled since 1.4.56"
  https://redmine.lighttpd.net/issues/3068
2 years ago
Glenn Strauss 46269cf3a3 [mod_mbedtls] preproc wrap ssl_parse_client_hello
wrap ssl_parse_client_hello() with preprocessor definitions
2 years ago
Glenn Strauss 457d78c6e1 [build] use -pipe with gcc and clang 2 years ago
Glenn Strauss 603a1fa573 [core] inline funcs to decode h2 framing nums (fixes #3067)
cast high uint8_t byte to uint32_t before bit shifting << 24 to avoid
(pedantic) undefined behavior of uint8_t byte with high bit set when
it is promoted to int and then bit-shifted left 24 bytes.  The high bit
gets shifted into the sign-bit, which is technically undefined behavior
in C, but is defined behavior in C++.

x-ref:
  "pedantic warning from -fsanitize=undefined"
  https://redmine.lighttpd.net/issues/3067
2 years ago
Glenn Strauss 165600498b [build] fix SCons pkg-config err handling (fixes #3066)
(thx elchenberg)

x-ref:
  "OSError in SConstruct on Alpine Linux"
  https://redmine.lighttpd.net/issues/3066
2 years ago
Glenn Strauss 4a600dabd5 [mod_auth] close HTTP/2 connection after bad pass
mitigation slows down brute force password attacks

x-ref:
  "Possible feature: authentication brute force hardening"
  https://redmine.lighttpd.net/boards/3/topics/8885
2 years ago
Glenn Strauss dc4ff14c1f [tests] remove stray option in test lighttpd.conf 2 years ago