openbsd
3 years agoRename ucc_intr_to_usage() to ucc_bits_to_usage(), no functional change.
anton [Thu, 26 Aug 2021 10:32:35 +0000 (10:32 +0000)]
Rename ucc_intr_to_usage() to ucc_bits_to_usage(), no functional change.

3 years agoAdd missing leading colon to error message.
anton [Thu, 26 Aug 2021 10:29:02 +0000 (10:29 +0000)]
Add missing leading colon to error message.

3 years agoThere are some races in the hardware which thus require a few more tries
kevlo [Thu, 26 Aug 2021 07:11:09 +0000 (07:11 +0000)]
There are some races in the hardware which thus require a few more tries
to get ownership.

See Linux commit 501fd9895c1d7d8161ed56698ae2fccb10ef14f5

ok stsp@

3 years agoTwo more Capt. Obvious comments go away.
krw [Wed, 25 Aug 2021 23:47:36 +0000 (23:47 +0000)]
Two more Capt. Obvious comments go away.

3 years agoDon't use log_procname before it is initialized. In particular
krw [Wed, 25 Aug 2021 21:07:47 +0000 (21:07 +0000)]
Don't use log_procname before it is initialized. In particular
set_iff_up() is called from initialize_interface() and was using
log_procname instead of ifi->name in its fatal()'s.

Diagnosed by tb@ from a recent reddit post by zielonykid1234.

3 years agoConsolidate '-e' edit command parsing into ask_cmd(), simplifying
krw [Wed, 25 Aug 2021 13:25:23 +0000 (13:25 +0000)]
Consolidate '-e' edit command parsing into ask_cmd(), simplifying
the main '-e' loop.

No functional change.

3 years agoImprove some logging.
nicm [Wed, 25 Aug 2021 10:18:01 +0000 (10:18 +0000)]
Improve some logging.

3 years agoIgnore client creating session when working out size if it is a control
nicm [Wed, 25 Aug 2021 10:15:15 +0000 (10:15 +0000)]
Ignore client creating session when working out size if it is a control
client.

3 years agobind-key needs to allow commands for any argument for the moment.
nicm [Wed, 25 Aug 2021 09:18:08 +0000 (09:18 +0000)]
bind-key needs to allow commands for any argument for the moment.

3 years agoValidate command argument types (string or command list) and give more
nicm [Wed, 25 Aug 2021 08:51:55 +0000 (08:51 +0000)]
Validate command argument types (string or command list) and give more
useful error messages.

3 years agosetupterm needs char * not const char * on some platforms.
nicm [Wed, 25 Aug 2021 07:37:20 +0000 (07:37 +0000)]
setupterm needs char * not const char * on some platforms.

3 years agoFix up some printflike attributes.
nicm [Wed, 25 Aug 2021 07:09:30 +0000 (07:09 +0000)]
Fix up some printflike attributes.

3 years agoStart inputs as NULL so not freeing random stack garbage, GitHub issue 2852.
nicm [Wed, 25 Aug 2021 06:36:05 +0000 (06:36 +0000)]
Start inputs as NULL so not freeing random stack garbage, GitHub issue 2852.

3 years agoMake all conversion routines consistent by returning a struct
anton [Wed, 25 Aug 2021 05:48:50 +0000 (05:48 +0000)]
Make all conversion routines consistent by returning a struct
ucc_keysym. No functional change.

3 years agoRemove the KB_DEFAULT flag from the wskbd keymap layout. Presence of
anton [Wed, 25 Aug 2021 05:48:02 +0000 (05:48 +0000)]
Remove the KB_DEFAULT flag from the wskbd keymap layout. Presence of
this flag will cause wskbd to discard the given keymap layout and
instead favor the layout of the associated wsmux. This is not a problem
while attaching ucc(4) during boot as the wsmux uses the default layout
at this point. However, if the layout is changed using /etc/kbdtype from
rc(8) during boot, attaching ucc(4) at this point would cause
wskbd_attach() to get stuck in an infinite loop:

wskbdX: cannot load keymap, falling back to default

... which in turn is caused by ucc(4) only providing a us layout and
using anything else in /etc/kbdtype would not work.

I missed this as I don't use /etc/kbdtype but cwen@ and Mazzurco
Riccardo <mazzurco dot riccardo at protonmail dot com> reported the same
problem.

