openbsd
3 years agodump out a usable private key string too; inspired by Tyson Whitehead
djm [Fri, 7 May 2021 02:26:55 +0000 (02:26 +0000)]
dump out a usable private key string too; inspired by Tyson Whitehead

3 years agofix bounds tests gpio pin numbering starts at 0
jsg [Fri, 7 May 2021 01:54:17 +0000 (01:54 +0000)]
fix bounds tests gpio pin numbering starts at 0

ok kettenis@

3 years agoadd support for RTL8168FP/RTL8111FP/RTL8117 to re(4)
jsg [Fri, 7 May 2021 00:37:36 +0000 (00:37 +0000)]
add support for RTL8168FP/RTL8111FP/RTL8117 to re(4)

from Stephen Taylor who tested on a ThinkCenter M75n Nano IoT
with RTL8111FP-CG

3 years agoGPT_get_hdr() is actually spelled GPT_get_header().
krw [Thu, 6 May 2021 22:26:14 +0000 (22:26 +0000)]
GPT_get_hdr() is actually spelled GPT_get_header().

3 years agoFix bogus return statement.
kettenis [Thu, 6 May 2021 20:35:21 +0000 (20:35 +0000)]
Fix bogus return statement.

From miod@

3 years agoAdd OF_getpropbool(9).
kettenis [Thu, 6 May 2021 19:45:16 +0000 (19:45 +0000)]
Add OF_getpropbool(9).

ok visa@

3 years agoBring comment in sync with the code. No functional change.
claudio [Thu, 6 May 2021 17:25:45 +0000 (17:25 +0000)]
Bring comment in sync with the code. No functional change.

3 years agoAdd an 'expires' column to CSV & JSON output
job [Thu, 6 May 2021 17:03:57 +0000 (17:03 +0000)]
Add an 'expires' column to CSV & JSON output

The 'expires' value contains a reasonable earliest moment a VRP would expire,
in light of the currently available set of CAs and CRLs. The 'expires' value
can be used to avoid route selection based on stale data when generating VRP
sets, when faced with loss of communication between consumer and valdiator,
or validator and CA repository.

OK claudio@

3 years agoClarify that athn(4) USB devices don't support power saving in hostap mode.
stsp [Thu, 6 May 2021 14:40:35 +0000 (14:40 +0000)]
Clarify that athn(4) USB devices don't support power saving in hostap mode.
Prompted by a report from martingot on bugs@

3 years agoAdd the line number of an error to error messages.
lum [Thu, 6 May 2021 14:16:12 +0000 (14:16 +0000)]
Add the line number of an error to error messages.

3 years agoregen
anton [Thu, 6 May 2021 12:57:02 +0000 (12:57 +0000)]
regen

3 years agoUnlock lseek(2).
anton [Thu, 6 May 2021 12:55:20 +0000 (12:55 +0000)]
Unlock lseek(2).

In August 2019 I tried to unlock lseek which failed since the vnode lock
could not be acquired without holding the kernel lock back then.
claudio@ recently made it possible to acquire a vnode lock without
holding the kernel lock. The kernel lock is still required around
VOP_GETATTR() as the underlying file system implementations are not
MP-safe.

ok claudio@

3 years agoAdd a number to parameters for ewprintf() via beeping.
lum [Thu, 6 May 2021 12:44:21 +0000 (12:44 +0000)]
Add a number to parameters for ewprintf() via beeping.

3 years agoKill pfkeyv2_parsemessage() declaration which is absolutely useless
mvs [Thu, 6 May 2021 11:29:34 +0000 (11:29 +0000)]
Kill pfkeyv2_parsemessage() declaration which is absolutely useless
here since it's declared in net/pfkeyv2.h.

Also kill unused RETURN_EINVAL() macro.

ok mpi@

3 years agoRefactor routines to stop/unstop processes and save the corresponding signal.
mpi [Thu, 6 May 2021 09:33:22 +0000 (09:33 +0000)]
Refactor routines to stop/unstop processes and save the corresponding signal.

