Commit Graph

1233 Commits

Author SHA1 Message Date
Omar Polo 4d9d3093d4 resurrect landlock support
this time targetting ABI level 3; partially based on how claudio@
handled it in rpki-client.  Fun how this bit of code has come full
circle (gmid inspired what I wrote for got, which inspired what was
written for rpki-client, which has come back.)
2023-08-23 20:18:59 +00:00
Omar Polo cedef5b09c fix build of regress 2023-08-23 19:46:53 +00:00
Omar Polo 01d3961d6f adding forgotten file 2023-08-23 19:39:27 +00:00
Omar Polo 74c6900c91 fix previous; check for getentropy only when arc4random is missing
on macos we have the situation where we have arc4random available
but no getentropy().
2023-08-23 19:22:22 +00:00
Omar Polo 21b4a5163c comment out seed_from_prngd
it's not used (we define OPENSSL_PRNG_ONLY) and fails the build
with -Werror.  Keep the function commented instead of deleting it
just in case we need to undefine OPENSSL_PRNG_ONLY in the future.
2023-08-23 19:13:46 +00:00
Omar Polo 258131b1b6 typo 2023-08-23 17:44:35 +00:00
Omar Polo 8f8d721301 enable privsep crypto on all systems
now that we have a bundled libtls we can actually do this.  Retain
the knob to disable it "just in case".
2023-08-23 17:39:28 +00:00
Omar Polo f9ab77a898 bundle libtls
gmid (like all other daemons that want to do privsep crypto) has a
very close relationship with libtls and need to stay in sync with
it.

OpenBSD' libtls was recently changed to use OpenSSL' EC_KEY_METHOD
instead of the older ECDSA_METHOD, on the gmid side we have to do
the same otherwise failures happens at runtime.  In a similar manner,
privsep crypto is silently broken in the current libretls (next
version should fix it.)

The proper solution would be to complete the signer APIs so that
applications don't need to dive into the library' internals, but
that's a mid-term goal, for the immediate bundling the 'little'
libtls is the lesser evil.

