1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00
Commit Graph

229574 Commits

Author SHA1 Message Date
job
891d6bce9c Allow imposing constraints on RPKI trust anchors
The ability to constrain a RPKI Trust Anchor's effective signing
authority to a limited set of Internet Number Resources allows
Relying Parties to enjoy the potential benefits of assuming trust,
within a bounded scope.

Some examples: ARIN does not support inter-RIR IPv6 transfers, so
it wouldn't make any sense to see a ROA subordinate to ARIN's trust
anchor covering RIPE-managed IPv6 space. Conversely, it wouldn't
make sense to observe a ROA covering ARIN-managed IPv6 space under
APNIC's, LACNIC's, or RIPE's trust anchor - even if a derived trust
arc (a cryptographically valid certificate path) existed. Along these
same lines, AFRINIC doesn't support inter-RIR transfers of any kind,
and none of the RIRs have authority over private resources like
10.0.0.0/8 and 2001:db8::/32.

For more background see:
https://datatracker.ietf.org/doc/draft-snijders-constraining-rpki-trust-anchors/
https://mailman.nanog.org/pipermail/nanog/2023-September/223354.html

With and OK tb@, OK claudio@
2023-10-13 12:06:49 +00:00
claudio
08626ad373 Force the router-id on all bgpd instances to make the expected output
predictable.
2023-10-13 07:55:57 +00:00
claudio
383b68ad89 Add missing Ns in argument list of announce (IPv4|IPv6) ... 2023-10-13 07:37:35 +00:00
tb
3f15d3c9cd Tweak previous by using the argument name, not its type 2023-10-13 05:49:34 +00:00
tb
ec59231e6b Improve the description of X509_ALGOR_dup(3)
The old description was vague, but strictly speaking a lie, so make it
more precise and turn the lie into a truth.
2023-10-13 05:47:35 +00:00
bluhm
650068c3fd Remove ancient version of zlib bundled with GNU cvs.
Avoid false positive in security scan.  Removal of embedded zlib
ensures that cvs is linked dynamically with /usr/lib/libz.so.  We
do not want any zlib 1.1.3 from 2001 in our source tree.

no binary diff; OK millert@ deraadt@
2023-10-13 00:00:51 +00:00
bluhm
fdc5aacd39 Test retry after DNS lookup failure. 2023-10-12 22:41:29 +00:00
bluhm
c1f8818c70 Retry DNS lookup for remote loghost.
If DNS lookup for a remote loghost configured in syslog.conf did
not work at startup, the entry was ignored.  Better retry the lookup
in intervals until it succeeds.  Improve debug output to print IP
address after resolution.  Unify retry code that resolves DNS for
UDP and connects to TCP server.

testing and feedback from Paul de Weerd; OK deraadt@
2023-10-12 22:36:54 +00:00
bluhm
7b8683a174 pflog(4) logs packet dropped by default rule with block.
If a packet is malformed, it is dropped by pf(4).  The rule referenced
in pflog(4) is the default rule.  As the default rule is a pass
rule, tcpdump printed "pass" although the packet was actually
dropped.  To avoid confusion, change the action to drop.  Then
tcpdump prints "block".

OK sashan@ kn@
2023-10-12 19:15:21 +00:00
tb
06de222456 x509_algor: fix error message 2023-10-12 17:14:17 +00:00
anton
a762f82be5 Let vnconfig select an unused device as opposed of unconditionally
assume vnd0 is available.
2023-10-12 16:59:23 +00:00
deraadt
15330de0e9 Static binaries which do not call execve() were not calling
pinsyscall(SYS_execve, ...).  Upon review, this is a fairly small
set of programs which either pledge() aggressively or don't usually
operate in a risky operating environment.  We now point at a location
which is definately not a "syscall" instruction.
ok kettenis
2023-10-12 16:37:05 +00:00
cheloha
e97dbaaa05 timeout: add TIMEOUT_MPSAFE flag
Add a TIMEOUT_MPSAFE flag to signal that a timeout is safe to run
without the kernel lock.  Currently, TIMEOUT_MPSAFE requires
TIMEOUT_PROC.  When the softclock() is unlocked in the future this
dependency will be removed.

On MULTIPROCESSOR kernels, softclock() now shunts TIMEOUT_MPSAFE
timeouts to a dedicated "timeout_proc_mp" bucket for processing by the
dedicated softclock_thread_mp() kthread.  Unlike softclock_thread(),
softclock_thread_mp() is not pinned to any CPU and runs run at IPL_NONE.

Prompted by bluhm@.  Lots of input from bluhm@.  Joint work with mvs@.

Prompt: https://marc.info/?l=openbsd-tech&m=169646019109736&w=2
Thread: https://marc.info/?l=openbsd-tech&m=169652212131109&w=2