- Move the "hack" involving P_SINTR to avoid grabbing the SCHED_LOCK()
recursively closer to where it is necessary, in proc_stop()

- Introduce proc_unstop(), the symmetric routine to proc_stop(), which
manipulates `ps_xsig' and use it whenever a SSTOPed thread needs to be
awaken.

- Manipulate `ps_xsig' only in proc_stop/unstop()

ok kettenis@

3 years agoexport [ none | default-route ] changes are not handled by reload.
claudio [Thu, 6 May 2021 09:23:42 +0000 (09:23 +0000)]
export [ none | default-route ] changes are not handled by reload.

3 years agoIt is no longer required to reset a session when export is changed.
claudio [Thu, 6 May 2021 09:21:35 +0000 (09:21 +0000)]
It is no longer required to reset a session when export is changed.

3 years agoMake iwx(4) install CCMP keys to hardware from a task context to
stsp [Thu, 6 May 2021 09:19:28 +0000 (09:19 +0000)]
Make iwx(4) install CCMP keys to hardware from a task context to
wait for confirmation from the firmware before setting link UP.

Tested by Hrvoje, dv, and myself.

3 years agoImprove reload behaviour of RDE peer flags and export_type.
claudio [Thu, 6 May 2021 09:18:54 +0000 (09:18 +0000)]
Improve reload behaviour of RDE peer flags and export_type.

Add an extra reload barrier (IMSG_RECONF_DRAIN) to the sync of the peer
config from the session engine to the rde. Necessary to ensure that the
peer config is up to date in the RDE before hitting reconfiguration.

Store the export_type and the peer flags outside of peer->conf. Adjust all
users of these two fields so they only look at the copies in peer.
During reload check the values with the peer->conf to check for changes.

If the export_type or the rde evaluate or transparent-as flags changed
flush the Adj-RIB-Out for that peer and in a 2nd step rebuild the RIB from
scratch. This results in a lot of UPDATE churn but these configs are not
altered often.

Fix multiple issues in the rde_softreconfig_in_done handler that resulted
in multiple runs of the out stage of the softreconfig pipeline.

OK benno@

3 years agoSimplify file handling. There is no reason to use O_NONBLOCK on regular
claudio [Thu, 6 May 2021 07:35:22 +0000 (07:35 +0000)]
Simplify file handling. There is no reason to use O_NONBLOCK on regular
files since they will never "block". Remove the UPLOAD_READ_LOCAL state
and inline the meta data check into pre_file().
Plug one memory leak and cleanup code a bunch.
OK benno@

3 years agoMore code cleanup
claudio [Thu, 6 May 2021 07:29:59 +0000 (07:29 +0000)]
More code cleanup
OK florian@ benno@

3 years agoGive parse error if character found between blocks.
lum [Thu, 6 May 2021 07:16:24 +0000 (07:16 +0000)]
Give parse error if character found between blocks.

3 years agoenable dwmmc(4)
jsg [Thu, 6 May 2021 04:09:41 +0000 (04:09 +0000)]
enable dwmmc(4)

3 years agoRefactor vm_instance to return error value directly.
dv [Wed, 5 May 2021 21:33:11 +0000 (21:33 +0000)]
Refactor vm_instance to return error value directly.

vmd(8)'s vm_instance function set unsupported errno values. Change the
api to directly return an error (either errno or custom vmd error).

"go for it" -mlarkin@

3 years agoReplace DTLS w_epoch with epoch from TLSv1.2 record layer.
jsing [Wed, 5 May 2021 19:52:00 +0000 (19:52 +0000)]
Replace DTLS w_epoch with epoch from TLSv1.2 record layer.

ok inoguchi@ tb@

3 years agoThe StarFive JH7100 SoC found on the BeagleV beta boards has most of
kettenis [Wed, 5 May 2021 19:26:51 +0000 (19:26 +0000)]
The StarFive JH7100 SoC found on the BeagleV beta boards has most of
its peripherals hooked up through a bus that doesn't maintain cache
coherency.  So in order to use DMA we will need to flush the L2 caches
before/after a DMA tranfer.  Add a driver for the L2 cache controller
for these SoCs and infrastructure to do the necessary cache maintenance.
Since this particular L2 cache controller needs physical addresses, this
makes the bus_dma(4) code deviate from its arm64 counterpart.

