openbsd
2 years agofix typos; Martin Vahlensieck
sthen [Thu, 17 Mar 2022 18:27:55 +0000 (18:27 +0000)]
fix typos; Martin Vahlensieck

2 years agoRewrite legacy TLS unexpected handshake message handling.
jsing [Thu, 17 Mar 2022 17:28:08 +0000 (17:28 +0000)]
Rewrite legacy TLS unexpected handshake message handling.

Rewrite the code that handles unexpected handshake messages in the legacy
TLS stack. Parse the TLS message header up front, then process it based on
the message type. Overall the code should be more strict and we should
reject various invalid messages that would have previously been accepted.

I also reviewed steve's experimental code and fixed the bug that it
contained.

ok inoguchi@ tb@

2 years agoClean up and simplify ssl3_renegotiate{,_check}()
jsing [Thu, 17 Mar 2022 17:24:37 +0000 (17:24 +0000)]
Clean up and simplify ssl3_renegotiate{,_check}()

ok inoguchi@ tb@

2 years agoRemove const from tls1_transcript_hash_value()
jsing [Thu, 17 Mar 2022 17:22:16 +0000 (17:22 +0000)]
Remove const from tls1_transcript_hash_value()

This function populates the passed *out argument, hence it should not be
marked const.

ok tb@

2 years agoRework ASN1_STRING_set()
jsing [Thu, 17 Mar 2022 17:17:58 +0000 (17:17 +0000)]
Rework ASN1_STRING_set()

Rework ASN1_STRING_set() so that we always clear and free an existing
allocation, prior to storing the new data. This fixes a number of issues,
including a failure to zero data if the existing allocation was too small.
This also fixes other bugs such as leaving the allocation uninitialised
if NULL is passed for data. Require -1 where strlen() is expected and
improve length and overflow checks.

ok inoguchi@ tb@

2 years agoDeclare dtps_static array const to move it into read-only section.
bluhm [Thu, 17 Mar 2022 14:53:59 +0000 (14:53 +0000)]
Declare dtps_static array const to move it into read-only section.
OK mpi@

2 years agoUpdate to tzdata2022a from www.iana.org. Major changes:
millert [Thu, 17 Mar 2022 14:37:26 +0000 (14:37 +0000)]
Update to tzdata2022a from iana.org.  Major changes:
 o Palestine will spring forward on 2022-03-27, not -03-26.

2 years agoUse the refcnt API with struct ucred.
visa [Thu, 17 Mar 2022 14:23:34 +0000 (14:23 +0000)]
Use the refcnt API with struct ucred.

OK bluhm@

2 years agoUse the refcnt API in bpf.
visa [Thu, 17 Mar 2022 14:22:03 +0000 (14:22 +0000)]
Use the refcnt API in bpf.

OK sashan@ bluhm@

2 years agoMake tcpdump(8) show 802.11ac VHT capability and operation IEs in -v mode.
stsp [Thu, 17 Mar 2022 14:00:53 +0000 (14:00 +0000)]
Make tcpdump(8) show 802.11ac VHT capability and operation IEs in -v mode.

ok sthen@

2 years agoCheck scroll-on-clear for ED also.
nicm [Thu, 17 Mar 2022 13:39:13 +0000 (13:39 +0000)]
Check scroll-on-clear for ED also.

2 years agoAdd an option (scroll-on-clear) to control if tmux scrolls into history
nicm [Thu, 17 Mar 2022 11:35:37 +0000 (11:35 +0000)]
Add an option (scroll-on-clear) to control if tmux scrolls into history
on clear, from Robert Lange in GitHub issue 3121.

2 years agoIn swap_io() allocate the buffer before doing encryption.
mpi [Thu, 17 Mar 2022 10:15:13 +0000 (10:15 +0000)]
In swap_io() allocate the buffer before doing encryption.

If the allocation fails due to memory pressure no time is wasted doing
encryption.  This also simplify the error path.

Tested by sthen@.

ok kn@, miod@, kettenis@, tb@

2 years agoFix previous commit; the FDT header is big-endian so we need to do the
kettenis [Thu, 17 Mar 2022 00:28:29 +0000 (00:28 +0000)]
Fix previous commit; the FDT header is big-endian so we need to do the
appropriate byte swapping.