3 years agoPrevent ucc(4) from matching report IDs with an empty input report.
anton [Wed, 25 Aug 2021 05:47:15 +0000 (05:47 +0000)]
Prevent ucc(4) from matching report IDs with an empty input report.

Fixes cwen@'s Creative BT-W3 audio device.

3 years agoIf the buffer given to the ucc interrupt handler is too long, do not
anton [Wed, 25 Aug 2021 05:46:31 +0000 (05:46 +0000)]
If the buffer given to the ucc interrupt handler is too long, do not
discard it but instead just inspect the first bytes that can make up a
usage. This is a work around as the correct solution is to only inspect
a limited number of bits as given by the report count and size
associated with the Consumer usage page.

Final piece to get florian@'s Microsoft Sculpt keyboard working.

3 years agoDetermine if a hid item is an array by solely inspecting presence of
anton [Wed, 25 Aug 2021 05:45:33 +0000 (05:45 +0000)]
Determine if a hid item is an array by solely inspecting presence of
associated min/max boundaries. Assuming that every usage array starts
with the Control usage is incorrect.

Fixes claudio@'s GMMK keyboard and partial fix for florian@'s Microsoft
Sculpt keyboard.

3 years agoFix automatic upgrade after fetching response file with dhcp.
bluhm [Tue, 24 Aug 2021 21:50:09 +0000 (21:50 +0000)]
Fix automatic upgrade after fetching response file with dhcp.

When the auto upgrader tried to fetch the sets, sometimes ftp did
not find any.  The interface was down and had no address.  As
autoconf was not cleared, the upgrade's static netstart and dhcpleased
both tried to configure the interface, which cannot work.

Disable dhcp with "ifconfig inet -autoconf" in get_responsefile()
after it is not used anymore.

OK florian@

3 years ago- guiness -> guinness
jmc [Tue, 24 Aug 2021 20:04:28 +0000 (20:04 +0000)]
- guiness -> guinness
- heros -> heroes
- kill a dup

from tom

3 years agoFix ping group offsets.
kettenis [Tue, 24 Aug 2021 16:18:50 +0000 (16:18 +0000)]
Fix ping group offsets.

ok jcs@

3 years agoAdd an #ifdef DEBUG/#endif chunk that dumps the entire GPT header when
krw [Tue, 24 Aug 2021 15:36:05 +0000 (15:36 +0000)]
Add an #ifdef DEBUG/#endif chunk that dumps the entire GPT header when
printing a GPT.

No functional change outside of DEBUG.