ok drahn@

3 years agoEmit an integer instead of a string in JSON output
job [Wed, 5 May 2021 17:25:44 +0000 (17:25 +0000)]
Emit an integer instead of a string in JSON output

We added the "AS123" format because this is what the other tools did
and there was the goal to have equal output. However, many in the
community have voiced complaints about having to do string conversions.

OK deraadt@ claudio@

3 years agoClarify -n behavior
job [Wed, 5 May 2021 17:24:00 +0000 (17:24 +0000)]
Clarify -n behavior

Input from John Heasley

OK claudio@

3 years agoRemove unneeded tlb_set_gbase() that was used with R8000.
visa [Wed, 5 May 2021 15:29:19 +0000 (15:29 +0000)]
Remove unneeded tlb_set_gbase() that was used with R8000.

Pointed out by miod@

3 years agowhitespace
kettenis [Wed, 5 May 2021 14:13:57 +0000 (14:13 +0000)]
whitespace

3 years agouse fence iorw,iorw for bus_space_barrier()
jsg [Wed, 5 May 2021 13:28:56 +0000 (13:28 +0000)]
use fence iorw,iorw for bus_space_barrier()

ok kettenis@

3 years agoSync with arm64 version.
kettenis [Wed, 5 May 2021 13:12:26 +0000 (13:12 +0000)]
Sync with arm64 version.

ok jsg@

3 years agoDocument new reload behaviour. From Ashton Fagg
claudio [Wed, 5 May 2021 12:34:12 +0000 (12:34 +0000)]
Document new reload behaviour. From Ashton Fagg
OK jmc@

3 years agoFix definition of GICD_TYPER_LPIS.
kettenis [Wed, 5 May 2021 12:02:21 +0000 (12:02 +0000)]
Fix definition of GICD_TYPER_LPIS.

ok patrick@

3 years agoslight tidy-up of /etc/services:
sthen [Wed, 5 May 2021 11:49:17 +0000 (11:49 +0000)]
slight tidy-up of /etc/services:

- remove a few UDP entries for protocols that are TCP-only

- drop some obsolete protocols

- move smtps/465 to the standards section (rfc8314)

- move the talk about IANA's "reserve for both UDP/TCP even when you only
use one" policy from a comment in /etc/services to the manual, and talk
about how an entry in /etc/services prevents the associated port from
being used for dynamic ports (via net.inet.udp|tcp.baddynamic sysctl).

ok phessler@ florian@

3 years agoImprove the rde evaluate all test case by doing a withdraw of a prefix
claudio [Wed, 5 May 2021 10:28:11 +0000 (10:28 +0000)]
Improve the rde evaluate all test case by doing a withdraw of a prefix
that is hidden (but sent to one system because of rde evaluate all).

3 years agoRewrite TLSv1.2 key block handling.
jsing [Wed, 5 May 2021 10:05:27 +0000 (10:05 +0000)]
Rewrite TLSv1.2 key block handling.

For TLSv1.2 a single key block is generated, then partitioned into
individual secrets for use as IVs and keys. The previous implementation
splits this across two functions tls1_setup_key_block() and
tls1_change_cipher_state(), which means that the IV and key sizes have to
be known in multiple places.

This implementation generates and partitions the key block in a single
step, meaning that the secrets are then simply handed out when requested.

ok inoguchi@ tb@

3 years agoAll exabgp configs changed to the c code version of the api-exabgp code.
claudio [Wed, 5 May 2021 10:02:52 +0000 (10:02 +0000)]
All exabgp configs changed to the c code version of the api-exabgp code.

3 years agoMatch on snps,dw-mshc in dwmmc(4) and use clock-frequency for clkbase if
jsg [Wed, 5 May 2021 09:17:19 +0000 (09:17 +0000)]
Match on snps,dw-mshc in dwmmc(4) and use clock-frequency for clkbase if
the "ciu" clock is missing as mentioned in the devicetree binding.