2 years agoJust say that the databases are intended for use by apropos(1), whatis(1),
schwarze [Wed, 16 Mar 2022 23:23:24 +0000 (23:23 +0000)]
Just say that the databases are intended for use by apropos(1), whatis(1),
and man(1), without restricting that statement to "man -k".
Suggested by and patch OK'ed by jmc@.

While only apropos(1) and whatis(1) strictly require the database
and while our man(1) implementation can find many manual pages even
when no database is available or when the database is incomplete or
corrupt, it does use the database even without -k whenever possible.
Consequently, this change makes the manual page less confusing.

2 years agoWhen we allocate space a buffer with some extra space for the FDT, adjust
kettenis [Wed, 16 Mar 2022 22:32:50 +0000 (22:32 +0000)]
When we allocate space a buffer with some extra space for the FDT, adjust
the size of the FDT to reflect the size of that buffer.  This prevents
an FDT overflow if the original FDT doesn't have enough space for the
additional properties that we add to it in our bootloader.

Fixes boot on the mcbin.
tested by bluhm@, ok patrick@

2 years agoMake sure contents of vroute messages are aligned properly.
tobhe [Wed, 16 Mar 2022 18:17:20 +0000 (18:17 +0000)]
Make sure contents of vroute messages are aligned properly.
Fixes address autoconfiguration on octeon.

Found by and ok mbuhl@

2 years agoThe 'status' parameter to uuid_* functions is uint32_t, not int.
krw [Wed, 16 Mar 2022 17:03:13 +0000 (17:03 +0000)]
The 'status' parameter to uuid_* functions is uint32_t, not int.

No intentional functional change.

2 years agoAdd an option to set the character used for unused areas of the
nicm [Wed, 16 Mar 2022 17:00:17 +0000 (17:00 +0000)]
Add an option to set the character used for unused areas of the
terminal, GitHub issue 3110.

2 years agoRemove an unneeded include.
visa [Wed, 16 Mar 2022 16:17:46 +0000 (16:17 +0000)]
Remove an unneeded include.

2 years agoUse the refcnt API in kqueue.
visa [Wed, 16 Mar 2022 14:38:43 +0000 (14:38 +0000)]
Use the refcnt API in kqueue.

OK dlg@ bluhm@

2 years agoAdd refcnt_shared() and refcnt_read()
visa [Wed, 16 Mar 2022 14:13:01 +0000 (14:13 +0000)]
Add refcnt_shared() and refcnt_read()

refcnt_shared() checks whether the object has multiple references.
When refcnt_shared() returns zero, the caller is the only reference
holder.

refcnt_read() returns a snapshot of the counter value.

refcnt_shared() suggested by dlg@.

OK dlg@ mvs@

2 years agoFix dependency to build bn_mod_sqrt.
bluhm [Wed, 16 Mar 2022 12:37:44 +0000 (12:37 +0000)]
Fix dependency to build bn_mod_sqrt.

2 years agoMake gcc 4 happier about x509_addr.c
tb [Wed, 16 Mar 2022 11:44:36 +0000 (11:44 +0000)]
Make gcc 4 happier about x509_addr.c

gcc 4 on sparc64 issues a few 'warning: value computed is not used'.
There are two cases: sk_set_cmp_function() returns the old comparison
function of the stack which we don't care about. The one warning about
an sk_delete() is about a return value that we know already and which
we will free a few lines down.

ok inoguchi miod

2 years agoUpdate to nsd 4.4.0
florian [Wed, 16 Mar 2022 10:14:50 +0000 (10:14 +0000)]
Update to nsd 4.4.0

tested by sthen and me
OK sthen

2 years agoLibreSSL 3.5.2
bcook [Tue, 15 Mar 2022 21:15:08 +0000 (21:15 +0000)]
LibreSSL 3.5.2

2 years agoInitialise *out_name at the start of i2t_ASN1_OBJECT_name().
jsing [Tue, 15 Mar 2022 18:47:22 +0000 (18:47 +0000)]
Initialise *out_name at the start of i2t_ASN1_OBJECT_name().

ok tb@