ok mvs@
2023-10-12 15:32:38 +00:00
cheloha
b9c158ac99 bt(5), btrace(8): add support for binary modulo operator ('%')
Link: https://marc.info/?l=openbsd-tech&m=169695435209410&w=2

ok mpi@
2023-10-12 15:16:44 +00:00
claudio
bcdda5504d Before calling rde_generate_updates() with EVAL_ALL ensure that the new
path is actually eligible. If this is not the case pass NULL instead.
This is an optimisation to bypass extra work if both old and new path
were ineligible.
OK tb@
2023-10-12 14:22:08 +00:00
claudio
e17c4daaf7 In up_generate_addpath_all() ensure that the new prefix is valid.
This should fix a fatal error reported by Arend Brouwer (arend at eritap com)
when "announce add-path send all" is used.
As a workaround "announce add-path send best plus 500" can used.

OK tb@
2023-10-12 14:16:28 +00:00
schwarze
19920707c0 for a few sysctl nodes, mention standard or at least more widely
available libc API functions and utility programs that produce
equivalent output on OpenBSD;
OK deraadt@
2023-10-12 12:56:26 +00:00
kn
6b4465c92c Remove default sets answer
The autoinstall(8) response file contains only non-defaults, except for
        Set name(s)? (or 'abort' or 'done') [done] done
which is the hardcoded default since 2009.

Added in 2019 r1.23 "Let sysupgrade(8) create auto_upgrade.conf file [...]"
with all others, remove the exception.

OK florian
2023-10-12 12:31:15 +00:00
claudio
aed8996763 Add a fairly minimal ixp setup generated by arouteserver
This does a lot of community manipulation and also tests a few other
bits of code (prepends, roa, prefix-set).
2023-10-12 09:18:56 +00:00
tb
26cc26e14a x509_algor: add a few missing includes 2023-10-12 04:53:45 +00:00
djm
6e06ca5ebe typos and extra debug trace calls 2023-10-12 03:51:08 +00:00
djm
95caf9b2bd ensure logs are owned by correct user; feedback/ok dtucker@ 2023-10-12 03:48:53 +00:00
djm
7060ee85bb 64 %-expansion keys ought to be enough for anybody; ok dtucker
(we just hit the previous limit in some cases)
2023-10-12 03:36:32 +00:00
djm
443a55199b don't dereference NULL pointer when hashing jumphost 2023-10-12 02:48:43 +00:00
djm
a8e6a8a7e8 add %j token that expands to the configured ProxyJump hostname (or
the empty string if this option is not being used).
bz3610, ok dtucker
2023-10-12 02:18:18 +00:00
djm
57666a8ae0 release GSS OIDs only at end of authentication; bz2982, ok dtucker@ 2023-10-12 02:15:53 +00:00
djm
85c6980a6c mask SIGINT/TERM/QUIT/HUP before checking quit_pending and use ppoll()
to unmask them in the mainloop. Avoids race condition between signaling
ssh to exit and polling. bz3531; ok dtucker
2023-10-12 02:12:53 +00:00
djm
5b05d4e0ea sync usage() with ssh.1; spotted by kn@ 2023-10-11 23:23:58 +00:00
djm
5ef5756de4 ssh -Q does not make sense with other command-line options, so give
it its own line in the manpage
2023-10-11 23:14:33 +00:00
djm
6a04e5b8d5 add ChannelTimeout support to the client, mirroring the same option
in the server. ok markus@
2023-10-11 22:42:26 +00:00
djm
71ad7c6518 add support for reading ED25519 private keys in PEM PKCS8 format;
ok markus@ tb@
2023-10-11 22:41:05 +00:00
tobhe
804d0a749c Prevent deref-after-free when tdb_timeout() fires on invalid new tdb.
When receiving a pfkeyv2 SADB_ADD message, a newly created tdb can
fail in tdb_init(), which causes the tdb to not get added to the
global tdb list and an immediate dereference.  If a lifetime timeout
triggers on this tdb, it will unconditionally try to remove it from
the list and in the process deref once more than allowed,
causing a one bit corruption in the already freed up slot in the
tdb pool.

We resolve this issue by moving timeout_add() after tdb_init()
just before puttdb().  This means tdbs failing initialization
get discarded immediately as they only hold a single reference.
Valid tdbs get their timeouts activated just before we add them
to the tdb list, meaning the timeout can safely assume they are
linked.

Feedback from mvs@ and millert@
ok mvs@ mbuhl@
2023-10-11 22:13:16 +00:00
anton
4be5cdd0cd Check if loopback interfaces used are skipped by pf as opposed of
bailing out if any loopback interface is skipped other than lo0.
2023-10-11 18:07:56 +00:00
anton
891a4c8234 Infer rdomains from environment variables N1 and N2 like many others in
regress/sys/net already does. No functional change as the defaults
remains the same.
2023-10-11 18:07:15 +00:00
kn
c10f63ba96 Remove dead CRYPTOCHUNK usage
install.sub r1.1245 "Ask for disk crypto after root disk question" got rid
of global CRYPTO* variables;  no functional change.
2023-10-11 17:53:52 +00:00
cheloha
961828bc19 kernel: expand fixed clock interrupt periods to 64-bit values
Technically, all the current fixed clock interrupt periods fit within
an unsigned 32-bit value.  But 32-bit multiplication is an accident
waiting to happen.  So, expand the fixed periods for hardclock,
statclock, profclock, and roundrobin to 64-bit values.

