1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-22 07:27:59 -08:00
Commit Graph

991 Commits

Author SHA1 Message Date
claudio
6676295ff1 Convert various reyk proc.c daemons over to new imsgbuf_init and
imsgbuf_allow_fdpass.

OK tb@
2024-11-21 13:38:45 +00:00
claudio
668e5ba9d8 Convert the common imsgbuf_read calls to the post EAGAIN world.
OK tb@
2024-11-21 13:21:33 +00:00
claudio
31be28ca73 Use imsgbuf_queuelen() instead of accessing the w.queue member.
OK tb@
2024-11-21 13:18:37 +00:00
claudio
9cbf9e90b0 Use imsgbuf_clear() where appropriate instead of msgbuf_clear().
OK tb@
2024-11-21 13:17:56 +00:00
claudio
dd7efffe3c Rename imsg_init, imsg_clear, imsg_read, imsg_write and imsg_flush to
imsgbuf_init, imsgbuf_clear, imsgbuf_read, imsgbuf_write and imsgbuf_flush.

This separates the imsgbuf API from the per-imsg API.

OK tb@
2024-11-21 13:17:01 +00:00
claudio
c1aa9554a3 Convert imsg_write() callers to the new simplified return logic.
OK tb@
2024-11-21 13:16:06 +00:00
claudio
ce33693d52 Introduce imsg_write() and use it instead of msgbuf_write().
imsg_write() is just a thin wrapper around msgbuf_write(). So this is
mostly search and replace.

OK tb@
2024-11-21 13:10:18 +00:00
claudio
f978fa48b9 imsg_flush no longer returns EAGAIN. Simplify proc_flush_imsg() accordingly.
Issue spotted by op@
2024-11-21 13:06:19 +00:00
claudio
f4d4619418 Use imsg_get_fd() to extract the fd from an imsg.
OK tb@
2024-10-31 13:37:44 +00:00
tb
92388deed9 relayd: add support for client certificates
This feature has been requested many times over the years. Various patches
were provided by Asherah Connor, Rivo Nurges, Markus Läll and maybe others.
These patches always stalled for various reasons.

From Sören Tempel, mostly based on Asherah's latest patch.

ok florian tb
2024-10-28 19:56:18 +00:00
jsg
efa8f74bcb remove unused struct 2024-10-08 05:28:11 +00:00
aisha
e95f2867f8 add route-to example
ok benno@
2024-09-21 05:37:26 +00:00
jsg
479c151d34 remove unneeded semicolons; checked by millert@ 2024-09-20 02:00:46 +00:00
tb
2b4fa706c5 relayd: improve config validation with -n
pf's rule names are limited by 32 characters, so lower the length bounds
for redirect names and tags that relayd accepts as valid config but would
later fail to load into pf. Also display the offending name on error.

from Mark Johnston
ok florian
2024-08-10 05:47:29 +00:00
anton
79db477be4 Fix regression introduced in previous causing HEAD requests to be
erroneously rejected as malformed.

ok chrisz@
2024-07-20 06:54:15 +00:00
chrisz
6aed2b87f4 Keep Content-length header in HEAD responses.
ok millert@
2024-07-19 04:26:23 +00:00
jsg
27c0dfa90c new sentence, new line 2024-07-14 03:58:49 +00:00
florian
7c99229c46 cleanup unused variable 2024-07-08 14:22:09 +00:00
sashan
8663a10cc3 The fix comes from Giannis Kapetanakis (bilias _from_ edu.physics.uoc.gr).
When relayd(8) handles 'host disable/enable' command issued by relayctl(8),
it disables redirect it finds in tables for particular host.  However there can
be multiple redirect instances which use the same host in relayd(8) tables.
This change makes relayd(8) to walk through all tables and disable all redirects
which match the host.

OK giovanni@, OK sashan@
2024-06-17 08:36:56 +00:00
sashan
7c726e761b Change adds a 'log' option to relayd.conf(5) rule. The relayd(8) then uses
the option to set corresponding `log` action in pf(4) rules it generates
to handle network traffic.

The patch comes from Giannis Kapetanakis (bilias _from_ edu.physics.uoc.gr).

OK sashan@
2024-06-17 08:02:57 +00:00
jsg
e15601b92a remove prototypes with no matching function 2024-05-18 06:34:46 +00:00
claudio
a1416996f1 Use imsg_get_fd()
As usual proc_forward_imsg() is never forwarding a file descriptor so
just use -1 there. This should be replaced by imsg_forward().
All other changes are simple conversions.

OK tb@
2024-01-17 10:01:24 +00:00
millert
f537694384 relay_read_http: strip out Content-Length if we strip the body too
We should not forward Content-Length if the body is not also forwarded.
2023-12-01 16:48:40 +00:00
millert
eefb3de579 relay_read_http: defer header parsing until after line continuation
Wait until we have a complete line before parsing the Content-Length,
Transfer-Encoding and Host headers.  This prevents potential request
smuggling attacks.  Filtering already happens after header line
continuation has been performed.  Reported by Ben Kallus.
OK claudio@
2023-11-29 15:35:07 +00:00
millert
1c543edce2 relay_read_http: tighten up header parsing
1) reject headers with embedded NULs
2) reject headers with invalid characters in the name
3) reject Transfer-Encoding with values other than "chunked"
4) reject chunk values containing non-hex characters
5) reject Content-Length values of "+0" or "-0"
6) reject requests without a ' ' and headers without a ':'