2 years agoImplement additional error checking for aplsmc_read_key() such that we can
kettenis [Tue, 15 Mar 2022 18:46:15 +0000 (18:46 +0000)]
Implement additional error checking for aplsmc_read_key() such that we can
detect when we read a key that isn't supported by the firmware.
Only provide RTC functionality if the "CLKM" key is implemented.
Fixes reading the time on machines with old SMC firmware from macOS 11.x.

ok jsg@

2 years agoCheck BIO_reset() return value to make gcc happy.
tb [Tue, 15 Mar 2022 18:29:12 +0000 (18:29 +0000)]
Check BIO_reset() return value to make gcc happy.

2 years agoAlways use letoh32(gh.gh_part_num) instead of NGPTPARTITIONS when
krw [Tue, 15 Mar 2022 17:59:39 +0000 (17:59 +0000)]
Always use letoh32(gh.gh_part_num) instead of NGPTPARTITIONS when
scanning the GPT partition table. gh.gh_part_num reflects the actual
size of the table read from/written to the disk and scanning
possible entries between this value and the maximum allowed size
of a partition table is pointless.

No intentional functional change.

2 years agologin class routing table should be honored when
solene [Tue, 15 Mar 2022 17:13:50 +0000 (17:13 +0000)]
login class routing table should be honored when
doing a full login with su -l

ok millert@
patch from Matthew Martin < phy1729 at gmail dot com >

2 years agoReplace the eor member of struct prefix with a flag. Saves a byte that
claudio [Tue, 15 Mar 2022 16:50:29 +0000 (16:50 +0000)]
Replace the eor member of struct prefix with a flag. Saves a byte that
will be reused soon.
OK denis@ tb@

2 years agoAdd a simple regress to verify that the infinite loop in BN_mod_sqrt()
tb [Tue, 15 Mar 2022 16:28:42 +0000 (16:28 +0000)]
Add a simple regress to verify that the infinite loop in BN_mod_sqrt()
is fixed.

2 years agoFix infinite loop in BN_mod_sqrt()
tb [Tue, 15 Mar 2022 15:52:39 +0000 (15:52 +0000)]
Fix infinite loop in BN_mod_sqrt()

A bug in the implementation of the Tonelli-Shanks algorithm can lead to
an infinite loop. This loop can be hit in various ways, in particular on
decompressing an elliptic curve public key via EC_POINT_oct2point() - to
do this, one must solve y^2 = x^3 + ax + b for y, given x.

If a certificate uses explicit encoding for elliptic curve parameters,
this operation needs to be done during certificate verification, leading
to a DoS. In particular, everything dealing with untrusted certificates
is affected, notably TLS servers explicitly configured to request
client certificates (httpd, smtpd, various VPN implementations, ...).
Ordinary TLS servers do not consume untrusted certificates.

The problem is that we cannot assume that x^3 + ax + b is actually a
square on untrusted input and neither can we assume that the modulus
p is a prime. Ensuring that p is a prime is too expensive (it would
likely itself lead to a DoS). To avoid the infinite loop, fix the logic
to be more resilient and explicitly limit the number of iterations that
can be done.  The bug is such that the infinite loop can also be hit for
primes = 3 (mod 4) but fortunately that case is optimized earlier.

It's also worth noting that there is a size bound on the field size
enforced via OPENSSL_ECC_MAX_FIELD_BITS (= 661), which help mitigate
further DoS vectors in presence of this fix.

Reported by Tavis Ormandy and David Benjamin, Google
Patch based on the fixes by David Benjamin and Tomas Mraz, OpenSSL

ok beck inoguchi

2 years agodocument noconfigurejunk, assuming it works as expected
espie [Tue, 15 Mar 2022 14:53:53 +0000 (14:53 +0000)]
document noconfigurejunk, assuming it works as expected

2 years agoRefactor prefix_adjout_update(). Move the new prefix logic up and
claudio [Tue, 15 Mar 2022 14:39:34 +0000 (14:39 +0000)]
Refactor prefix_adjout_update(). Move the new prefix logic up and
then just fall through the update path. This is more in line with
prefix_update() and will make further work simpler.
OK tb@

2 years agoFix build after recent IKEv2 message fragment retransmit change.
tobhe [Tue, 15 Mar 2022 13:07:33 +0000 (13:07 +0000)]
Fix build after recent IKEv2 message fragment retransmit change.
Found by anton@