ok kettenis@

3 years agoUnlock top part of the fault handler.
mpi [Wed, 5 May 2021 07:29:00 +0000 (07:29 +0000)]
Unlock top part of the fault handler.

ok kettenis@

3 years agoCheck the characters preceeding and following quotes.
lum [Wed, 5 May 2021 06:12:23 +0000 (06:12 +0000)]
Check the characters preceeding and following quotes.

3 years agoEnable detailed reports about firmware errors in iwm(4) for the time being.
stsp [Wed, 5 May 2021 05:47:11 +0000 (05:47 +0000)]
Enable detailed reports about firmware errors in iwm(4) for the time being.
I am getting reports about firmware errors which may be related to Tx agg.

3 years agoriscv64 binutils 'support'
drahn [Wed, 5 May 2021 04:52:39 +0000 (04:52 +0000)]
riscv64 binutils 'support'
Enable just enough of binutils to be a functional compilation system
with llvm doing the heavy lifting.
With corrections suggested by reviewers.
ok jsg@ kettenis@

3 years agoFix backtrace command with kernel core.
asou [Wed, 5 May 2021 03:03:16 +0000 (03:03 +0000)]
Fix backtrace command with kernel core.

ok mpi@

3 years agoriscv: Assert that SUM is not set in SSTATUS for exceptions.
jsg [Wed, 5 May 2021 01:28:38 +0000 (01:28 +0000)]
riscv: Assert that SUM is not set in SSTATUS for exceptions.

From John Baldwin
6a3a6fe34bf36b6e745b3e9ad1a991de057729c7 in FreeBSD

ok kettenis@ mlarkin@

3 years agoriscv: Clear SUM in SSTATUS for supervisor mode exceptions.
jsg [Wed, 5 May 2021 01:24:57 +0000 (01:24 +0000)]
riscv: Clear SUM in SSTATUS for supervisor mode exceptions.

From John Baldwin
753bcca440a4d2c95f48536b586131b84c0bb87e in FreeBSD

ok kettenis@ mlarkin@

3 years agorename trap.S exception.S and trap_machdep.c trap.c to match other archs
jsg [Wed, 5 May 2021 00:53:08 +0000 (00:53 +0000)]
rename trap.S exception.S and trap_machdep.c trap.c to match other archs
ok kettenis@

3 years agoAdd Radxa Rock Pi N10.
kurt [Wed, 5 May 2021 00:04:49 +0000 (00:04 +0000)]
Add Radxa Rock Pi N10.

3 years agoDon't pass NULL as a string in debugging as it does not work on some
dtucker [Tue, 4 May 2021 22:53:52 +0000 (22:53 +0000)]
Don't pass NULL as a string in debugging as it does not work on some
platforms in -portable.  ok djm@

3 years agoReorder the integer sysctl functions. Then the traditional 4.4BSD
bluhm [Tue, 4 May 2021 21:57:15 +0000 (21:57 +0000)]
Reorder the integer sysctl functions.  Then the traditional 4.4BSD
comment 'As above...' makes sense again.  Improve comments for
sysctl_int_bounded() and sysctl_bounded_arr().
OK gnezdo@ mvs@

3 years agoshell scripts should use getopts instead of getopt
naddy [Tue, 4 May 2021 21:03:30 +0000 (21:03 +0000)]
shell scripts should use getopts instead of getopt

Add a prominent deprecation notice to getopt.1.
Add examples of the getopts idiom to sh.1 and ksh.1.

Requested by and ok espie@, ok jmc@

3 years agoAs the unbouded feature in sysctl_int_bounded() is no longer used,
bluhm [Tue, 4 May 2021 19:04:56 +0000 (19:04 +0000)]
As the unbouded feature in sysctl_int_bounded() is no longer used,
remove it.  This also fixes a defective check of the dynamic boundary
in sysctl_sysvshm().
OK mvs@ gnezdo@

3 years agosigpending(2) will never fail. Optimize the syscall stub accordingly like
kettenis [Tue, 4 May 2021 19:02:52 +0000 (19:02 +0000)]
sigpending(2) will never fail.  Optimize the syscall stub accordingly like
we do on other architectures.

