1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-04 15:25:38 -08:00
Commit Graph

29934 Commits

Author SHA1 Message Date
claudio
baad1f5d65 Fix logic to return CTL_RES_NOSUCHPEER. The RB_EMPTY check needs to be
reversed since no error should be printed if there are no neighbors
configured (yet).
OK tb@
2024-10-29 12:35:37 +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
claudio
8045fa89e1 Remove two fatalx calls in pt_fill since they are wrong.
L3VPN withdraws don't carry a labelstack (see util.c::nlri_get_vpn4()).
OK tb@
2024-10-28 12:05:00 +00:00
deraadt
36ac5f1008 Add support for performing a sysupgrade from a path. This is convenient
for offline machines if you can pull the snapshot or release to there there,
but want sysupgrade to locally perform signify validation before performing
the /home/_sysupgrade and other boot-upgrade steps.
ok florian
2024-10-25 03:42:06 +00:00
claudio
60eaea58b5 Adjust ldapclient prototype to prevent an "argument of type 'int[2]' with
mismatched bound" warning.
OK tb@
2024-10-24 11:47:36 +00:00
claudio
bf431fff95 Append fd to the variable names proc, rsync, rrdp, http since these variables
are used to store file descriptors.
OK tb@
2024-10-23 12:09:14 +00:00
jsg
c2bc71950d remove duplicate RT_BUF_SIZE define 2024-10-22 22:50:49 +00:00
claudio
0a6e69e457 Use imsg_get_fd() like everywhere else.
OK florian@ dv@
2024-10-22 15:19:48 +00:00
claudio
82ba26c4dc VM_MAP_BUSY and VM_MAP_WANTLOCK will be removed soon, prep for that.
OK dlg@
2024-10-20 11:21:24 +00:00
miod
ce1663765c a.out is no longer the commonly encountered binary file format, the world has
moved to ELF.

Move the a.out specific defines and macros, but the MID_xxx values, from
<sys/exec.h> to <a.out.h>, and update the few userland binaries which really
need these defines (i.e. boot-related tools for old architectures) to
explicitly include <a.out.h> when needed.

"Fine" deraadt@
2024-10-16 18:47:47 +00:00
tb
9a67f0c9d9 rpki-client: sprinkle some const
EVP_PKEY_get0_* were made const correct in OpenSSL 3 and now cause the
build of rpki-client to emit warnings. Of course no one is able to see
these warnings because they are hidden in all the deprecation vomit.

Makes rpki-client build cleanly against OpenSSL 3 when configured with
--with-openssl-cflags=-DOPENSSL_SUPPRESS_DEPRECATED.

ok claudio deraadt job
2024-10-16 06:09:45 +00:00
deraadt
c0030deff4 Be more eager to install qcpas firmware (more pattern matches) 2024-10-13 00:00:41 +00:00
afresh1
fe7b35343c Make fw_update -a mean all
When downloading or installing, not just deleting.

Noticed by Paul de Weerd
Help with manual wording from jmc@
Just fix -a, deraadt@
2024-10-12 23:56:23 +00:00
deraadt
be53cb2d9a The fw keys have been added to the signify key bundles. sysupgrade will
now extract the fw key also, so that pre-upgrade fw_update can fetch
the most uptodate firmware.
ok sthen
2024-10-11 14:12:05 +00:00
florian
f2270df8ab Always print account URI on first creation of an account key.
This was hidden behind -v but it seems useful to always have this when
creating a new account.

As sthen points out in his previous commit:
This is useful if you want to set a CAA DNS record restricting
issuance to a specific user account.

OK deraadt
2024-10-10 09:39:35 +00:00
claudio
a2dc744ed1 Make it possible to configure tcp md5 and ipsec on rtr as well
Single out the auth_config yacc rules. Even though this requires an
extra merge_auth_conf() function to handle manual IPsec setups but
even with that this seems like a net gain.

There is no rtr cache that does tcp md5 on OpenBSD so those bits remain
untested for now.
OK tb@
2024-10-09 10:01:29 +00:00
jsg
44cbff73fe correct indentation 2024-10-09 01:52:11 +00:00
claudio
cd16358eb0 Extend the socket handover from parent to rtr process to also include teardown
This is needed to support tcp md5sum and ipsec auth for rtr.
OK tb@
2024-10-08 12:28:09 +00:00
jsg
efa8f74bcb remove unused struct 2024-10-08 05:28:11 +00:00
sthen
de0ff35887 When acme-client is run with -v, show the account URI from the Location
header sent by the server in response to the newAccount API call (used for
every cert request). This is useful if you want to set a CAA DNS record
restricting issuance to a specific user account, rather than just "all of
$whichever_acme_CA".  ok florian
2024-10-07 23:47:00 +00:00
jmc
ef76af9e7d use the Ox macro instead of "OpenBSD"; 2024-10-07 15:57:15 +00:00
sthen
bdcafcd9f6 merge unbound 1.21.1 2024-10-07 15:38:21 +00:00
sthen
3be9681c7f Fix unbound CVE-2024-8508, put a limit on resources used for handling
DNS compression. OK florian

