Commit Graph

3972 Commits (1a8ac120b49132f8983400f1817a6b8bd1f31188)
 

Author SHA1 Message Date
Glenn Strauss a0b615acd9 [core] http_date_timegm() (portable timegm())
move from mod_openssl.c
2 years ago
Glenn Strauss 122094e3e3 [multiple] employ http_date.h, sys-time.h
- replace use of strptime() w/ implementation specialized for HTTP dates
- use thread-safe gmtime_r(), localtime_r() (replace localtime, gmtime)
2 years ago
Glenn Strauss 48a8e893a7 [core] specialized strptime() for HTTP date fmts 2 years ago
Glenn Strauss f8cc9fb915 [core] http_date.[ch] encapsulate HTTP-date parse
http_date.[ch] encapsulate HTTP-date parse/compare

(import from one of my development branches from 2015)
2 years ago
Glenn Strauss f928f6d827 [core] sys-time.h - localtime_r,gmtime_r macros
sys-time.h - localtime_r,gmtime_r macros if needed

provide rudimentary localtime_r() and gmtime_r() if not present
(wraps localtime() and gmtime() funtions, but are not thread-safe since
 they do not take a lock around access to localtime() and gmtime())

(import from one of my development branches from 2015)
2 years ago
Glenn Strauss 29f50bdeb0 [multiple] fdevent_waitpid() wrapper 2 years ago
Glenn Strauss 2ecbe5948d [mod_proxy] fix sending of initial reqbody chunked
fix sending of initial reqbody chunked to backend
2 years ago
Glenn Strauss ceab1e700d [core] add comment for FastCGI mem use in hctx->rb (#3033)
x-ref:
  "Memory Growth with PUT and full buffered streams"
  https://redmine.lighttpd.net/issues/3033
2 years ago
Glenn Strauss 7ba521ffb4 [core] reuse large mem chunks (fix mem usage) (fixes #3033)
(thx flynn)

fix large memory usage for large file downloads from dynamic backends

reuse or release large memory chunks

x-ref:
  "Memory Growth with PUT and full buffered streams"
  https://redmine.lighttpd.net/issues/3033
2 years ago
Glenn Strauss b598bb53f9 [tests] remove FastCGI test dependency on PHP 2 years ago
Glenn Strauss 89a3987ce7 [core] prefer IPv6+IPv4 func vs IPv4-specific func 2 years ago
Glenn Strauss fc01b820ec [tests] remove FastCGI test dependency on libfcgi
- rewrite fcgi-responder as standalone app
  fcgi-responder is now a minimal, standalone FastCGI server for tests
- remove dependency on fcgi-devel package
- merge fcgi-auth into fcgi-responder
2 years ago
Glenn Strauss c68a7b4552 [tests] collect code for "die-at-end" tests 3 years ago
Glenn Strauss 0bff6d58bc [mod_wolfssl] compile with earlier wolfSSL vers
compatibility to compile with earlier wolfSSL versions

compile-tested back to wolfSSL tag v3.14.0-stable
configured with (possibly extra flags)
  ./configure --enable-opensslextra --enable-opensslall --enable-sni \
    --enable-lighty --enable-stunnel --enable-nginx --enable-haproxy

Functionality has not been tested!
Please consider using the latest stable release of wolfSSL.
3 years ago
Glenn Strauss 6cf92dffe3 [mod_wolfssl] use wolfSSL TLS version defines
now that mod_wolfssl is a standalone module, use wolfSSL TLS ver defines

(Increase compatibility of mod_wolfssl with wolfSSL versions prior to
 wolfSSL v4.2.0)
3 years ago
Glenn Strauss ae77d8ae6e - next is 1.4.58 3 years ago
Glenn Strauss 91250ee0bd [doc] NEWS 3 years ago
Glenn Strauss 881d05076a [core] attempt to quiet some coverity warnings 3 years ago
Glenn Strauss cabced1f9f [core] fix decoding chunked from backend (fixes #3049)
(thx flynn)

fix decoding chunked from backend

truncate response and error out if backend sends excess data
after chunked encoding

x-ref:
  "Too much content with HTTP/2.0"
  https://redmine.lighttpd.net/issues/3049
3 years ago
Glenn Strauss eda12aee22 [core] fix crash printing trace if backend is down 3 years ago
Glenn Strauss 76faed9145 [multiple] replace fall through comment with attr
replace /* fall through */ comment with __attribute_fallthrough__ macro

Note: not adding attribute to code with external origins:
  xxhash.h (algo_xxhash.h)
  ls-hpack/lshpack.c
so to avoid warnings, may need to compile with -Wno-implicit-fallthrough
3 years ago
Glenn Strauss fefdf7f097 [core] fix array_copy_array() sorted[]
fix array_copy_array() sorted[]
(current use appears to be only on value lists; not user-visible issue)

Some time back, sorted[] was a set of indexes into data[],
and therefore sorted[] could be copied when copying array.
Now that sorted[] is a list of pointers, the sorted[] list
must be rebuilt.  If copied, it continued to point to
(data_unset *) from the original src array, not the dst array.
3 years ago
Glenn Strauss 20b54fa918 [mod_authn_ldap, mod_vhostdb_ldap] default cafile
set default cafile at startup if cafile configured in global scope
3 years ago
Glenn Strauss 2565ad1b86 [mod_authn_ldap] fix crash (fixes #3048)
(thx mgottinger)

fix crash due to uninitialized memory during config parsing

x-ref:
  "Broken LDAP authentication on lighttpd 1.4.56"
  https://redmine.lighttpd.net/issues/3048
3 years ago
Glenn Strauss fe5740d5e5 [mod_proxy] proxy.header = ("force-http10" => ...)
compatibility option to force HTTP/1.0 requests to mod_proxy backend
proxy.header += ("force-http10" => "disable")  (default)

If proxy.header is set (for any options), it overrides the global
server.feature-flags += ("proxy.force-http10" => "disable")
3 years ago
Glenn Strauss bbd958382e [core] reorder srv->config_context to match ndx (fixes #3047)
(thx altblue)

reorder dc->context_ndx to match srv->config_context->data[] index.
srv->config_context->data[] may have been re-ordered in configparser.y.
Since the dc->context_ndx (id) is reused by config_insert*() and by
plugins to index into srv->config_context->data[], reorder into the
order encountered during config file parsing for least surprise to
end-users writing config files.

x-ref:
  "mismatched nested config conditions in lighttpd 1.4.56"
  https://redmine.lighttpd.net/issues/3047
3 years ago
Glenn Strauss b467ba1bbf [core] enhance config parsing debugging (#3047)
enhance config parsing debugging to add condition string

x-ref:
  "mismatched nested config conditions in lighttpd 1.4.56"
  https://redmine.lighttpd.net/issues/3047
3 years ago
Glenn Strauss 903024d711 [core] track Content-Length from backend (fixes #3046)
track Content-Length from backend in r->resp_body_scratchpad

x-ref:
  "Failure on second request in http proxy backend"
  https://redmine.lighttpd.net/issues/3046
3 years ago
Glenn Strauss e9309ae6e6 [core] li_restricted_strtoint64()
(make public for reuse)
3 years ago
Glenn Strauss 167513c840 [core] track chunked encoding state from backend (fixes #3046)
(thx flynn)

track chunked encoding state when parsing backend response

x-ref:
  "Failure on second request in http proxy backend"
  https://redmine.lighttpd.net/issues/3046
3 years ago
Glenn Strauss 3230c6ef17 [core] reject excess data after chunked encoding (#3046)
reject excess data after chunked encoding when parsing backend response

x-ref:
  "Failure on second request in http proxy backend"
  https://redmine.lighttpd.net/issues/3046
3 years ago
Glenn Strauss 163cb8be28 [core] fix chunked decoding from backend (fixes #3044)
(thx flynn)

x-ref:
  "Socket errors after update to version 1.4.56"
  https://redmine.lighttpd.net/issues/3044
3 years ago
Glenn Strauss 4933a2259b [core] warn if mod_authn_file needed in conf
warn if mod_authn_file is not listed in lighttpd.conf, but is needed
3 years ago
Glenn Strauss a360eafc8b [mod_nss] portability fix
check if NSS supports TLSv1.3 ciphers
(very old versions do not, and admins should consider upgrading NSS)
3 years ago
Glenn Strauss 1d73fc2329 [core] portability fix if st_mtime not defined 3 years ago
Glenn Strauss 8a2f9c1173 [TLS] cert-staple.sh POSIX sh compat (fixes #3043)
(thx flynn)  (patch from flynn)

x-ref:
  "cert-staple.sh not POSIX compatible"
  https://redmine.lighttpd.net/issues/3043
3 years ago
Glenn Strauss de29a37771 [core] skip some trace if backend Upgrade (#3044)
(thx flynn)

To reduce log noise, skip warning trace reporting error on backend
socket if the connection has been upgraded, e.g. to websockets

x-ref:
  "Socket errors after update to version 1.4.56"
  https://redmine.lighttpd.net/issues/3044
3 years ago
Glenn Strauss 1d9cab1bc3 [core] always set file.fd = -1 on FILE_CHUNK reset (fixes #3044)
(thx flynn)

x-ref:
  "Socket errors after update to version 1.4.56"
  https://redmine.lighttpd.net/issues/3044
3 years ago
Glenn Strauss d15e2286f2 [core] fix handling chunked response from backend (fixes #3044)
(thx flynn)

When the backend sends Transfer-Encoding: chunked (which is HTTP/1.1,
not HTTP/1.0) and the client is HTTP/1.1, then lighttpd will transfer
the chunked encoding as it is sent from the backend without excess data
copying involved in decoding and then re-encoding. The bug is that if
the first data chunk (or chunks) is partially received at the same time
as the response headers, then the chunked encoding got corrupted.

x-ref:
  "Socket errors after update to version 1.4.56"
  https://redmine.lighttpd.net/issues/3044
3 years ago
Glenn Strauss adf7aea0e1 [core] wrap a macro value with parens
(code review)
3 years ago
Glenn Strauss a43420ba07 [mod_wolfssl] add complex preproc logic for SNI
add complex preproc logic for SNI detection
- HAVE_SNI is not sufficient
- HAVE_LIGHTY is not sufficient (in wolfssl <= 4.5.0)
Instead, use more complex logic wrapping calls to SNI_Callback()
in wolfssl.

x-ref:
  "[lighttpd] -mod-wolfssl inhibited by missing library functionality"
  https://github.com/openwrt/packages/issues/14142
  "put all SNI code behind simpler preprocessor directive HAVE_SNI"
  https://github.com/wolfSSL/wolfssl/pull/3538
3 years ago
Glenn Strauss 083b3fb992 [core] SHA512_Init, SHA512_Update, SHA512_Final 3 years ago
Glenn Strauss aa3cabae3b [mod_openssl] remove ancient preprocessor logic
remove ancient preprocessor logic which might define OPENSSL_NO_TLSEXT

The logic was added to base.h in https://redmine.lighttpd.net/issues/386
some 13 years ago, and today might cause more harm than good with other
TLS libraries which provide some level of openssl-compatiblity layer,
e.g. BoringSSL and LibreSSL

If building with an ancient version of openssl and building without
support for TLS extensions, then be sure that OPENSSL_NO_TLSEXT is
defined.  (Alternatively, please consider using modern versions of
security libraries for better security.)
3 years ago
Glenn Strauss a27e55b2dd [core] add missing mod_wolfssl to ssl compat list
add missing mod_wolfssl to ssl compat module list

x-ref:
  "[lighttpd] -mod-wolfssl fails (requires dependency on -mod-openssl?)"
  https://github.com/openwrt/packages/issues/14139
3 years ago
Glenn Strauss ce1d45ed82 [build] fix SCons build when building all TLS mods 3 years ago
Glenn Strauss 3579c32295 [core] prefer inet_aton() over inet_addr() 3 years ago
Glenn Strauss 233a218ab3 [build] fix meson.build when building all TLS mods
x-ref:
  "[lighttpd] -mod-openssl fails"
  https://github.com/openwrt/packages/issues/14121
  "[lighttpd] -mod-wolfssl fails"
  https://github.com/openwrt/packages/issues/14122
3 years ago
Glenn Strauss f8369910ff [core] setsockopt IPV6_V6ONLY if server.v4mapped
always setsockopt IPV6_V6ONLY on IPv6 addrs if server.v4mapped
is configured
3 years ago
Glenn Strauss b9bdca9b8a [mod_webdav] define _ATFILE_SOURCE if AT_FDCWD 3 years ago
Glenn Strauss 2d55953e75 [core] allow keep-alives in one-shot mode (#3042)
x-ref:
  "lighttpd on demand"
  https://redmine.lighttpd.net/issues/3042
3 years ago