ok mpi@

3 years agoRename shutdown_all() to shutdown_peers() for consistency.
tb [Tue, 4 May 2021 18:20:05 +0000 (18:20 +0000)]
Rename shutdown_all() to shutdown_peers() for consistency.

3 years agosyscalls.c, init_sysent.c, syscall.h, syscallargs.h: regen
cheloha [Tue, 4 May 2021 18:14:58 +0000 (18:14 +0000)]
syscalls.c, init_sysent.c, syscall.h, syscallargs.h: regen

Regen after unlocking getitimer(2) and setitimer(2).

ok anton@, mpi@

3 years agogetitimer(2), setitimer(2): unlock syscalls
cheloha [Tue, 4 May 2021 18:10:24 +0000 (18:10 +0000)]
getitimer(2), setitimer(2): unlock syscalls

With the changes in kern_time.c v1.150, neither getitimer(2) nor
setitimer(2) need the kernel lock anymore.

ok anton@, mpi@

3 years agoThe clock on RISC-V is architectural, so we really don't need the
kettenis [Tue, 4 May 2021 16:38:06 +0000 (16:38 +0000)]
The clock on RISC-V is architectural, so we really don't need the
whole abstraction layer to support multiple timers.  And we don't
really need a separate driver.  Replace timer(4) with code based on
the powerpc64 implementation of the randomized statclock code.

Fixes hangs seen on real hardware.

ok jsg@, drahn@

3 years agoFix 2nd and 3rd arguments' cast in atomic_cas_ptr().
aoyama [Tue, 4 May 2021 14:05:12 +0000 (14:05 +0000)]
Fix 2nd and 3rd arguments' cast in atomic_cas_ptr().

This fixes compile errors (actually warnings) on m88k in sys/net/pf.c
revision 1.1116 changes.

Diff from Miod Vallat, tested on GENERIC and GENERIC.MP by me.

3 years agoCreate memory pressure in test. Allocate heap and stack in child
bluhm [Tue, 4 May 2021 13:24:49 +0000 (13:24 +0000)]
Create memory pressure in test.  Allocate heap and stack in child
processes and threads.  Then exit has more work to do.

3 years agoAdd a boot hart ID check in the function that matches secondary CPUs
kettenis [Tue, 4 May 2021 12:46:28 +0000 (12:46 +0000)]
Add a boot hart ID check in the function that matches secondary CPUs
as well.

ok jsg@

3 years agogzread(3) doesn't always set errno, so use gzerror(3)
dv [Tue, 4 May 2021 10:48:51 +0000 (10:48 +0000)]
gzread(3) doesn't always set errno, so use gzerror(3)

Compression errors from libz don't set errno.

OK mlarkin@

3 years agoMove unused task queue stuff to the attic.
dv [Tue, 4 May 2021 10:42:51 +0000 (10:42 +0000)]
Move unused task queue stuff to the attic.

Was added about 4 years ago, but hasn't been used and linked into
the build. Discussed with dlg@ and mlarkin@.

mlarkin@: "Let's remove for now..."

3 years agoInit debug logging state before attempting to log.
dv [Tue, 4 May 2021 10:36:01 +0000 (10:36 +0000)]
Init debug logging state before attempting to log.

Error messages related to bad configuration were not flushing to
stderr.

OK mlarkin@

3 years agookay, prevent pkg_* from looking into /usr/local BUT special-case quirks
espie [Tue, 4 May 2021 10:19:28 +0000 (10:19 +0000)]
okay, prevent pkg_* from looking into /usr/local BUT special-case quirks

3 years agoInitialize `ipsec_policy_pool' within pfkey_init() instead of doing that
mvs [Tue, 4 May 2021 09:28:04 +0000 (09:28 +0000)]
Initialize `ipsec_policy_pool' within pfkey_init() instead of doing that
in runtime within pfkeyv2_send(). Also set it's interrupt protection
level to IPL_SOFTNET.

ok bluhm@ mpi@