From unbound 1.21.1 (rest will be merged shortly).
2024-10-07 15:35:11 +00:00
tb
eef0ad36fb Add comment accidentally omitted on commit 2024-10-07 14:45:33 +00:00
tb
c4bf180607 update crl number draft link 2024-10-07 14:21:51 +00:00
deraadt
0c49c08fbb The two usual use cases are sysupgrade and sysupgrade -s, jumping
forward to the same key, or the key+.1.  But sometimes you want to
update an older machine far forward (either with -s, or with -R), and
the required key might not exist on-disk.  Since getting the key isn't
automated, people make some poor decisions to get the key.  Previous
to 7.6 the situation was worse, (and obviously older releases will have
the old sysupgrade script, though you can copy this one to those machines
and it will work, but please do that securely..)
Moving forward this improves the workflow: a new set of keybundles
(signed by older keys) have been made available so that sysupgrade
can securely and automatically download the required key.
ok job tb beck sthen
2024-10-07 13:21:53 +00:00
tb
81fe2f6d7d rpki-client: fix validity interval check
The language in RFC 5280, section 4.1.2.5 includes the end points of the
validity interval.

Reported by Tom Harrison

ok claudio job
2024-10-07 12:19:52 +00:00
tb
c0214ebbd4 rpki-client: fix seqnum upper bound
An ASN1_INTEGER doesn't contain the ASN.1 encoding in its data. It contains
a BIGNUM. In particular, there's no padding octet for integers with the top
bit of the top octet set. Do the check the dumb way and check all the parts
individually: non-negative, not larger than 20 octets and bit 159 not set.

Reported by Tom Harrison

ok claudio job
2024-10-07 12:18:31 +00:00
kn
b389496969 drop redundant AF attach ioctl
SIOCAIFADDR_IN6 to configure an IPv6 address does everything SIOCIFAFATTACH
does, i.e. it enables IPv6 on the interface if not done so already.

vm.conf(5) 'local inet6' works as before.

OK mlarkin
2024-10-07 04:29:01 +00:00
jsg
c6b676a53b error on long locator lines, don't overflow buffers
found with afl, feedback and ok millert@
2024-10-05 01:07:38 +00:00
dv
a4052f0f2c Move some PCI MMIO defines from vmm(4) kernel headers to userland.
vmm(4) doesn't need this information anymore. vmd(8) is the only
consumer of this information.

ok mlarkin@
2024-10-02 17:05:56 +00:00
claudio
69319e3ad6 No need to check as->established before calling pfkey_remove().
Remove the extra checks in the caller and simplify some code because of that.
OK tb@
2024-10-02 09:45:29 +00:00
tb
a02f709497 Adding pkg_add from stdin hasn't worked in ages. It was something
we inherited from the initial implemention on FreeBSD which has
made no sense in years.

prompted by a diff by Johannes Thyssen Tishman
from espie
2024-10-02 09:14:08 +00:00
tb
9acbf608f1 Extend Log->system to support the same features as BaseState->system
In order to support privsep in tags, we need to be able to pass some
code values in child/parent.

from espie, tested by sthen, ok giovanni
2024-10-01 18:48:29 +00:00
claudio
d3e7ac1607 Use auth_conf.method instead of auth_state.method. The latter is always 0. 2024-10-01 18:33:16 +00:00
claudio
63c2b4966a Explicitly set peer.auth_conf.method, the auth_state value is never
initialized in the SE so bgpctl did always see 0, auth_conf.method
is on the other hand properly shared.
OK tb@
2024-10-01 18:31:10 +00:00
claudio
8f5501c15d In merge_peers also copy over the auth_conf from the new peer to the old
since that one is kept.
OK tb@
2024-10-01 18:29:34 +00:00
claudio
14a2db8031 Fix typo in comment
OK tb@
2024-10-01 18:28:17 +00:00
claudio
cbc52301d8 Adjust to the pfkey changes in bgpd.
OK tb@
2024-10-01 11:50:15 +00:00
claudio
d762911438 Rework the pfkey and tcp md5 API to not depend on struct peer.
Instead use struct auth_config and struct auth_state in the pfkey calls
and those tcp_md5 calls where it matters.

This is preparation work to allow RTR to use TCP MD5 as well.
OK tb@
2024-10-01 11:49:24 +00:00
claudio
477ac4f17e Improve some currently impossible error path in log_ext_subtype().
Mainly handle unknown ext-communities better and handle the special
case of type == -1.
OK tb@
2024-09-30 12:54:12 +00:00
claudio
bc3692b580 In bgpd_rtr_connect() do the setsockopt dance for IP_TOS and TCP_NODELAY
before calling connect(). This way it happens for sure and on top the TOS
is already set on the initial SYN.
OK tb@
2024-09-30 09:42:24 +00:00
kn
4f37b6d834 sync synopsis and usage, sort commands, fix their spacing
OK input lucas
2024-09-29 14:36:13 +00:00
tb
352e6c5d7c rpki-client: free deltas in rrdp_session_parse() as in rrdp_repo_free()
ok claudio
2024-09-27 12:55:03 +00:00
tb
27e47f522c rpki-client: check for getline error when reading the skiplist file
ok claudio
2024-09-27 12:52:58 +00:00
jsg
65bbee46ca remove unneeded includes; ok dv@ mlarkin@ 2024-09-26 01:45:13 +00:00
florian
175054dbe4 Improve description of -f.
ok sthen, florian