2 years agosync
sthen [Tue, 15 Mar 2022 13:00:30 +0000 (13:00 +0000)]
sync

2 years agoEnable IP header checksum offloading in ix(4).
jan [Tue, 15 Mar 2022 11:22:10 +0000 (11:22 +0000)]
Enable IP header checksum offloading in ix(4).

ok jmatthew@

2 years agoAdd a test for expanding macros in large-community strings.
claudio [Tue, 15 Mar 2022 11:16:25 +0000 (11:16 +0000)]
Add a test for expanding macros in large-community strings.

2 years agoChange how $macros are expanded in the config.
claudio [Tue, 15 Mar 2022 11:13:48 +0000 (11:13 +0000)]
Change how $macros are expanded in the config.

Expand $macros not only at the start of a yacc token but also inside STRING
elements. STRING elements are used e.g. for community specifications and
it makes sense to allow $FOO:$BAR to correctly expand. There is no expansion
of macros in quoted strings (both single and double quotes).

Factor out the macro expand logic and with this introduce its own lookup
buffer for the macro name. For expansion to work inside STRING the char
after the makro name must be a character not allowed in macro names (not
alpha-numerical or '_').

Add extra checks to set variables. Mainly restrict length of the name and
also make sure it does not include not allowed characters.
OK tb@

2 years agoFix Tx rate used by rtwn(4) and urtwn(4) for RTS frames.
stsp [Tue, 15 Mar 2022 09:23:01 +0000 (09:23 +0000)]
Fix Tx rate used by rtwn(4) and urtwn(4) for RTS frames.

Using ni_txrate for RTS is a bad choice since it could go up to 54 Mbit/s.
The AP needs to receive our RTS frame reliably. Usually, 1 Mbit/s is used
for RTS, but this hurts throughput and does not really make sense on today's
wifi networks.

Use 1 Mbit/s in 11b mode, and otherwise use 24 Mbit/s, as damien@
already hard-coded in urtwn long ago.

ok kevlo@

2 years agoFix Tx rate used by rtwn(4) and urtwn(4) for RTS frames.
stsp [Tue, 15 Mar 2022 09:22:56 +0000 (09:22 +0000)]
Fix Tx rate used by rtwn(4) and urtwn(4) for RTS frames.

Using ni_txrate for RTS is a bad choice since it could go up to 54 Mbit/s.
The AP needs to receive our RTS frame reliably. Usually, 1 Mbit/s is used
for RTS, but this hurts throughput and does not really make sense on today's
wifi networks.

Use 1 Mbit/s in 11b mode, and otherwise use 24 Mbit/s, as damien@
already hard-coded in urtwn long ago.

ok kevlo@

2 years agoremove if_vxlan.h unused after if_vxlan.c rev 1.84
jsg [Tue, 15 Mar 2022 08:15:23 +0000 (08:15 +0000)]
remove if_vxlan.h unused after if_vxlan.c rev 1.84
ok kevlo@ claudio@

2 years agoif we pass exact pkg args, just check that their files are there instead
espie [Tue, 15 Mar 2022 08:12:53 +0000 (08:12 +0000)]
if we pass exact pkg args, just check that their files are there instead
of the full pkgtree, useful for debug

2 years agoFix crash caused by confusion between requested device and last used one
ratchov [Tue, 15 Mar 2022 05:53:37 +0000 (05:53 +0000)]
Fix crash caused by confusion between requested device and last used one

Found by and ok semarie@

2 years agoimprove DEBUG_CHANNEL_POLL debugging message
djm [Tue, 15 Mar 2022 05:27:37 +0000 (05:27 +0000)]
improve DEBUG_CHANNEL_POLL debugging message

2 years agoEnable checksum offloads. The nic does all the work here, so we don't
jmatthew [Tue, 15 Mar 2022 02:07:21 +0000 (02:07 +0000)]
Enable checksum offloads.  The nic does all the work here, so we don't
need to calculate header offsets for it.

ok dlg@

2 years agounload the dmamap in bnxt_dmamem_free.
dlg [Mon, 14 Mar 2022 23:41:42 +0000 (23:41 +0000)]
unload the dmamap in bnxt_dmamem_free.

this is technically not necessary, but it makes it feel symmetrical
with bnxt_dmamem_alloc which loads it.