3 years agoRemove unused `spd_tables' declaration.
mvs [Tue, 4 May 2021 09:27:22 +0000 (09:27 +0000)]
Remove unused `spd_tables' declaration.

ok bluhm@ mpi@

3 years agoMore comment changes to reflect reality. No functional change.
claudio [Tue, 4 May 2021 09:27:09 +0000 (09:27 +0000)]
More comment changes to reflect reality. No functional change.

3 years agoUpdate comment to match reality.
claudio [Tue, 4 May 2021 09:21:05 +0000 (09:21 +0000)]
Update comment to match reality.

3 years agonot yet, need to figure out how to fix quirks first
espie [Tue, 4 May 2021 08:53:15 +0000 (08:53 +0000)]
not yet, need to figure out how to fix quirks first

3 years agoand do the same thing to pkg_mklocatedb
espie [Tue, 4 May 2021 08:41:03 +0000 (08:41 +0000)]
and do the same thing to pkg_mklocatedb

3 years agoprevent the base pkg tools from looking under /usr/local
espie [Tue, 4 May 2021 08:39:19 +0000 (08:39 +0000)]
prevent the base pkg tools from looking under /usr/local

3 years agoSimilar to rsync repo delay deletes for rrdp repos to after processing
claudio [Tue, 4 May 2021 08:16:36 +0000 (08:16 +0000)]
Similar to rsync repo delay deletes for rrdp repos to after processing
all files. Now RRDP has a weak sync mechanism and therefor not all
unreferenced files can be removed, instead look at the list of removes
which were part of the delta processing and remove those files.
Warn and keep the file if a delta specifies to remove a file which is
actually still referenced.
OK benno@

3 years agoCheck that fdt hart id matches boot hart id before associating an fdt
jsg [Tue, 4 May 2021 06:32:58 +0000 (06:32 +0000)]
Check that fdt hart id matches boot hart id before associating an fdt
node with the primary cpu.

Prompted by the polarfire icicle where hart 0 is an mmuless e51 core.

ok drahn@ mlarkin@

3 years agoRemove cerror dependancy from riscv64 asm syscalls.
drahn [Tue, 4 May 2021 04:26:00 +0000 (04:26 +0000)]
Remove cerror dependancy from riscv64 asm syscalls.
Directly update cerror as  offset of thread pointer, with
optimizations on error brnaching
ok kettenis@

3 years agoriscv64 brk()/sbrk() implementations,
drahn [Tue, 4 May 2021 04:17:53 +0000 (04:17 +0000)]
riscv64 brk()/sbrk() implementations,
based off a combination of aarch64/powerpc64
ok kettenis@

3 years agoUse limits.h instead of sys/limits.h in dtlstest.c for portable
inoguchi [Mon, 3 May 2021 23:44:05 +0000 (23:44 +0000)]
Use limits.h instead of sys/limits.h in dtlstest.c for portable

discussed and input from jsing@

3 years agoModify regress ssl_get_shared_ciphers for portable
inoguchi [Mon, 3 May 2021 23:42:04 +0000 (23:42 +0000)]
Modify regress ssl_get_shared_ciphers for portable

- Split out the intermediate path (../certs/) to Makefile
- Change 'shutdown' to 'shutdown_all'

ok tb@

3 years agoSync changes from arm64 version.
kettenis [Mon, 3 May 2021 21:25:48 +0000 (21:25 +0000)]
Sync changes from arm64 version.

ok patrick@

3 years agoHook openssl-ruby test to regress tree
tb [Mon, 3 May 2021 18:31:40 +0000 (18:31 +0000)]
Hook openssl-ruby test to regress tree

3 years agoAdd scaffold to run the ruby/openssl regression tests
tb [Mon, 3 May 2021 18:21:00 +0000 (18:21 +0000)]
Add scaffold to run the ruby/openssl regression tests

This test depends on the ruby/ruby-openssl-tests port that bundles the
sources and tests of the Ruby OpenSSL gem below /usr/local. The Makefile
compiles the openssl.so shared object below obj/ that provides Ruby
bindings for the OpenSSL API. Once this is built, the regression tests are
run.