The configure script has gained a new (undocumented for the time
being) flag `--with-libtls=bundled|system' to control which libtls
to use.  It defaults to `bundled' except for OpenBSD where it uses
the `system' one.  Note that OpenBSD versions before 7.3 (inclusive)
ought to use --with-libtls=bundled too since they still do ECDSA_METHOD.
2023-08-23 17:38:49 +00:00
Omar Polo 9019e55e7e sync DISTFILES 2023-08-22 19:58:29 +00:00
Omar Polo 7ea8725593 sync have/* files 2023-08-22 19:43:47 +00:00
Omar Polo 9cd81f93d7 sync changelog 2023-08-22 19:24:45 +00:00
Omar Polo e872053b20 send all the params as per RFC3875 (CGI) and sync documentation 2023-08-18 12:40:10 +00:00
Omar Polo f5dc7eddd7 fix INSTALL handling
Set a sane default for INSTALL, allow it to be changed either as
environment variable or configure argument, and propagate it correctly
to the generated config.mk.

Issue reported by xavi, thanks!
2023-08-13 09:53:12 +00:00
Omar Polo 81634643db fix comment (ge -> gemexp) 2023-08-11 16:18:37 +00:00
Omar Polo 07ad491025 getcwd(NULL) is an extension; don't rely on it
also, while here, add some error checking too
2023-08-11 10:40:58 +00:00
Omar Polo 95500a936a remove not so useful starts_with()
replace its only usage with strncmp().  it's likely faster too.
2023-08-11 10:38:34 +00:00
Omar Polo 8bb1b23633 remove a long, long unused function 2023-08-11 10:33:40 +00:00
Omar Polo cf2784df75 remove useless logging 2023-08-09 19:13:48 +00:00
Omar Polo 390d312b22 don't call client_close() from fcgi/proxy bev handlers
We might end up calling client_close() from start_reply(), but that
will free the fcgi/proxy bufferevent while they're still used on the
stack.

Instead, start_reply() only sets REQUEST_DONE and exits, returning the
error eventually, so callers know when to stop.
2023-08-09 19:13:13 +00:00
Omar Polo 01481c255a update changelog 2023-08-08 18:08:37 +00:00
Omar Polo a1e159c917 fix PATH_INFO / SCRIPT_NAME splitting 2023-08-08 18:07:54 +00:00
Omar Polo 03d671e2aa implement fastcgi strip number 2023-08-08 17:35:11 +00:00
Omar Polo 4f7492c36e lower debug log priority 2023-08-08 17:33:43 +00:00
Omar Polo b27dc2b0a3 draft the PATH_INFO and SCRIPT_NAME handling
The idea is to require SCRIPT_NAME to be defined and strip it from
the beginning of the path to get PATH_INFO.  Soon(tm) a `fastcgi
request strip' option will be added too.  Maybe even `fastcgi script
name "path"` that sets SCRIPT_NAME automatically.
2023-08-08 16:06:17 +00:00
Omar Polo 08c0f676fd remove prototype for function killed long ago 2023-08-08 15:57:12 +00:00
Omar Polo d98ef73494 move strip_path to utils.c 2023-08-08 15:56:27 +00:00
Omar Polo 877b479bcc add missing include of config.h in vis.c 2023-08-07 17:57:24 +00:00
Omar Polo 9e6fc13b35 drop the __bounded__ attribute
breaks the build with -Werror depending on the compiler.
2023-08-07 17:54:34 +00:00
Omar Polo 36363b011c drop #include <sys/cdefs.h> from vis.h
Doesn't seem to be available on many systems.  It is also not strictly
needed since we include vis.h only after headers like stdlib.h that
already pulls in the type it needs.
2023-08-07 16:09:00 +00:00
Omar Polo d13b044d59 address the strnvis(3) portability fiasco
strnvis originates on OpenBSD.  When NetBSD added it to their libc
they decided to swap the argument.  Without starting a holy war on
the "best" argument order, adding an implementation of a function
that's widely available and making its signature purposefully
incompatible is beyond justification.  FreeBSD (and so macos too?)
followed NetBSD in this, so we end up with *two* major and incompatible
strnvis implementations.  libbsd is in a limbo, they started with
the OpenBSD version but they'll probably switch to the NetBSD version
in the future.

That's why we can't have nice things.

Do the right thing(tm) and check for the presence of the original
strnvis(3), if not available or broken use the bundled one.
2023-08-07 15:39:57 +00:00
Omar Polo ddbcd3c13f use the subject' common name as the user field in log 2023-08-07 14:04:47 +00:00
Omar Polo 35579431eb remove debugging leftover 2023-08-07 13:58:43 +00:00
Omar Polo d72ac636bb unbreak config_test() when !use_privsep_crypto
The new config_test() fails miserably when the privsep crypto engine is
not enabled.  As a temporary workaround, forcibly disable it during
config_test() as we're not going to run anyway.
2023-08-07 13:18:04 +00:00
Omar Polo 36a98d50e5 update changelog 2023-08-07 12:40:50 +00:00
Omar Polo 3b431c09d9 try hard at loading the configuration during conftest (-n)
Attempt to do also a few more steps that were previously done only
at runtime.  This can help verifying that the keypairs are matching
for example, but also that there are no typos in the path to the
root directories.

Was requested some time ago by Marian Mizik, thanks for the feature
request!
2023-08-07 12:40:44 +00:00
Omar Polo 9abba172b6 add `log syslog facility' to use a different syslog(3) facility
Was requested ages ago by Karl Jeacle, now that there is some better
support for configuring the logging there's no excuse to add this.
It helps with filtering from syslog.d / syslog.conf.
2023-08-07 09:34:19 +00:00
Omar Polo 3a93c90445 sort logopt 2023-08-07 09:08:23 +00:00
Omar Polo a250aff257 comment out the condensed log style in the manpage 2023-08-04 10:07:02 +00:00
Omar Polo f23b708726 set the default logging style back to legacy
I think the condensed is better but it'll need to change post 2.0
to accomodate for logging the number of bytes read in the body of
a titan request (and it's weird to hardcode a zero there.)  2.0
will ship with the legacy logging style thus.
2023-08-04 10:05:44 +00:00
Omar Polo 5d38e5d88d titan: clean up IRI/URI/URL mess; it's a IRI what we parse 2023-08-04 10:02:18 +00:00
Omar Polo 11ff7f934e titan: error if the URI is not titan:// 2023-08-04 10:01:18 +00:00
Omar Polo d671434bc7 titan: better logging for unexpected EOFs
upon an unexpected EOF, tls_error() returns NULL, so log the real
reason iomux returned -1.
2023-08-04 09:57:27 +00:00
Omar Polo 5905156665 titan: rename parse_err to errstr 2023-08-04 09:53:18 +00:00
Omar Polo 1b1a6fb7ee titan: iomux: return -1 on EOF without receving anything
otherwise it enters an infinite loop where it tries to read, return
zero, and tries again...
2023-08-04 09:52:27 +00:00
Omar Polo fcc5a371b1 titan: fix appending of path parameters
the parameters need to be added at the end of the path, not at the
end of the URL.
2023-08-04 09:49:01 +00:00
Omar Polo 26df50981f actually use the specified log style 2023-08-03 22:37:34 +00:00
Omar Polo 56054fe197 use the legacy style in the tests for now 2023-08-03 22:37:05 +00:00
Omar Polo f736c9579c fix test after log style condensed change 2023-08-03 22:35:49 +00:00
Omar Polo 161651fa5e gmid.conf.5: add one example of proxy relay-to 2023-08-03 22:24:09 +00:00
Omar Polo c2bcf6a402 Nm does not make any sense there 2023-08-03 22:17:32 +00:00