Committing on behalf of jmc as requested.
2024-09-25 16:26:37 +00:00
jmc
0e47a61a5c correct macro for -R entry; 2024-09-25 15:08:42 +00:00
claudio
6c19f566ed When generating UPDATE handle the message size limit better.
First of all warn that a prefix was dropped. In the generate an update
code handle possible overflows of attributes and NLRI and withdraw the
affected prefix. This way the peer will not have stale data.
OK tb@
2024-09-25 14:46:51 +00:00
sthen
2d63a5f7c1 sysupgrade: add -R #.# to try to use a specific release version rather
than the immediate +0.1. print an https://ftp.openbsd.org/... URL where
the new signify pubkey can be found if not present.

no guarantees: we only test +0.1, but jumping further does work quite
often (and if tight on disk, can work better than multiple steps) -
this avoids editing the script if you're going to do it anyway.

"Only upgrades from one version to the next are tested. Skipping
versions may work. Downgrading is unlikely to work."

discussed with deraadt chris florian, ok deraadt
2024-09-25 13:55:23 +00:00
deraadt
e3b2bc7ec4 document why sys/param.h is used 2024-09-25 04:19:36 +00:00
jmc
cc67ceff40 - VM(s) -> VMs
- simpler tense
- fix the -width parameter
- add -nosplit to AUTHORS
2024-09-24 20:02:39 +00:00
mlarkin
b999ee2ed7 vmd(8) manpage change for shutdown behaviour
Document the shutdown behaviour for vmd(8). Suggested via bugs@
via eric at mulh.net.

ok jmc@, bluhm@
2024-09-24 19:34:01 +00:00
florian
8aa961cf3a Remove -r toggle and generally be less smart.
The default is to install the next release. Snapshots are only
installed when invoked with -s.

The logic on what to do per default got out of hand and it was very
difficult to reason about what sysupgrade(8) actually did. deraadt@
then suggested that we should dumb it all down, sysupgrade(8) is there
to upgrade from one release to the next. More advance usage needs to
be requested by the user.

With all this simplification we can now be a bit more smart to work
out what the next release is. With that, snapshots right before a
release can be sysupgrade(8)'ed to the official release.

OK sthen on a previous version that was much more complicated but
allowed shortly-before-release -> release upgrade

testing sthen on this version

Guidance, prodding & OK deraadt
2024-09-24 07:33:35 +00:00
aisha
e95f2867f8 add route-to example
ok benno@
2024-09-21 05:37:26 +00:00
mlarkin
4716c5471a vmm.h is a needed include now 2024-09-21 04:12:18 +00:00
jsg
479c151d34 remove unneeded semicolons; checked by millert@ 2024-09-20 02:00:46 +00:00
tb
acc4629865 Shift 1U rather than 1 to avoid -Wsign-compare whining
claudio agress
2024-09-19 20:48:36 +00:00
job
824a3a1adc Move rpki-client to 9.3
requested by tb@
2024-09-19 13:45:07 +00:00
claudio
21826c937b Remove spaces before EOL. 2024-09-19 08:55:22 +00:00
denis
620bdc4b89 document how to add a restricted socket
OK claudio@
2024-09-19 06:12:46 +00:00
millert
6a4024dc43 zic: cherrypick support for %z in time zone formats
This extends the zic input format to add support for %z, which
expands to a UTC offset in as-short-as-possible ISO 8601 format.
It's intended to better support zones that do not have an established
abbreviation already.  tzdata2024b and higher require a version of
zic that supports the %z format.  From upstream tzcode.  OK beck@
2024-09-18 17:05:50 +00:00
bluhm
8e5fcb6eaf Mention psp(4) in vm.conf(5) man page.
from hshoexer@; OK mlarkin@
2024-09-16 22:30:01 +00:00
jsg
8fbd69a9e8 __STDC_VERSION__ not __STDC_VERSION; ok miod@ 2024-09-15 05:49:05 +00:00
yasuoka
4946f6941b Improve the log messages and white spaces. 2024-09-15 05:31:23 +00:00
yasuoka
cfa11a856b Keep the number of requests for a DAE server below 64 to avoid
congestion.
2024-09-15 05:29:11 +00:00
yasuoka
eff8f878b4 Add "delete" command to "radiusctl ipcp". Also, send "stop" that was
missing when disconnecting all when acct-{on,off} received.
2024-09-15 05:26:05 +00:00
yasuoka
065d5e7678 Handle EAGAIN properly and fix the log when disconnected. 2024-09-15 05:14:32 +00:00
tb
904d9c60a4 Reintroduce check that CRL Number is in range
The CRL number draft clarified what ignoring means and it includes checking
that the CRL number is well-formed again. So do this but continue to ignore
the value for any other purpose. This refactors x509_convert_seqnum() into
a couple of helpers. There's some duplication between crl_check_crl_number()
and crl_parse_crl_number() which could be removed if anyone cares.