There are currently 4 failing tests, all related to the new verifier.
At least one libssl bug is hidden behind a pend. All this will hopefully be
fixed during this release cycle.

This adds a decent amount of test coverage without being overly expensive.
This way, regressions should be spotted during development so jeremy will
no longer have to chase and work around them.

Joint work with jeremy, positive feedback from bcook and jsing.

3 years agotweak one description to make it unique
tb [Mon, 3 May 2021 14:51:47 +0000 (14:51 +0000)]
tweak one description to make it unique

3 years agoPrefix the hybrid_corner_case test with test_ for consistency.
tb [Mon, 3 May 2021 14:49:37 +0000 (14:49 +0000)]
Prefix the hybrid_corner_case test with test_ for consistency.

3 years agoExercise the point conversion bit for octet string representations
tb [Mon, 3 May 2021 14:48:10 +0000 (14:48 +0000)]
Exercise the point conversion bit for octet string representations
of points on secp256r1.

3 years agoAdd a test that exercises the point conversion bit of the octet
tb [Mon, 3 May 2021 14:46:18 +0000 (14:46 +0000)]
Add a test that exercises the point conversion bit of the octet
string representations of points on the binary curve sect571k1.

3 years agoFix corner case for compressed points on binary curves
tb [Mon, 3 May 2021 14:42:45 +0000 (14:42 +0000)]
Fix corner case for compressed points on binary curves

Per X9.62 4.4.1.b., the compressed representation of a point with
zero x coordinate on a binary curve must have y_bit unset. Error
out in that case of ec_GF2m_set_compressed_coordinates() instead
of ignoring y_bit.

ok jsing

3 years agoWhen negotiating multiprotocol capabilities only fall ack to AID_INET when
claudio [Mon, 3 May 2021 14:08:09 +0000 (14:08 +0000)]
When negotiating multiprotocol capabilities only fall ack to AID_INET when
no capability was sent to the peer (this happens if the multiprotocol
capability got disabled). It is possible that local and remote systems end
up with no shared AFI/SAFI pair. In this case the connection will not send
or should not receive any UPDATE messages.
The previous behaviour of falling back to AID_INET in that case can result
in problematic behaviour when sessions are missconfigured.
OK benno@, deraadt@

3 years agoPrint the timestamps both formatted and as a time in seconds field in
claudio [Mon, 3 May 2021 14:01:56 +0000 (14:01 +0000)]
Print the timestamps both formatted and as a time in seconds field in
the various JSON object that have time values.
OK benno@

3 years agoWhen parsing a variable value within double quotes, allow parenthesis
lum [Mon, 3 May 2021 13:28:03 +0000 (13:28 +0000)]
When parsing a variable value within double quotes, allow parenthesis
to be accomodated for.

3 years agoLike in the session engine do not inline the addr2sa call into connect and
claudio [Mon, 3 May 2021 13:18:06 +0000 (13:18 +0000)]
Like in the session engine do not inline the addr2sa call into connect and
bind. The len argument is modified by addr2sa but is also used as argument
in the call and it is undefined if the value of len in connect is set to
the value "returned" by addr2sa().
Should fix connect issues seen on Linux system.
OK denis@

3 years agoMake sdhc(4) attachment work on Zynq-7000.
visa [Mon, 3 May 2021 13:11:40 +0000 (13:11 +0000)]
Make sdhc(4) attachment work on Zynq-7000.

OK kettenis@

3 years agoWhen parsing a variable value within double quotes, allow an escaped
lum [Mon, 3 May 2021 12:18:43 +0000 (12:18 +0000)]
When parsing a variable value within double quotes, allow an escaped
\" to be accomodated for. Also, move the variable structure to be
global in scope within mg.

3 years agofix typo from previous commit
stsp [Mon, 3 May 2021 11:58:51 +0000 (11:58 +0000)]
fix typo from previous commit

3 years agoMention in CAVEATS that iwn(4) doesn't support 40MHz channels yet.
stsp [Mon, 3 May 2021 11:58:06 +0000 (11:58 +0000)]
Mention in CAVEATS that iwn(4) doesn't support 40MHz channels yet.