ok jmatthew@

2 years agoUnbreak the tree, revert commitid aZ8fm4iaUnTCc0ul
tb [Mon, 14 Mar 2022 22:38:43 +0000 (22:38 +0000)]
Unbreak the tree, revert commitid aZ8fm4iaUnTCc0ul

This reverts the commit protecting the list and hashes in the PCB tables
with a mutex since the build of sysctl(8) breaks, as found by kettenis.

ok sthen

2 years agoadd -k flag to gzip and gunzip
solene [Mon, 14 Mar 2022 21:52:08 +0000 (21:52 +0000)]
add -k flag to gzip and gunzip

When using this flag, the input file is kept after
compression or decompression, this makes our gzip
more compatible with the other gzip

changes reworked by jca@, thanks
ok jca@ millert@

2 years agoAdd a few regress test cases for name constraints.
tb [Mon, 14 Mar 2022 21:30:48 +0000 (21:30 +0000)]
Add a few regress test cases for name constraints.

From Alex Wilson

2 years agoAllow constraints of the form @domain.com
tb [Mon, 14 Mar 2022 21:29:46 +0000 (21:29 +0000)]
Allow constraints of the form @domain.com

Some things issue and expect that we support a non-standard extension of
accepting any email address from a host by prefixing an email name
constraint with @. This used to be the case with the old code as well.

Pointed out and based on a diff by Alex Wilson.

ok jsing

2 years agoRework ownership handling in x509_constraints_validate()
tb [Mon, 14 Mar 2022 21:15:49 +0000 (21:15 +0000)]
Rework ownership handling in x509_constraints_validate()

Instead of having the caller allocate and pass in a new
x509_constraints_name struct, handle allocation inside
x509_constraints_validate(). Also make the error optional.
All this is done to simplify the call sites and to make it
more obvious that there are no leaks.

ok jsing

2 years agoThere is no objectionable-C compiler in the comp set anymore.
miod [Mon, 14 Mar 2022 20:07:57 +0000 (20:07 +0000)]
There is no objectionable-C compiler in the comp set anymore.

2 years agoThe current FDT code we use in the bootloader is buggy and will write into
kettenis [Mon, 14 Mar 2022 19:09:32 +0000 (19:09 +0000)]
The current FDT code we use in the bootloader is buggy and will write into
memory beyond the actual FDT data structure when adding information to the
device tree.  This is especially problematic on ACPI systems where we add
lots of information to the device tree based on ACPI tables.  Fix the FDT
code to never write beyond the end of the data structure and panic if we
run out of free space.  Raise the amount of free space frm 4K to 16K for
the proto-FDT we use on ACPI systems.  Bump the version number of the
arm64 bootloader.

ok visa@, patrick@

2 years agopf_socket_lookup() calls in_pcbhashlookup() in the PCB layer. To
bluhm [Mon, 14 Mar 2022 17:23:00 +0000 (17:23 +0000)]
pf_socket_lookup() calls in_pcbhashlookup() in the PCB layer.  To
run pf in parallel, make parts of the stack MP safe.  Protect the
list and hashes in the PCB tables with a mutex.
Note that the protocol notify functions may call pf via tcp_output().
As the pf lock is a sleeping rw_lock, we must not hold a mutex.  To
solve this for now, collect these PCBs in inp_notify list and protect
it with exclusive netlock.
OK sashan@

2 years agoAbstract duplicated code scanning gpt_types[] into a helper
krw [Mon, 14 Mar 2022 17:11:44 +0000 (17:11 +0000)]
Abstract duplicated code scanning gpt_types[] into a helper
function find_gpt_type().

Use find_gpt_type() to simplify the functions obtaining
information from gpt_types[]. Add not yet used
PRT_uuid_to_protection() to allow simplification of GPT partition
protection code..

No intentional functional change.

2 years agoFactor out unexpected handshake message handling code in the legacy stack.
jsing [Mon, 14 Mar 2022 16:49:35 +0000 (16:49 +0000)]
Factor out unexpected handshake message handling code in the legacy stack.

The TLS record layer has to be able to handle unexpected handshake messages
that result when it has been asked to read application data. The way that
this is currently done in the legacy stack is a layering violation - the
record layer knows about DTLS/TLS handshake messages, parsing them and then
deciding what action to take. This is further complicated by the need to
handle handshake message fragments.