Reported by Ben Kallus, OK bluhm@
2023-11-28 18:36:55 +00:00
kn
f71e4cb7a7 Unmention/don't explain SSL, drop 9y old "ssl" keyword/deprecation warning
Switch "ssl" to "tls" in relayd.conf(5) if you haven't done so in the last
ten years, "ssl" is now an error.

Say "TLS" not "SSL/TLS" and drop the primer in the TLS RELAYS section.

OK benno
2023-10-29 11:27:11 +00:00
yasuoka
1e4c51d778 Revert the previous. It was committed by my mistake. 2023-09-14 09:54:31 +00:00
yasuoka
98a4f9a47e Clarify the interval after 30sec. 2023-09-14 09:51:14 +00:00
nicm
5b9b6c6b8b Use EVBUFFER_DATA instead of reaching into struct evbuffer. ok tb 2023-09-03 10:22:03 +00:00
tb
27f6552026 relayd: remove ENGINE dependency
What is achieved here through ENGINE can be done in a much simpler way
by setting the default RSA implementation. Drop a number of indirections
that only add a bit of logging. This removes a lot of boiler plate and
shows where the actual magic happens more clearly.

ok op tobhe
2023-07-16 09:23:33 +00:00
claudio
bce5c5dd58 Use ibuf_data() instead of accessing ibuf->buf directly.
OK tb@
2023-07-03 09:38:08 +00:00
sashan
e32ac0fbcc let check_table() also print table@anchor when it exits
unexpectedly via call to fatal()

OK claudio@
2023-06-30 12:16:00 +00:00
claudio
1577142d25 Spaces vs tabs
from florian@
2023-06-29 16:24:53 +00:00
claudio
137f900226 Rewrite pfe_route() to actually work on 64bit archs since IPv6 had to be
special. One can not define a struct for the route message since there is
different padding between 32 and 64 bit systems for struct sockaddr_in6.
Instead do what all other daemons do and use struct sockaddr_storage,
iovec and writev.
Problem reported by Joerg Streckfuss (streckfuss at dfn-cert.de)
OK tb@
2023-06-29 16:11:02 +00:00
op
4958adbcc0 remove ssl_init()
it's a noop; nowadays both LibreSSL and OpenSSL libcrypto and libssl
initialize themselves automatically before doing anything.

ok tb
2023-06-25 08:07:38 +00:00
claudio
4b0d37629d Simplify and clean up the code. Try to use more ibuf idioms but the
mix of types used in these functions make this rather hard.
The expected data checks are still not great but a step in the right
direction.
OK tb@
2023-06-21 07:54:54 +00:00
claudio
b53550541f Convert string2binary() to use new ibuf api instead of working with an
extra buffer first.
OK tb@
2023-06-21 07:49:24 +00:00
claudio
f69b700df7 Replace a ibuf_reserve() dance to add a NUL byte with ibuf_add_zero(buf, 1).
Same thing but far less nasty.
OK tb@
2023-06-20 09:54:57 +00:00
op
7078bf6a08 fix typo: 'hash buffer to small' -> too small 2023-06-11 10:30:10 +00:00
beck
3cf4eea4fe Make the tlsv1.0 and tlsv1.1 options in relayd do nothing
Also document that fact, and that the existing ssl3 option
does nothing. This changes relayd to no longer request tls1.0
or tls1.1 in preparation for the upcoming deprecation of these
out of data protocols

ok jsing@ bluhm@ tb@ claudio@ benno@
2023-06-06 15:16:52 +00:00
tb
f1b4a8a58f Add missing #include <openssl/err.h> 2023-03-26 18:04:47 +00:00
guenther
5b133f3f27 Delete obsolete /* ARGSUSED */ lint comments.
ok miod@ millert@
2023-03-08 04:43:04 +00:00
tobhe
c1868907b7 proc_ispeer() is not used anywhere anymore so remove it everywhere.
ok florian@ bluhm@
ok for vmd mlarkin@
2023-02-15 20:44:01 +00:00
jmc
b2767518fe {en,de}queing -> {en,de}queuing; from paul tagliamonte 2022-12-28 21:38:29 +00:00
jmc
3a50f0a93a spelling fixes; from paul tagliamonte
any parts of his diff not taken are noted on tech
2022-12-28 21:30:15 +00:00
mbuhl
3b59bd4a50 In case RSA_meth_new fails, errstr would be passed to fatalx without
initialization.
OK tb
2022-11-10 00:44:12 +00:00
mbuhl
6eb056bf4b always call va_end.
ok tb
2022-11-10 00:00:11 +00:00
benno
7a99b37dfd Move the daemon() call in the parent process from after forking the
children to just before.  That way the parent disasociates from its
controling terminal and shell, but not from its children.

Remove the dup2() bits that were copied from daemon() to solve the
problem that the children still had the stdio fds open. This is now
done in the parent earlier.

Remove the setsid() and setpgid(). It is unclear what their intent
was, but they dont seem to make sense, as daemon() covers this as well
and there seems to be no reason the cildren procs need to do that.

ok claudio@ bluhm@
2022-09-03 20:07:31 +00:00
dv
4172793d0f relayd(8): change agentx_getsock to return void
Only has one return value and it's never checked.

ok martijn@, tb@
2022-08-31 16:17:18 +00:00
tb
e87883d971 Check tls_config_new() for NULL return
This way we don't crash in tls_config_insecure_noverify_cert().

From Mateusz Piotrowski on bugs

ok claudio
2022-06-03 13:23:16 +00:00