3 years agoFix various read buffer overflow when printing ASN.1 strings (which are
tb [Tue, 24 Aug 2021 15:23:03 +0000 (15:23 +0000)]
Fix various read buffer overflow when printing ASN.1 strings (which are
not necessarily NUL terminated). Same as schwarze's fix in t_x509a.c r1.9.

From David Benjamin and Matt Caswell (part of the fixes in OpenSSL 1.1.1l)

ok inoguchi

3 years agoWhen an interface disappears, e.g. when a usb dongle gets unplugged,
florian [Tue, 24 Aug 2021 14:56:06 +0000 (14:56 +0000)]
When an interface disappears, e.g. when a usb dongle gets unplugged,
we get a RTM_IFANNOUNCE message not a RTM_IFINFO message.
Handle this message to not accumulate "unknown" interfaces.
While here fix a bug where we would remove an interface only in the
engine process but not in the frontend when an interfaces gets
unplugged while we process a RTM_IFINFO message for it.
OK benno

3 years agoWhen an interface disappears, e.g. when a usb dongle gets unplugged,
florian [Tue, 24 Aug 2021 14:54:02 +0000 (14:54 +0000)]
When an interface disappears, e.g. when a usb dongle gets unplugged,
we get a RTM_IFANNOUNCE message not a RTM_IFINFO message.
Handle this message to not accumulate "unknown" interfaces.
OK benno

3 years agouse Pa for resolv.conf.tail, since there is no longer a man page
jmc [Tue, 24 Aug 2021 13:53:21 +0000 (13:53 +0000)]
use Pa for resolv.conf.tail, since there is no longer a man page
to Xr;

3 years agovini vidi vici -> veni vidi vici
jmc [Tue, 24 Aug 2021 13:16:07 +0000 (13:16 +0000)]
vini vidi vici -> veni vidi vici

3 years agomake SYNOPSIS match usage to indicate -l is optional in:
jmc [Tue, 24 Aug 2021 13:15:07 +0000 (13:15 +0000)]
make SYNOPSIS match usage to indicate -l is optional in:

swapctl [[-l] | -s] [-k]

from martin vahlensieck

3 years agoA couple more Capt. Obvious comments can go.
krw [Tue, 24 Aug 2021 12:55:06 +0000 (12:55 +0000)]
A couple more Capt. Obvious comments can go.

3 years agoTrim leading/trailing whitespace from -e input to make command
krw [Tue, 24 Aug 2021 12:34:04 +0000 (12:34 +0000)]
Trim leading/trailing whitespace from -e input to make command
parsing more robust (e.g. 'edit 0 ' is now accepted) and strict
(e.g. 'reinit gptx' is now rejected).

Input which may want that whitespace is not trimmed (e.g. GPT
partition names).

Use consistent definition of whitespace corresponding to that
used by isspace().

3 years agoFix compilation with debug enabled.
patrick [Tue, 24 Aug 2021 11:44:30 +0000 (11:44 +0000)]
Fix compilation with debug enabled.

ok kettenis@

3 years agoSome consumer control descriptor reports uses an array of usages instead
anton [Tue, 24 Aug 2021 10:53:43 +0000 (10:53 +0000)]
Some consumer control descriptor reports uses an array of usages instead
of enumerating all supported ones. This representation is more compact
as all supported usages are given by the array min and max boundaries.

In enumerating mode, the interrupt report has one level indirection as
it includes the bit offset of the usage requiring the driver to map bits
to usages in order to resolve the key press.
In array mode, the interrupt report includes the usage without any
indirection, removing the need map bits to usages.

ucc(4) can now operate either in enumerating or array mode depending on
the descriptor report. This should make more keyboards usable.

Thanks to Alessandro De Laurenzis <just22 at atlantide dot mooo dot com>
for testing.

3 years agofix outdated comments, from Emil Engler, thanks.
benno [Tue, 24 Aug 2021 10:07:30 +0000 (10:07 +0000)]
fix outdated comments, from Emil Engler, thanks.

3 years agoWe no longer have resolv.conf.tail.
florian [Tue, 24 Aug 2021 07:30:32 +0000 (07:30 +0000)]
We no longer have resolv.conf.tail.
From Scott Bennett, thanks!

3 years agoSay which read failed, helps debugging.
florian [Mon, 23 Aug 2021 18:22:56 +0000 (18:22 +0000)]
Say which read failed, helps debugging.

3 years agoWe don't have a config file on the ramdisks; prevents a warning.
florian [Mon, 23 Aug 2021 18:21:48 +0000 (18:21 +0000)]
We don't have a config file on the ramdisks; prevents a warning.

3 years agoSince we have a config file now we should Xr its manpage.
florian [Mon, 23 Aug 2021 18:09:05 +0000 (18:09 +0000)]
Since we have a config file now we should Xr its manpage.
From Scott Bennett, thanks!

3 years agoI missed that wskbd_rawinput() is hidden behind WSDISPLAY_COMPAT_RAWKBD
anton [Mon, 23 Aug 2021 17:50:26 +0000 (17:50 +0000)]
I missed that wskbd_rawinput() is hidden behind WSDISPLAY_COMPAT_RAWKBD
as discovered by deraadt@; should hopefully make ucc(4) work on alpha.

3 years agoargs_make_commands_now needs to take an extra reference to the returned
nicm [Mon, 23 Aug 2021 17:05:43 +0000 (17:05 +0000)]
args_make_commands_now needs to take an extra reference to the returned
command list since it will be freed already.

3 years agoMove command argument parsing common functions and don't bother to parse
nicm [Mon, 23 Aug 2021 12:33:55 +0000 (12:33 +0000)]
Move command argument parsing common functions and don't bother to parse
again if given a command rather than a string.

3 years agoKey bindings steal a reference to the command instead of adding their
nicm [Mon, 23 Aug 2021 11:48:21 +0000 (11:48 +0000)]
Key bindings steal a reference to the command instead of adding their
own, it was correct not to add a reference when parsing, but the
bind-key then needs to add one.

3 years agoRevert one of previous, for some reason it is being freed.
nicm [Mon, 23 Aug 2021 11:08:26 +0000 (11:08 +0000)]
Revert one of previous, for some reason it is being freed.

3 years agoFix a few memory leaks.
nicm [Mon, 23 Aug 2021 11:04:21 +0000 (11:04 +0000)]
Fix a few memory leaks.

3 years agoFix the initial length check in iwx_fill_probe_req() to match iwm(4).
stsp [Mon, 23 Aug 2021 08:59:31 +0000 (08:59 +0000)]
Fix the initial length check in iwx_fill_probe_req() to match iwm(4).

Patch by zxystd from OpenIntelWireless.

3 years agoLimit width and height to tty correctly, GitHub issue 2843.
nicm [Mon, 23 Aug 2021 08:17:41 +0000 (08:17 +0000)]
Limit width and height to tty correctly, GitHub issue 2843.

3 years agoFix handling of leading #s when working out width.
nicm [Sun, 22 Aug 2021 15:33:14 +0000 (15:33 +0000)]
Fix handling of leading #s when working out width.

3 years agoDo not double free expanded path in source-file, also remove some
nicm [Sun, 22 Aug 2021 13:48:29 +0000 (13:48 +0000)]
Do not double free expanded path in source-file, also remove some
unnecessary assignments.

3 years agoInsert alias in the right place, GitHub issue 2842.
nicm [Sun, 22 Aug 2021 13:00:28 +0000 (13:00 +0000)]
Insert alias in the right place, GitHub issue 2842.

3 years agoSince the raw keymap already has a capacity of holding all present keys,
anton [Sun, 22 Aug 2021 07:20:40 +0000 (07:20 +0000)]
Since the raw keymap already has a capacity of holding all present keys,
use it as a lookup table using the bit as the index. Removes the need to
linearly scan the same keymap during handling of a key press, not that
performance matters here since the length of the keymap is small but the
code gets a bit simpler and one struct becomes redundant.

While here, fix two incorrect conditionals in ucc_parse_hid() which
compared two different quantities.

3 years agoucc also fails to work here, because there is no wskbd_rawinput
deraadt [Sun, 22 Aug 2021 06:26:28 +0000 (06:26 +0000)]
ucc also fails to work here, because there is no wskbd_rawinput

3 years agoFree value properly.
nicm [Sat, 21 Aug 2021 20:57:52 +0000 (20:57 +0000)]
Free value properly.

3 years agoPreserve argument type in command and convert to string on demand.
nicm [Sat, 21 Aug 2021 20:46:43 +0000 (20:46 +0000)]
Preserve argument type in command and convert to string on demand.

3 years agoPass typed arguments out of the parser into the arguments list and let
nicm [Sat, 21 Aug 2021 18:39:07 +0000 (18:39 +0000)]
Pass typed arguments out of the parser into the arguments list and let
it convert them into strings.

3 years agoioc(4) disappeared with sgi removal...
jmc [Sat, 21 Aug 2021 18:28:52 +0000 (18:28 +0000)]
ioc(4) disappeared with sgi removal...

3 years agoescape two instances of the word "An" in Rs/Re blocks: although mandoc
jmc [Sat, 21 Aug 2021 18:18:05 +0000 (18:18 +0000)]
escape two instances of the word "An" in Rs/Re blocks: although mandoc
can handle it, groff does not like it;

3 years agoUse new syntax for default key bindings.
nicm [Sat, 21 Aug 2021 17:41:19 +0000 (17:41 +0000)]
Use new syntax for default key bindings.

3 years agoStop caring about empty commands, just treat as a null command.
nicm [Sat, 21 Aug 2021 17:25:32 +0000 (17:25 +0000)]
Stop caring about empty commands, just treat as a null command.

3 years agoocteon has no wskbd, so ucc cannot link. the files.usb parts should have
deraadt [Sat, 21 Aug 2021 14:46:25 +0000 (14:46 +0000)]
octeon has no wskbd, so ucc cannot link.  the files.usb parts should have
handled this, but they don't.  disable until this is revisited.

3 years agoRemove some members of struct cmd which are no longer used.
nicm [Sat, 21 Aug 2021 14:10:08 +0000 (14:10 +0000)]
Remove some members of struct cmd which are no longer used.

3 years agoPreserve command group when moving temporary list to current list being
nicm [Sat, 21 Aug 2021 14:06:17 +0000 (14:06 +0000)]
Preserve command group when moving temporary list to current list being
buit.

3 years agoRename a member to match what it will be in future.
nicm [Sat, 21 Aug 2021 10:28:05 +0000 (10:28 +0000)]
Rename a member to match what it will be in future.

3 years agomake the description for ucc match exactly;
jmc [Sat, 21 Aug 2021 10:27:10 +0000 (10:27 +0000)]
make the description for ucc match exactly;

3 years agoAdd args parsing callback for some future work, currently unused.
nicm [Sat, 21 Aug 2021 10:22:38 +0000 (10:22 +0000)]
Add args parsing callback for some future work, currently unused.

3 years agoWrap command argument definitions in their own struct.
nicm [Sat, 21 Aug 2021 08:44:59 +0000 (08:44 +0000)]
Wrap command argument definitions in their own struct.

3 years agofix indent in previous
anton [Sat, 21 Aug 2021 06:52:52 +0000 (06:52 +0000)]
fix indent in previous

3 years agoSwitch macppc to ld.lld
gkoehler [Sat, 21 Aug 2021 03:00:02 +0000 (03:00 +0000)]
Switch macppc to ld.lld

Add powerpc to LLD_ARCH.  Remove -Wl,-relax flag; ld.bfd needed it,
but ld.lld can't take this flag.

To avoid linker errors on macppc, you need a snapshot where
/usr/bin/ld is LLD.

ok kettenis@ deraadt@

3 years agorefactor to resolve unused variable on non-WSDISPLAY_COMPAT_RAWKBD arch
deraadt [Sat, 21 Aug 2021 02:43:35 +0000 (02:43 +0000)]
refactor to resolve unused variable on non-WSDISPLAY_COMPAT_RAWKBD arch

3 years agoA couple more spacing fixes.
nicm [Fri, 20 Aug 2021 20:08:30 +0000 (20:08 +0000)]
A couple more spacing fixes.

3 years agoSpacing tweaks.
nicm [Fri, 20 Aug 2021 20:04:22 +0000 (20:04 +0000)]
Spacing tweaks.

3 years agoHide struct args behind a couple of accessor functions.
nicm [Fri, 20 Aug 2021 19:50:16 +0000 (19:50 +0000)]
Hide struct args behind a couple of accessor functions.

3 years agoAdd a couple of const and fix some warnings.
nicm [Fri, 20 Aug 2021 19:34:51 +0000 (19:34 +0000)]
Add a couple of const and fix some warnings.

3 years agoRemove some unnecessary blank lines.
nicm [Fri, 20 Aug 2021 19:08:36 +0000 (19:08 +0000)]
Remove some unnecessary blank lines.

3 years agoExpose args_value struct (will be needed soon) and add some missing frees.
nicm [Fri, 20 Aug 2021 18:59:53 +0000 (18:59 +0000)]
Expose args_value struct (will be needed soon) and add some missing frees.

3 years agoAdd a way to create an empty arguments set.
nicm [Fri, 20 Aug 2021 17:53:54 +0000 (17:53 +0000)]
Add a way to create an empty arguments set.

3 years agoRemove stray spaces after function names.
nicm [Fri, 20 Aug 2021 17:50:42 +0000 (17:50 +0000)]
Remove stray spaces after function names.

3 years agoFill colour palette correctly from option for new panes, GitHub issue
nicm [Fri, 20 Aug 2021 17:36:03 +0000 (17:36 +0000)]
Fill colour palette correctly from option for new panes, GitHub issue
2831.

3 years agoActually parse contents of {} as a command and then convert to a string
nicm [Fri, 20 Aug 2021 09:06:26 +0000 (09:06 +0000)]
Actually parse contents of {} as a command and then convert to a string
instead of just copying arguments around as strings.

3 years agoAdd a helper function for actually parsing the command.
nicm [Fri, 20 Aug 2021 06:30:57 +0000 (06:30 +0000)]
Add a helper function for actually parsing the command.

3 years agosync
anton [Fri, 20 Aug 2021 05:26:25 +0000 (05:26 +0000)]
sync

3 years agoadd ucc(4) manual, looks good to jmc@
anton [Fri, 20 Aug 2021 05:25:23 +0000 (05:25 +0000)]
add ucc(4) manual, looks good to jmc@

3 years agoAdd ucc(4), a driver for USB HID Consumer Control keyboards. Such
anton [Fri, 20 Aug 2021 05:23:18 +0000 (05:23 +0000)]
Add ucc(4), a driver for USB HID Consumer Control keyboards. Such
keyboard is a pseudo device which is used to expose audio and
application launch keys. My prime motivation is to get the volume mute,
increment and decrement keys to just work on my keyboard without the
need to use usbhidaction(1).

Looks reasonable to kettenis@ mpi@ and ok jcs@

3 years agoadd consumer control hid usages, will be used by ucc(4)
anton [Fri, 20 Aug 2021 05:19:08 +0000 (05:19 +0000)]
add consumer control hid usages, will be used by ucc(4)

3 years agoBack out last commit.
kevlo [Fri, 20 Aug 2021 04:54:10 +0000 (04:54 +0000)]
Back out last commit.

deraadt@ pointed out that the operation is correct.
It attaches, but by then it is being pulled.  The dying flag is set to
avoid half the kinds of failure conditions.  The other half of the failure
conditions are detect on-the-spot.

And it seems when compiled for debug, this on-the-spot check which notices
the device isn't there, has a printf.

3 years agoopenssh-8.7
djm [Fri, 20 Aug 2021 03:22:55 +0000 (03:22 +0000)]
openssh-8.7

3 years agoWhen plugging and unplugging an adapter continuously, it waits for a timeout
kevlo [Fri, 20 Aug 2021 01:40:51 +0000 (01:40 +0000)]
When plugging and unplugging an adapter continuously, it waits for a timeout
over and over again.  The problem is that the device has been unplugged,
but the attach handler still issues USB requests via ure_ctl().

The easiest solution is to deactivate the device proactively in
ure_ctl() when we see that error there.

From Christian Ludwig

3 years agoIn the attach routine, the hardware bug workaround is only for legacy PCI
kevlo [Fri, 20 Aug 2021 01:33:44 +0000 (01:33 +0000)]
In the attach routine, the hardware bug workaround is only for legacy PCI
interrupts.  Move it to the right place.

3 years agoRevert previous; Turns out the start_hw() functions don't always
stsp [Fri, 20 Aug 2021 00:22:54 +0000 (00:22 +0000)]
Revert previous; Turns out the start_hw() functions don't always
work right during the resume path. To be revisited later.

3 years agoRun more device init code when resuming iwm(4) and iwx(4) devices.
stsp [Thu, 19 Aug 2021 18:45:11 +0000 (18:45 +0000)]
Run more device init code when resuming iwm(4) and iwx(4) devices.

deraadt@ pointed out that the resume code path only ran a small part
of the entire hardware init sequence which runs when the device is
first attached at boot time.

In particular, we didn't wait for device stabilization, and MSI-X
initialization was attempted too early, and the "persistence bit"
workaround was skipped (which, ironically, is supposed to address
a known hardware bug during resume).

Tested by jcs on AX201 and by myself on 8265 with no regressions seen.

3 years agodo not crash when a manpath directory contains a symbolic link
schwarze [Thu, 19 Aug 2021 16:55:24 +0000 (16:55 +0000)]
do not crash when a manpath directory contains a symbolic link
that points to a directory rather than to a regular file;
bug reported by Lukas Epple <sternenseemann at systemli dot org>,
and my patch also tested by him on NixOS

3 years agofix the section number in the <title> element for preformatted pages;
schwarze [Thu, 19 Aug 2021 15:21:32 +0000 (15:21 +0000)]
fix the section number in the <title> element for preformatted pages;
minibug reported by Ian <Ropers at gmail dot com> on misc@

3 years agoPurge the cached nodes when we switch back to SCAN. In case we lost
patrick [Thu, 19 Aug 2021 14:13:39 +0000 (14:13 +0000)]
Purge the cached nodes when we switch back to SCAN.  In case we lost
the connection because an AP is gone away, this makes sure we don't
end up picking a now non-existant AP over and over.

Another problem this works around is that when trying to re-join that
AP, the attempt to connect would not yield any event message from the
firmware, and then we would get stuck.  Since we now definitely choose
a different AP, this issue does not show up.

ok stsp@

3 years agoConsistently use ieee80211_begin_scan() to switch to SCAN.
patrick [Thu, 19 Aug 2021 13:58:40 +0000 (13:58 +0000)]
Consistently use ieee80211_begin_scan() to switch to SCAN.
React to deauth/disassoc and link state events if we're
already past the SCAN stage.

ok stsp@

3 years agoimplement reception of "VLAN 0 priority tagged" packets.
dlg [Thu, 19 Aug 2021 10:22:00 +0000 (10:22 +0000)]
implement reception of "VLAN 0 priority tagged" packets.

according to 802.1Q, vlan 0 on the wire is special and should be
interpreted as if it was a packet received on the parent interface,
but you get the packet priority information encoded in the vlan
header.

historically we drop vlan tagged packets that don't have a vlan
interface configured for the received tag number. historically we
have deviated from 802.1Q by allowing for the configuration of a
vlan subinterface with the vnetid "unset". this works just like any
other vlan interface, but it uses tag 0 on the wire. however, if
you're in a situation where you're receiving vlan tagged 0 packets
that really are part of the same layer 2 ethernet domain as the
parent inteface, this doesnt work well.

landry@ is in such a situation at work where the network is sending
his OpenBSD boxes packets with VLAN tag 0. sometimes. most of the
time the packets are untagged, which is expected, but sometimes
they have a VLAN header set. this causes problems, particularly
with arp.

this diff does the smallest possible change to enable reception of
these vlan 0 priority tagged packets. if an "unset" vlan interface
is not configured on the parent, then vlan 0 tagged packets get
their header stripped and continue stack processing as if they didnt
have the tag at all.

landry has been running this for months.
ok sthen@ claudio@

3 years agoFix an off-by-one in bwfm(4) SSID length checks.
stsp [Thu, 19 Aug 2021 06:02:39 +0000 (06:02 +0000)]
Fix an off-by-one in bwfm(4) SSID length checks.
SSIDs are binary data, not NUL-terminated strings.

ok patrick@

3 years agoHide detailed firmware error reports from iwn/iwm/iwx by default.
stsp [Thu, 19 Aug 2021 06:02:04 +0000 (06:02 +0000)]
Hide detailed firmware error reports from iwn/iwm/iwx by default.

These drivers will now report "fatal firmware error" on a single line
by default and provide the full trace when debugging has been enabled
with e.g. 'ifconfig iwm0 debug'.

ok sthen@ kevlo@

3 years agoPull roots out of the trust store in the legacy xsc when building chains
beck [Thu, 19 Aug 2021 03:44:00 +0000 (03:44 +0000)]
Pull roots out of the trust store in the legacy xsc when building chains
to handly by_dir and fun things correctly. - fixes dlg@'s case and
by_dir regress in openssl-ruby

ok jsing@

3 years agoAdd veb(4) to the list of pseudo devices that can be created.
solene [Wed, 18 Aug 2021 18:10:33 +0000 (18:10 +0000)]
Add veb(4) to the list of pseudo devices that can be created.

ok deraadt@

3 years agoImport regress tests for SM2. Not yet linked to the build.
tb [Wed, 18 Aug 2021 16:06:56 +0000 (16:06 +0000)]
Import regress tests for SM2. Not yet linked to the build.

Part of Github PR #105

3 years agoImport initial code for the SM2 cipher
tb [Wed, 18 Aug 2021 16:04:32 +0000 (16:04 +0000)]
Import initial code for the SM2 cipher

This adds the SM2 algorithm defined in the Chinese standards
GB/T 32918.1-2016, GB/T 32918.2-2016, GB/T 32918.3-2016,
GB/T 32918.4-2016 and GB/T 32918.5-2017.

This is an ISC licensed implementation contributed by Ribose.inc, based
on the same code that was contributed to OpenSSL by Jack Lloyd. The port
to LibreSSL was done by Ronald Tse and Nickolay Olshevsky.

Github PR #105

I made quite a few cleanup passes on this, but more is needed, some
of which will happen in-tree before this is linked to the build.

ok deraadt inoguchi (a long time ago), jsing

3 years agoAdd a check_trust call to the legacy chain validation on chain add, remembering
beck [Wed, 18 Aug 2021 15:32:38 +0000 (15:32 +0000)]
Add a check_trust call to the legacy chain validation on chain add, remembering
the result in order to return the same errors as OpenSSL users expect to override
the generic "Untrusted cert" error.

This fixes the openssl-ruby timestamp test.

ok tb@