For now, factor this code out with minimal changes - since it is a layering
violation we have to retain separate code for DTLS and TLS.

ok beck@ inoguchi@ tb@

2 years agoFactor out ASN1_STRING clearing code.
jsing [Mon, 14 Mar 2022 16:35:45 +0000 (16:35 +0000)]
Factor out ASN1_STRING clearing code.

This fixes a bug in ASN1_STRING_set0() where it does not respect the
ASN1_STRING_FLAG_NDEF flag and potentially frees memory that we do not own.

ok inguchi@ tb@

2 years agoFirst pass clean up of ASN1_STRING code.
jsing [Mon, 14 Mar 2022 16:23:29 +0000 (16:23 +0000)]
First pass clean up of ASN1_STRING code.

Use consistent variable names (astr/src) rather than 'a', 'bs', 'str', 'v'
or 'x', add some whitespace and remove some unneeded parentheses.

ok inoguchi@ tb@

2 years agoupdate iwx(4) man page CAVEATS section in light of 11ac support
stsp [Mon, 14 Mar 2022 15:17:17 +0000 (15:17 +0000)]
update iwx(4) man page CAVEATS section in light of 11ac support

2 years agoAdd initial support for 802.11ac (VHT) to the iwx(4) driver.
stsp [Mon, 14 Mar 2022 15:08:50 +0000 (15:08 +0000)]
Add initial support for 802.11ac (VHT) to the iwx(4) driver.

This makes it possible to use 80MHz channels and VHT-specific MCS.
Other 11ac features remain disabled for now.

Tested:
ax200: Matthias Schmidt, phessler, dv, kevlo, Joel Carnat, hrvoje, jmc, stsp
ax201: mlarkin, stsp
iwm (regression testing): stsp

2 years agoAdd initial 802.11ac (VHT) support to net80211.
stsp [Mon, 14 Mar 2022 15:07:24 +0000 (15:07 +0000)]
Add initial 802.11ac (VHT) support to net80211.

Add VHT capability and operation IE definitions to ieee80211.h.
Introduce channel flags to identify 80MHz and 160MHz capable channels.

Parse VHT IEs in beacons, announce the driver's VHT capabilities in
probe requests and assoc requests, and hop into 11ac mode after
association to the AP if possible.

Enable VHT by default if the driver announces support for it.

ok claudio@

2 years agosync ieee80211 channel flags over to radiotap
stsp [Mon, 14 Mar 2022 15:06:04 +0000 (15:06 +0000)]
sync ieee80211 channel flags over to radiotap

2 years agoAnd the prototype too.
krw [Mon, 14 Mar 2022 14:31:23 +0000 (14:31 +0000)]
And the prototype too.

2 years agoPRT_uuid_to_typename() can return const char *.
krw [Mon, 14 Mar 2022 14:28:58 +0000 (14:28 +0000)]
PRT_uuid_to_typename() can return const char *.

2 years agoNuke extraneous blank line.
krw [Mon, 14 Mar 2022 14:22:32 +0000 (14:22 +0000)]
Nuke extraneous blank line.

2 years agoFix Tx performance on urtwn(4) RTL8192EU devices.
stsp [Mon, 14 Mar 2022 14:15:33 +0000 (14:15 +0000)]
Fix Tx performance on urtwn(4) RTL8192EU devices.

The "driver rate" bit which tells firmware to use the driver-provided
Tx rate is in a different spot of Tx descriptor double word 3.
Fix the corresponding macro definition.

The device was sending all frames at CCK1 because of this bug, regardless
of the Tx rate the driver had chosen.

tcpbench before:
Conn:   1 Mbps:        0.808 Peak Mbps:        1.108 Avg Mbps:        0.808

tcpbench with fix:
Conn:   1 Mbps:       21.078 Peak Mbps:       21.078 Avg Mbps:       21.078

ok jmatthew@

2 years agoMake sure the apldart(4) implementation of bus_dmamap_destroy(9) does the
kettenis [Mon, 14 Mar 2022 13:08:32 +0000 (13:08 +0000)]
Make sure the apldart(4) implementation of bus_dmamap_destroy(9) does the
equivalent of bus_dmamap_unload(9) if active mappings exist.  This fixes
the kerenal panics seen with bringing bwfm(4) down and up again.