tweaks/ok job
2024-09-12 10:33:25 +00:00
bluhm
f4b47ae8c1 Implement AMD SEV support in vmd(8).
To launch a guest with AMD SEV enabled, vmd needs to do a few things:
- retrieve ASID used by guest on VM creation
- provide ASID to psp(4)
- let psp(4) encrypt memory used intially by guest
- run guest
- release resources held by psp(4) on guest shutdown
To enable SEV for a guest use the parameter "sev" in the guest's vm
section in vm.conf.

from hshoexer@; OK mlarkin@
2024-09-11 15:42:52 +00:00
tb
9ea7911738 Use doc/html link for consistency 2024-09-10 18:37:42 +00:00
tb
cbb03a40aa Add reference to the manifest numbers draft
ok job
2024-09-10 18:34:19 +00:00
claudio
e386eeb169 Be more careful with aspath that have 0 length (aka the empty AS_PATH).
Again malloc(0) is not portable and calling memcpy with a NULL pointer
and a 0 length is not allowed by the C standard.

OK tb@
2024-09-10 09:38:45 +00:00
claudio
07ef39656b community_copy needs to check if nentries is 0 and handle that specially.
Calling malloc / reallocarray with a 0 size is not portable and the
memcpy with a possible NULL pointer as source and 0 len is seen as UB
by newer C standards (grmbl).

OK tb@
2024-09-10 08:53:20 +00:00
claudio
e5e5eb1a03 AID_VPN_IPv4 and AID_VPN_IPv6 require a labellen that is non-zero.
OK tb@
2024-09-10 08:47:51 +00:00
claudio
d9facda501 Enfroce proper encoding of ASPA announce/withdraw PDU.
An announce PDU requires at least one provider ASnum while a withdraw
must not include any provider ASnums. The first is mandated by the ASPA
profile and the 2nd by the 8210bis draft.

Further cleanup some leftovers from the old per-AFI split of ASPA.
OK tb@
2024-09-10 08:41:13 +00:00
claudio
c2b3ae36d4 Use reallocarray() instead of recallocarray(), this code does not need the
extra security measures of recallocarray() which adds a lot of overhead.
OK tb@
2024-09-10 08:37:52 +00:00
claudio
457c3e2447 Handle the CLUSTER_LIST attribute as described in RFC7606
Just drop the attribute if received from an external peer.
Treat as withdraw if the len is 0 or not % 4.
OK tb@
2024-09-09 15:00:45 +00:00
claudio
173da11705 There is no need for an explicit size check for IMSG_RECONF_ASPA_TAS
imsg_get_data() does the same and produces the same error.
OK tb@
2024-09-09 14:58:47 +00:00
claudio
6116e163fc Use msgbuf_init() instead of hand initalizing the msgbuf.
OK tb@
2024-09-09 12:59:49 +00:00
tb
f452fe1ca0 rpki-client: fix typos in comments and one in a warning message 2024-09-08 07:23:36 +00:00
mpi
6243ff0b1b Interpret the argument of '%c' as an integer instead of a string.
From Christian Ludwig.
2024-09-06 07:58:50 +00:00
claudio
6e684d5963 Bump version 2024-09-05 20:28:42 +00:00
jmc
79053326db have sysmerge and sysupgrade Xr each other;
diff originally from peter n. m. hansteen

ok ajacoutot
2024-09-05 06:39:53 +00:00
jmc
6b028660f0 note that "|" and ":include:" are disallowed for root;
prompted by mail from illya meyer