One exception: statclock_mask remains 32-bit because random(9) yields
32-bit values.  Update the initclocks() comment to make it clear that
this is not an accident.
2023-10-11 15:42:44 +00:00
cheloha
67b188dd4d clockintr: move clockintr_schedule() into public API
Prototype clockintr_schedule() in <sys/clockintr.h>.
2023-10-11 15:07:04 +00:00
espie
d6425245cb put "stub" within grasp of -DREGRESSION_TESTING.
Extend it slightly: do not stub quirks, so that caching mechanisms work
as usual even when using stubs.
2023-10-11 13:54:43 +00:00
espie
f04df370e6 missing state in locator call, surprised nobody else ran into that 2023-10-11 13:52:29 +00:00
tb
f6160bdbdd Some housekeeping in x_algor
Fix includes and zap an empty line.

ok jsing
2023-10-11 13:22:11 +00:00
tb
97fce2b478 Rewrite X509_ALGOR_set0()
The current implementation is a complete mess. There are three cases:
1) ptype == V_ASN1_UNDEF: parameter must be freed and set to NULL.
2) ptype == 0: existing non-NULL parameters are left untouched, NULL
   parameters are replaced with ASN1_TYPE_new()'s wacky defaults.
3) otherwise allocate new parameters if needed and set them to ptype/pval.
In all three cases free the algorithm and set it to aobj.

The challenge now is to implement this using nine if statements and one
else clause... We can do better. This preserves existing behavior. There
would be cleaner implementations possible, but they would change behavior.

There are many callers in the ecosystem that do not error check
X509_ALGOR_set0() since OpenSSL failed to do so. So this was carefully
rewritten to leave alg in a consisten state so that unchecking callers
don't encounter corrupted algs.

ok jsing
2023-10-11 13:20:18 +00:00
tb
fc20c8359d x509_algor: Turn expected failure into actual failure now that the API is
fixed.
2023-10-11 13:13:25 +00:00
tb
324abc4942 Ensure that out_value is initialized even if out_type is NULL
This fixes the printf in the x509_algor regress.

ok jsing
2023-10-11 13:12:46 +00:00
tb
449ce39a6f Rewrite X509_ALGOR_get0()
Make the logic slightly less convoluted. Preserve the behavior that
*ppval remains unset if pptype == NULL for now. However, ensure that
*ppval is set to NULL if pptype is V_ASN1_UNDER.

ok jsing
2023-10-11 13:10:13 +00:00
tb
05dcc22ace Add internal version of X509_ALGOR_set_md()
X509_ALGOR_set_md() is a void function that cannot easily be error checked.
The caller has to jump through hoops to make sure this function doesn't
fail. Prepare replacing this internally with X509_ALGOR_set_evp_md(), which
allows error checking. There is one slight change of behavior: if the EVP_MD
object passed in does not have an OID known to the library, then this new
API fails.

It is unclear what the library should do with such an object and people
who use EVP_MD_meth_new() need to know what they are doing anyway and they
are better off teaching the lib about the OID if they're going to be
messing with certs.

Oh, and the prototype is in x509_local.h because the rest of this API is
in x509.h despite being implemented in asn1/.

ok jsing
2023-10-11 13:05:18 +00:00
tb
7e2b1f45a2 Add preallocation dance for X509_ALGOR_set_md() as documented 2023-10-11 13:00:16 +00:00
stsp
73b89ece6e dwqe(4) may now attach via pci(4) 2023-10-11 12:57:53 +00:00
stsp
6e9149a4c7 Add initial support for Elkhart Lake ethernet to dwqe(4).
For now, only attach to PSE0/RGMII (device ID 0x4ba0) which is the
only device I have access to for testing.

There is a known problem where Tx throughput is lower than expected.
This is being looked into.

ok kettenis@
2023-10-11 12:52:00 +00:00
tb
5d8d1391aa Clean up X509_ALGOR_cmp()
This is currently written in what is likely the most stupid way possible.
Rewrite this function in a more straightforward way.

ok jsing
2023-10-11 12:51:07 +00:00
tb
414d371c90 Add regress coverage for X509_ALGOR_*
This covers the setters and getters. Serialization and deserialization as
well as comparison is already well covered by the pieces of regress using
certs.

There is currently one printf indicating failure. This will be fixed
shortly.
2023-10-11 12:49:00 +00:00