ok jsg@, patrick@

2 years agoImprove retransmission of message fragments. RFC 7383 states that loss of
tobhe [Mon, 14 Mar 2022 12:58:55 +0000 (12:58 +0000)]
Improve retransmission of message fragments.  RFC 7383 states that loss of
a single fragment results in a retransmit of all fragments belonging
to the same message.  Instead of treating each fragment as message with
seperate retransmit timer, keep only a single timer for all fragments of
a message and retransmit all fragments in order on timeout.
Improves reliability in case of packet loss when fragmentation is enabled.

Found by and diff from Daniel Herzinger
ok patrick@

2 years agominor lint fixes
sthen [Mon, 14 Mar 2022 10:58:35 +0000 (10:58 +0000)]
minor lint fixes

2 years agodocument changes to MODPERL_REGEN_PPPORT
sthen [Mon, 14 Mar 2022 10:56:55 +0000 (10:56 +0000)]
document changes to MODPERL_REGEN_PPPORT

2 years agoIncrease timeout to make test pass on sparc64.
bluhm [Mon, 14 Mar 2022 00:51:27 +0000 (00:51 +0000)]
Increase timeout to make test pass on sparc64.

2 years agossh: xstrdup(): use memcpy(3)
cheloha [Sun, 13 Mar 2022 23:27:54 +0000 (23:27 +0000)]
ssh: xstrdup(): use memcpy(3)

Copying the given string into the buffer with strlcpy(3) confers no
benefit in this context because we have already determined the
string's length with strlen(3) in order to allocate that buffer.

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

ok dtucker@ millert@

2 years agoDocument membar_enter_after_atomic and membar_exit_before_atomic.
bluhm [Sun, 13 Mar 2022 22:16:59 +0000 (22:16 +0000)]
Document membar_enter_after_atomic and membar_exit_before_atomic.
OK kettenis@

2 years agoHrvoje has hit a crash with IPsec acquire while testing the parallel
bluhm [Sun, 13 Mar 2022 21:38:32 +0000 (21:38 +0000)]
Hrvoje has hit a crash with IPsec acquire while testing the parallel
IP forwarding diff.  Add mutex and refcount to make memory management
of struct ipsec_acquire MP safe.
testing Hrvoje Popovski; input sashan@; OK mvs@

2 years agoRevert previous commit. It breaks the serial console on my rpi4.
kettenis [Sun, 13 Mar 2022 21:17:52 +0000 (21:17 +0000)]
Revert previous commit.  It breaks the serial console on my rpi4.

2 years agoRelax the check of x509_constraints_dirname()
tb [Sun, 13 Mar 2022 17:23:02 +0000 (17:23 +0000)]
Relax the check of x509_constraints_dirname()

The dirname constraint must be a prefix in DER format, so relax the
check from requiring equal-length strings to allow shorter names also.

From Alex Wilson

ok jsing

2 years agoAdd x509_constraints_validate() to x509_internal.h
tb [Sun, 13 Mar 2022 17:08:04 +0000 (17:08 +0000)]
Add x509_constraints_validate() to x509_internal.h

From Alex Wilson

ok jsing

2 years agoCheck name constraints using the proper API
tb [Sun, 13 Mar 2022 16:48:49 +0000 (16:48 +0000)]
Check name constraints using the proper API

The previous versions were too strict and disallowed leading dots.

From Alex Wilson

ok jsing

2 years agostyle tweak
tb [Sun, 13 Mar 2022 16:30:31 +0000 (16:30 +0000)]
style tweak

2 years agoAdd missing error check after strdup()
tb [Sun, 13 Mar 2022 16:25:58 +0000 (16:25 +0000)]
Add missing error check after strdup()

From Alex Wilson

ok jsing

2 years agoparse_packet() is used by unbound to parse response packets, not
florian [Sun, 13 Mar 2022 15:14:01 +0000 (15:14 +0000)]
parse_packet() is used by unbound to parse response packets, not
queries. There is no need to do all this work just to get access to
the query id and flags.

OK bket, sthen