ok gilles
2024-09-05 06:33:04 +00:00
jmc
1893b9de7c remove note falsely claiming that :include: is disallowed
(it is, but only for root, which i'll address in separate commit);

ok mp gilles
2024-09-05 05:51:46 +00:00
job
5f0faded70 Remove deprecated '-r' command line option
OK tb@ claudio@
2024-09-04 15:46:43 +00:00
claudio
3e51611556 Qualifying nexthops via BGP does not properly work since nexthops need
to be rechecked when a BGP route is added (or changed).

We need to revalidate nexthops on inserts (kroute_insert) and
on change (krX_change but only for AID_INET and AID_INET6 -- no nexthops
in the other tables) the nexthop needs to be updated.

Only validate nexthops if 'nexthop qualify via bgp' is enabled. For route
changes the code can depend on the F_NEXTHOP flag.

Fix for: https://github.com/openbgpd-portable/openbgpd-portable/issues/81
OK tb@
2024-09-04 15:06:36 +00:00
claudio
7f893e0cba Call pfkey_remove() only after the Session Engine finished reloading its
configuration. Doing so before could result in some messages being sent
out without proper TCP-MD5 signature.

Fix for: https://github.com/openbgpd-portable/openbgpd-portable/issues/82
OK tb@
2024-09-04 13:30:10 +00:00
sthen
98bc733b08 merge unbound 1.21.0 2024-09-04 09:36:40 +00:00
sthen
a43524d9cc import unbound 1.21.0, ok phessler florian 2024-09-04 09:35:34 +00:00
op
ad8d242dc7 fix some typos; courtesy of codespell; ok gilles@ 2024-09-03 18:27:04 +00:00
tb
be9e59b4e0 Make state file parsing errors more explicit. Also don't leak the deltas.
joint effort with/ok claudio
2024-09-03 15:37:03 +00:00
job
20c31060e0 Also gate SPL statistics behind 'experimental' command line option
This changes the JSON output, without -x some keys are missing from 'metadata'

OK tb@
2024-09-03 15:04:48 +00:00
claudio
dbcd1c3144 In rrdp_session_parse() set the last_reset time to now if the .state file
does not exist.
OK tb@
2024-09-03 13:31:31 +00:00
gilles
7ceb9f7fe4 bump version 2024-09-03 12:07:40 +00:00
job
6dd0ae0386 Increase number of concurrent RRDP session handler slots
OK claudio@
2024-09-02 11:56:22 +00:00
yasuoka
7c8f25c75a Coding of the handling of errors for <sequence number> hadn't be completed. 2024-09-02 04:45:22 +00:00
tb
aec10a2afd Unify proc_parser_* as far as possible and reasonable
ok claudio job
2024-08-29 13:46:28 +00:00
job
1f3d741282 Improve warning message
Requested by claudio@

OK tb@
2024-08-29 09:54:13 +00:00
job
d0a27ef8be Periodically reinitialize RRDP sessions to snapshot at random intervals
It is technically possible for a series of RRDP deltas and a snapshot
to diverge. An RRDP server could distribute files via Deltas and then
forget about those files, causing copies to remain stuck in the caches
of RRDP clients. Resetting RRDP sessions once every few weeks helps with
garbage collection.

In week 0 the probability of triggering re-initialization is ~0.025% and
doubles every week, in week 11 its 50% and always after week 12. Thus,
RPs will reinitialize at least once every 3 months.

OK tb@ claudio@
2024-08-29 09:53:04 +00:00
naddy
d7d958b800 Stop printing the "syscall" bit in the header line, too.
ok deraadt@
2024-08-28 14:22:36 +00:00
claudio
c4328fc634 Introduce peer_is_up() and use it instead of peer->state == PEER_UP checks
also enqueue update and rrfresh imsgs only if the peer is up and flush them
once this is no longer the case.
OK tb@
2024-08-28 13:21:39 +00:00
claudio
174b88088d Check the max_prefix and max_out_prefix limit during config reload.
This is cheap and will trigger immediatly instead of waiting until
the next UPDATE happens (which could happen a lot later).
OK tb@ job@
2024-08-28 13:18:11 +00:00
tb
78a26022da sync ibuf_realloc() copy with libutil
This pulls in an overflow check and the change from recallocarray() to
realloc(). claudio tells me that we might soon get rid of this copy.

ok claudio
2024-08-28 09:39:17 +00:00
florian
84b182f831 Mechanically change inet_aton to inet_pton.
Documentation says IP addresses are not truncated, so the parser can
be stricter and only accept dotted IP addresses.

OK yasuoka
2024-08-27 06:06:14 +00:00
florian
bda27a8758 Use getaddrinfo to parse IP addresses and lookup names.
Input & OK bluhm
2024-08-27 06:04:03 +00:00
florian
cd13aecf35 Use getaddrinfo to parse IP addresses and lookup names.
OK bluhm
2024-08-27 06:03:20 +00:00
sthen
31e6f1a8e9 Change DHCP_SYNC_LEASE messages from log_info to log_debug, they result
in quite a lot of noise in a typical dhcpd sync setup.

From Michał Markowski, ok florian
2024-08-24 08:35:24 +00:00
jsg
7f966493ce FALLTROUGH -> FALLTHROUGH 2024-08-23 01:23:50 +00:00
millert
988a3bdaeb cron: use strtonum() and tighter limits on step values
Using strtonum() instead of atoi() gives us an extra layer of bounds
checking for free while parsing an entry.  This is in addition to
the existing bounds checking in set_range().  The step value is now
limited to the maximum range for an entry.  If the field consists
of a range, the step must not be larger than the difference between
the high and low parts of the range.  OK deraadt@
2024-08-23 00:58:04 +00:00
millert
0569e73d7d Change SIGCHLD handler to just set a flag.
We already call reap_kids() in multiple event loops so there is no
need to call waitpid() inside the handler itself.
OK denis@ deraadt@
2024-08-23 00:43:34 +00:00
jsg
1e0c60bff8 sync manual section numbers 2024-08-22 10:00:16 +00:00
tb
d2a044ef87 ospfd: fix whitespace error introduced in previous 2024-08-22 08:34:51 +00:00
florian
f885c9d92a inet_pton returns 0 and -1 for error.
Adjust the error check that is now wrong after the inet_aton -> inet_pton
conversion.

Noticed by & OK bluhm.
OK tb
2024-08-22 08:17:54 +00:00
florian
262a2674c1 Mechanically change inet_aton to inet_pton.
npppd does not document that it would accept truncated or otherwise
not fully spelled out IPv4 addresses.

ok yasuoka
2024-08-22 07:56:47 +00:00
job
2b6cb12d02 Increase maximum Signed Object size to 8MB
OK tb@ claudio@
2024-08-21 19:35:31 +00:00
florian
f6661b320d An area is either a decimal number or an IPv4 address.
This lets us replace inet_aton with inet_pton since we do not need
inet_aton's flexibility.

phessler, sthen and Tom Smyth all confirm that they never came across
a different way of specifying an area.

OK claudio, deraadt
2024-08-21 15:18:47 +00:00
florian
4f4fe40bc9 Mechanically replace inet_aton with inet_pton.
OK claudio, deraadt
2024-08-21 15:18:00 +00:00
florian
82905b67f7 An area is either a decimal number or an IPv4 address.
This lets us replace inet_aton with inet_pton since we do not need
inet_aton's flexibility.

phessler, sthen and Tom Smyth all confirm that they never came across
a different way of specifying an area.

OK claudio, deraadt
2024-08-21 15:16:56 +00:00
florian
b2b634ffc1 Get rid of inet_aton
OK deraadt
2024-08-21 15:00:25 +00:00
florian
a1b5517a32 Use getaddrinfo to lookup names and parse IP addresses.
OK deraadt
2024-08-21 14:59:49 +00:00
florian
28b8bcf042 Mechanically change inet_aton to inet_pton.
OK claudio, deraadt
2024-08-21 14:58:14 +00:00
florian
baba1a1480 Mechanically change inet_aton to inet_pton.
This could use getaddrinfo in places but the code is just too crufty
and my joo janta's turned black immediately.

OK deraadt
2024-08-21 14:57:05 +00:00
florian
ac6360cb39 Use getaddrinfo(3) to resolve hostnames / ip addresses.
OK dlg
2024-08-21 10:35:12 +00:00
florian
ae0a2ab3e8 We can fully spell out IP addresses in config files.
OK claudio
2024-08-21 09:20:36 +00:00
florian
e13b122f59 s/inet_aton/inet_pton/
OK claudio
2024-08-21 09:19:55 +00:00
florian
2471dd62a7 Mechanically change inet_aton to inet_pton.
OK claudio
2024-08-21 09:18:47 +00:00
florian
3aa6dc714b We can fully spell out IP addresses in config files.
OK claudio
2024-08-21 09:17:56 +00:00
florian
b840faef38 Use inet_pton to parse ext-communities with an IPv4 address.
No need for inet_aton's flexibility.
OK claudio
2024-08-21 09:17:05 +00:00
claudio
53f63e9d44 Use msgbuf_queuelen() instead of accessing the queued member directly.
OK tb@
2024-08-20 13:31:49 +00:00
job
68b5a753c4 Update Geofeed reference
RFC 9632 introduced additional constraints and requirements for RPKI-based
Geofeed authenticators (at my request).
2024-08-20 12:53:47 +00:00
claudio
64f32adac0 Use stats.msg_queue_len instead of looking into the msgbuf struct.
OK tb@
2024-08-20 12:00:20 +00:00
claudio
db359c8123 Use msgbuf_queuelen() instead of accessing wbuf.queue for msgbuf structs.
Also export the msgbuf queue len as a stats member so bgpctl does not need
to dig into the msgbuf structure inside struct peer.
This skips imsg related msgbuf since that will be handled by a imsgbuf
specific function.
OK tb@
2024-08-20 11:59:39 +00:00
millert
9170eb325d Fix CVE-2024-43688, buffer underflow for very large step values
In get_number(), reject values that are so large that they are
interpreted as negative numbers.  In set_range(), step values smaller
than one or larger than the "stop" value are ignored.  This prevents
bit_nset() from being called with out-of-range values.

Bug found by Dave G. of Supernetworks.
2024-08-19 15:08:21 +00:00
job
4f2c77f971 Prepare for releasing version 9.2 2024-08-19 12:44:33 +00:00
deraadt
4b30381471 fix comment 2024-08-18 20:08:58 +00:00
phessler
917cb6cdf9 add qwz firmware 2024-08-18 14:58:47 +00:00
mlarkin
22b23f348d Use 'int ch' instead of 'char ch' in one place for getopt.
Forgot one change during an earlier commit; use 'int ch' to make builds
complete without warning on arm64.

ok dv
2024-08-17 20:50:06 +00:00
denis
15adf2d1a9 Replace homemade copy_of() with strdup()
OK tb@
2024-08-17 15:42:20 +00:00
denis
895cab01f2 Allow PPP interface to run in an rdomain and get a default route installed in the same routing domain
Input and OK claudio@
2024-08-17 09:52:11 +00:00
florian
167ac360a3 Since we are not using a pid file the manuals render a bit strange.
Pointed out by tb
2024-08-17 09:07:33 +00:00
yasuoka
e1af567eac Make sure that the uptime field is always updated. Previously it was
used before initialized when the database has a session.
2024-08-16 09:54:21 +00:00
yasuoka
c0c32a87c2 Free memory as much as possible. Also, fix a use-after-free when exiting. 2024-08-16 09:52:16 +00:00
yasuoka
a06d4bdd1a Send a reply to the control client when DAE is timed out instead of
silence.  Also, fix a broken error string.
2024-08-16 09:50:09 +00:00
yasuoka
b59731c9fb Delete req_modified. Which is not used. 2024-08-16 09:45:52 +00:00
job
7cb76e5580 Ensure synchronization jobs are stopped when the timeout is reached
OK tb@ claudio@
2024-08-15 11:30:43 +00:00
claudio
d389b51dcd Call repo_check_timeout() before colleting the POLLOUT fds. Since
repo_abort() called by repo_check_timeout() will add messages to
be sent out.
OK tb@
2024-08-15 09:22:12 +00:00
claudio
fac3be8e1a Add filtered support to bgplgd.
OK tb@
2024-08-15 09:13:13 +00:00
yasuoka
3e976a28df Accept empty lines for authopts to fix the parser to accept the old
syntax.  It was broken by parse.y 1.18.  Found by Mike at mgm51.com.
2024-08-15 07:24:28 +00:00
claudio
09b2f24c94 Add 'bgpctl show rib filtered' support.
OK tb@
2024-08-14 19:10:51 +00:00
claudio
89ee02f7f3 Introduce 'rde rib Loc-RIB include filtered' a feature that includes
filtered prefixes in the Loc-RIB

This includes filtered prefixes into the Loc-RIB but they are marked
ineligible so nothing will select them but it is possible to show them
in bgpctl. So 'bppctl show rib filtered' will return all prefixes filtered
out by the input filters.

OK tb@
2024-08-14 19:09:51 +00:00
yasuoka
58911fd131 Messages from modules were leaked. Call imsg_free() for them. 2024-08-14 07:06:50 +00:00
yasuoka
30c0952ce6 Don't abort the query when it is requesting to the next module. 2024-08-14 07:04:54 +00:00
yasuoka
32ed937691 Initialize dae objects properly. 2024-08-14 04:47:08 +00:00
yasuoka
ce1078f6e8 Don't abort the query when a duplicated query is received. Also tweak
the log message.
2024-08-14 04:44:07 +00:00
op
d49c07c786 implement the report response for proc-filters too
Reported by renegm on GitHub:
<https://github.com/OpenSMTPD/OpenSMTPD/issues/1257>

ok gilles@
2024-08-12 09:32:44 +00:00
claudio
282ccd24f8 Print min-version of a RTR session.
OK tb@
2024-08-12 09:05:28 +00:00
claudio
d87cfbcc05 Add 'min-version' RTR config option and default to RTR version 1 by default.
The min-version pins a minimal required version for rtr session. This is
needed if specific PDUs are required and it ensures that the session is
not suddenly downgraded. This is important for ASPA where a minimum
version of 2 is required. Only then the ASPA PDUs are transmitted.

By default a RTR version of 1 is used but setting min-version to 2
will enable draft-ietf-sidrops-8210bis-14 support and enforce it
at the same time. Right now defaulting to version 2 is not possible
since draft-ietf-sidrops-8210bis failed to progress for a too long
time resulting in split eco system with various incompatible RTR
version 2 implementations.

OK tb@
2024-08-12 09:04:23 +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
jsg
7a7a726b09 use void when functions have no args
ok deraadt@
2024-08-10 05:32:28 +00:00
claudio
b0ea642a7b Remove the ibuf_size(pdu) % sizeof(uint32_t) == 0 since it is already
done in rtr_parse_header(). No need to do it twice.
2024-08-09 14:00:48 +00:00
claudio
228f6bd1a1 Adjust RTR ASPA pdu parser to draft-ietf-sidrops-8210bis-14 which finally
adjusted the pdu to follow the other ASPA drafts.
OK tb@
2024-08-09 13:52:09 +00:00
deraadt
6798d9df84 ansi functions and prototypes
ok denis
2024-08-09 05:16:13 +00:00
yasuoka
138f958c9c Fix a typo 2024-08-07 07:15:18 +00:00
jmc
61a108c897 - sort SEE ALSO
- radiusd_file(8) is section 8, not 5
2024-08-04 05:18:28 +00:00
yasuoka
563222a6e5 Use "module" for the modules. Add a link to radiusd_file(8) from
radiusd_eap2mschap(8).
2024-08-04 03:56:57 +00:00
millert
493aa13946 Set system ID field in the PVD to OpenBSD
This matches what we use in mkybrid.  From Crystal Kolipe.
2024-08-03 22:23:32 +00:00
yasuoka
682f074d85 Backout previous. It was incompleted and too early. 2024-08-02 12:43:55 +00:00
yasuoka
7747427519 Use arc4random_uniform(n) instead of "% n". 2024-08-01 00:58:14 +00:00
yasuoka
1258aca7ac Change the routing entry of the pool addresses from blackhole to
reject.  This is better because the routing cache can be purged by the
reject.
2024-08-01 00:05:16 +00:00
millert
a63a57f896 pwd_mkdb: limit db entries to _PW_BUF_LEN to match libc
Otherwise, it is possible to create a passwd(5) entry that is too
large for getpwent(3), which ignores database entries larger than
_PW_BUF_LEN.  This adds a check in db_store() so that we do not
store an entry larger than getpwent(3) can read.  Callers of
pwd_mkdb(8), typically via pw_mkdb(3), already check for failure.

In most cases, the checks in chpass(1) will prevent a user from
creating an entry that is too large by changing their gecos field.
However, it is only when storing the db record that we know the
true size.

OK deraadt@
2024-07-28 19:13:26 +00:00
jmc
16d24e0f6e - document "ca" in the action ... relay section
from philipp plus openbsd at bureaucracy de

- within the "ca" section, refer to "listen on" and "action ... relay",
which is the actual syntax

ok op
2024-07-26 06:24:52 +00:00
tb
a6002f6a1c Silence a false positive warning for gcc
The code path gcc is whining about ensures that the struct auth in
question is initialized, but the pile of garbage that is gcc's use
of uninitialized warnings can't figure that one out. Enough time on
this was wasted during the last few releases that silencing gcc with
annoying workarounds may be the lesser evil.

ok claudio
2024-07-25 08:44:39 +00:00
yasuoka
a852e27a98 dd "msgauth" option for "test" command to specify whether use
Message-Authentication or not.
2024-07-24 08:27:20 +00:00
yasuoka
8185dbe7c4 Fix ipcp module to use (the maximum sequence number from the db) + 1
properly.
2024-07-22 10:00:16 +00:00
yasuoka
c0127aec83 Modify ipcp module to return a result for
IMSG_RADIUSD_MODULE_IPCP_DISCONNECT and radiusctl to handle the
result.
2024-07-22 09:39:23 +00:00
yasuoka
27a2e2e111 Make some functions "static". 2024-07-22 09:27:16 +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
yasuoka
e83d1c6743 Send Access-Reject when the authentication is not handled or the user
is not found.
2024-07-18 22:40:09 +00:00
yasuoka
e1e88b6361 unveil .db is needed. Also move pledge() earlier. 2024-07-18 22:18:00 +00:00
yasuoka
f48aaf66ad Add a link to radiud_file(8) 2024-07-18 00:28:53 +00:00
yasuoka
a6d690cc62 Fix some gcc warnings 2024-07-17 11:31:46 +00:00
deraadt
67b02a138c minor repairs 2024-07-17 11:20:24 +00:00
yasuoka
eb4d56d74c Error if config parameter is unknown. This also fixes a gcc warning.
spotted by deraadt
2024-07-17 11:19:27 +00:00
yasuoka
291c2f2f56 Document "authentication-filter". 2024-07-17 11:13:22 +00:00
yasuoka
a449bbce95 Decrypt "Password" attribute always before passing the packet to
modules.  Also, don't assume the authenticator of the packet from the
module that has no secret is valid.
2024-07-17 11:05:11 +00:00
yasuoka
43015101fc Delete log_info() line for debug. 2024-07-17 10:15:39 +00:00
yasuoka
6b12042132 Fix indent 2024-07-17 08:26:19 +00:00
miod
ca9586a4f0 Only perform the static_assert checks in C>=11 environment; unbreaks build
on platforms using gcc.
2024-07-16 06:18:20 +00:00
jmc
3246983464 fix SEE ALSO and a word tweak; 2024-07-14 18:11:18 +00:00
jmc
b92cdcae95 grammar and macro tweaks; 2024-07-14 18:09:05 +00:00
jmc
110f461944 zap a stray Nd line; 2024-07-14 18:03:59 +00:00
yasuoka
a04dd6c38c Add radiusd_file(5) and link it from radiusd.conf(5). 2024-07-14 16:22:59 +00:00
yasuoka
b0e7e43d13 Add new radiusd_eap2mschap module. It provides conversions from EAP
to MSCHAPv2.
2024-07-14 16:09:23 +00:00
yasuoka
a6eb37b5e7 Move radius_attr_{,un}hide() to radius_subr.c. 2024-07-14 15:31:49 +00:00
yasuoka
ed1dc9254d Add "authentication-filter". Add new 2 imsg types so that
authentication modules can request the next authentication and the
next authentication can receive the result of the previous and modify
the result.
2024-07-14 15:27:57 +00:00
yasuoka
e303f42502 Set length of MPPE send/recv key. 2024-07-14 15:13:41 +00:00
yasuoka
0156c8363b Add radiusd_file(8) module. It provides authencation by a local file. 2024-07-14 13:44:30 +00:00