3 years agoiwm(4) supports Tx aggregation now.
stsp [Mon, 3 May 2021 11:56:49 +0000 (11:56 +0000)]
iwm(4) supports Tx aggregation now.

3 years agoUse the EFI memory map (if available) to determine available physical
kettenis [Mon, 3 May 2021 11:35:29 +0000 (11:35 +0000)]
Use the EFI memory map (if available) to determine available physical
memory.  This brings the code closer to arm64 but some key differences
remain.  The most notable difference is that the riscv64 currently uses
its own private direct map of physical memory.  Therefore it needs to know
the RAM address range which we derive from the /memory node in the FDT.

The code also needs to work around some bugs/flaws in the firmware:

* Newer OpenSBI versions no longer add a "no-map" property to the
  reserved memory block that covers the memory used by OpenSBI itself.
  This makes it appear as EfiBootServicesData in the EFI memory map,
  which means it is available for general use.

* The OpenSBI shipped with the beaglev prototype boards doesn't reserve
  the memory used by OpenBSI at all.

The workaround for the first issue is to remove all reserved memory blocks
specified in the FDT.  In its current implementation this may remove
too much memory on certain boards.

The workaround for the second issue is to remove 2MB before the memory
where the kernel lives.  This workaround is fragile since it relies on
a specific memory layout.  Hopefully the beaglev firmware gets fixed and
we can remove this hack.

ok jsg@

3 years agoremove old gcc/g++ binaries at update time; covers the most common case
sthen [Mon, 3 May 2021 11:34:55 +0000 (11:34 +0000)]
remove old gcc/g++ binaries at update time; covers the most common case
where people will run into problems on amd64 now we don't build gcc.
(the gcc-lib files are already removed by bsd.rd upgrades, and gcc/g++
don't work without them).

3 years agorecognise a small number of riscv relocations in readelf
jsg [Mon, 3 May 2021 08:53:25 +0000 (08:53 +0000)]
recognise a small number of riscv relocations in readelf
ok kettenis@

3 years agoTweak the heuristic net80211 RA is using to decide whether enough
stsp [Mon, 3 May 2021 08:46:28 +0000 (08:46 +0000)]
Tweak the heuristic net80211 RA is using to decide whether enough
statistics have been gathered for a candidate Tx rate. The goal is
to avoid Tx rate choices that might turn out to be too optimistic.

In practice this only affects the case where we probe upwards. If the
current Tx rate starts seeing loss we will still scale down very quickly.

Based on a larger collection of patches by Christian Ehrhardt.
I have made stylistic tweaks for consistency.

Tested:
iwn 6205: stsp, Josh Grosse
iwm 7265: stsp
iwm 8265: Matthias Schmidt
iwm 9260: phessler

3 years agoAdd 802.11n Tx aggregation support to iwm(4).
stsp [Mon, 3 May 2021 08:41:25 +0000 (08:41 +0000)]
Add 802.11n Tx aggregation support to iwm(4).

Makes packets go swoosh swoosh swoosh. Welcome to actual 802.11n!

Tested:
7260: dv, florian
7265: trondd, dv, landry, stsp
8260: bket
8265: Matthias Schmidt, stsp
9260: kettenis
9560: phessler, stsp

3 years agowork around an athn(4) device problem with bogus Michael MIC failures
stsp [Mon, 3 May 2021 08:23:05 +0000 (08:23 +0000)]
work around an athn(4) device problem with bogus Michael MIC failures

Clients using Tx aggregation against an athn(4) hostap will send block ack
request control frames whenever they need to sync their Tx block ack window.
athn(4) dropped such frames due to bogus Michael MIC failures reported by
the hardware decryption engine. Ignore such failures for control frames in
order to fix athn(4) hostap mode against clients which use Tx aggregation.

Additionally, only report Michael MIC failures to the net80211 stack if the
offending client is actually using TKIP, which would also have prevented the
problem since we require CCMP as group cipher in our default configuration.

Problem reported and fix tested by kettenis@