2 years agoRemove free_cont from asn1_d2i_ex_primitive()/asn1_ex_c2i().
jsing [Sun, 13 Mar 2022 14:58:14 +0000 (14:58 +0000)]
Remove free_cont from asn1_d2i_ex_primitive()/asn1_ex_c2i().

The constructed ASN.1 handling in asn1_d2i_ex_primitive() and asn1_ex_c2i()
currently has code to potentially avoid a malloc/memcpy - this is a less
common code path and it introduces a bunch of complexity for minimal gain.
In particular, we're manually adding a trailing NUL when ASN1_STRING_set()
would already do that for us, plus we currently manually free() the data on
an ASN1_STRING, rather than using freezero().

ok inoguchi@ tb@

2 years agobetter without warnings
espie [Sun, 13 Mar 2022 14:39:56 +0000 (14:39 +0000)]
better without warnings

2 years agoNow that fdisk(8) retains the EFI System Partition on Apple systems, skip
kettenis [Sun, 13 Mar 2022 14:33:46 +0000 (14:33 +0000)]
Now that fdisk(8) retains the EFI System Partition on Apple systems, skip
formatting the partition such that its contents actually survive.

ok krw@

2 years agoshow the realname in verbose mode for tieing.
espie [Sun, 13 Mar 2022 13:42:04 +0000 (13:42 +0000)]
show the realname in verbose mode for tieing.
if we're "fixing" a partial-* package, we want to see exactly what filename
we're tieing up to, concretely, not the "theoretic" filename

2 years agoConstify struct cfattach.
mpi [Sun, 13 Mar 2022 13:34:54 +0000 (13:34 +0000)]
Constify struct cfattach.

ok miod@

2 years agomake those checks less chatty... once the file is not there, we don't need
espie [Sun, 13 Mar 2022 13:28:09 +0000 (13:28 +0000)]
make those checks less chatty... once the file is not there, we don't need
to say anything more

2 years agoMissing 'or'.
krw [Sun, 13 Mar 2022 12:57:29 +0000 (12:57 +0000)]
Missing 'or'.

Pointed out by jmc@

2 years agoConstify struct cfattach.
mpi [Sun, 13 Mar 2022 12:33:01 +0000 (12:33 +0000)]
Constify struct cfattach.

ok miod@

2 years agoEnable vlan promisc and header stripping, and use vlan rx/tx offloads.
jmatthew [Sun, 13 Mar 2022 10:13:54 +0000 (10:13 +0000)]
Enable vlan promisc and header stripping, and use vlan rx/tx offloads.
The vlan tx information takes up an extra slot on the tx ring, so this
affects the point at which we stop putting packets on the ring too.

ok dlg@

2 years agoConstify struct cfattach.
mpi [Sun, 13 Mar 2022 08:04:38 +0000 (08:04 +0000)]
Constify struct cfattach.

ok miod@

2 years agoConstify struct cfattach.
mpi [Sun, 13 Mar 2022 08:04:13 +0000 (08:04 +0000)]
Constify struct cfattach.

ok miod@

2 years agoTransmit segmented packets using multiple tx ring slots rather than
jmatthew [Sat, 12 Mar 2022 23:54:53 +0000 (23:54 +0000)]
Transmit segmented packets using multiple tx ring slots rather than
defragging them first.

ok dlg@

2 years agoConstify struct cfattach.
mpi [Sat, 12 Mar 2022 14:40:41 +0000 (14:40 +0000)]
Constify struct cfattach.

ok patrick@

2 years agoProbe for DNS64 presence with an absolute name so that asr doesn't add
florian [Sat, 12 Mar 2022 14:35:29 +0000 (14:35 +0000)]
Probe for DNS64 presence with an absolute name so that asr doesn't add
search domains and retry.

2 years agoFactor out change cipher spec handing code in the legacy stack.
jsing [Sat, 12 Mar 2022 12:53:03 +0000 (12:53 +0000)]
Factor out change cipher spec handing code in the legacy stack.

Factor out the code that handles the processing of a change cipher spec
message that has been read in the legacy stack, deduplicating code in the
DTLS stack.

ok inoguchi@ tb@

2 years agoUncompress some one line comments to reduce the difference with NetBSD.
mpi [Sat, 12 Mar 2022 12:34:22 +0000 (12:34 +0000)]
Uncompress some one line comments to reduce the difference with NetBSD.

No functionnal change.