openbsd
18 months agoAdd missing const qualifiers to the v3_* externs
tb [Mon, 17 Apr 2023 06:46:19 +0000 (06:46 +0000)]
Add missing const qualifiers to the v3_* externs

ok jsing

18 months agoFix whitespace in DHparam_print_fp()
tb [Mon, 17 Apr 2023 05:57:17 +0000 (05:57 +0000)]
Fix whitespace in DHparam_print_fp()

18 months agoRemove now unused dh_prn.c
tb [Mon, 17 Apr 2023 05:54:41 +0000 (05:54 +0000)]
Remove now unused dh_prn.c

18 months agoDrop dh_prn.c
tb [Mon, 17 Apr 2023 05:54:20 +0000 (05:54 +0000)]
Drop dh_prn.c

18 months agoMove DHparam_print_fp() next to DHparam_print()
tb [Mon, 17 Apr 2023 05:51:16 +0000 (05:51 +0000)]
Move DHparam_print_fp() next to DHparam_print()

As usual with the fp suffix, the former wraps the latter with a file BIO.
There is no reason for this function to be in a separate file.

18 months agoremove bad Pp;
jmc [Mon, 17 Apr 2023 05:45:06 +0000 (05:45 +0000)]
remove bad Pp;
(sorry, otto, for not spotting in the updated diff)

18 months agofix a macro and tweak punctuation;
jmc [Mon, 17 Apr 2023 05:43:12 +0000 (05:43 +0000)]
fix a macro and tweak punctuation;

18 months agodrm/i915: Split icl_color_commit_noarm() from skl_color_commit_noarm()
jsg [Mon, 17 Apr 2023 05:38:17 +0000 (05:38 +0000)]
drm/i915: Split icl_color_commit_noarm() from skl_color_commit_noarm()

From Ville Syrjala
726825297dd6aaa2d91daf7c1c2fd030859cc6cb in linux-6.1.y/6.1.24
76b767d4d1cd052e455cf18e06929e8b2b70101d in mainline linux

18 months agodrm/i915: Use _MMIO_PIPE() for SKL_BOTTOM_COLOR
jsg [Mon, 17 Apr 2023 05:35:37 +0000 (05:35 +0000)]
drm/i915: Use _MMIO_PIPE() for SKL_BOTTOM_COLOR

From Ville Syrjala
64244a900ddff4abd4c894dcfa9ea7df898ad1eb in linux-6.1.y/6.1.24
05ca98523481aa687c5a8dce8939fec539632153 in mainline linux

18 months agodrm/i915/dp_mst: Fix payload removal during output disabling
jsg [Mon, 17 Apr 2023 05:32:30 +0000 (05:32 +0000)]
drm/i915/dp_mst: Fix payload removal during output disabling

From Imre Deak
1297278ce23977853afeac7bfb65e42450a722dd in linux-6.1.y/6.1.24
eb50912ec931913e70640cecf75cb993fd26995f in mainline linux

18 months agodrm/display/dp_mst: Handle old/new payload states in drm_dp_remove_payload()
jsg [Mon, 17 Apr 2023 05:29:45 +0000 (05:29 +0000)]
drm/display/dp_mst: Handle old/new payload states in drm_dp_remove_payload()

From Imre Deak
0c64d72fd3f21ac9d0da186809394d9593090ce7 in linux-6.1.y/6.1.24
e761cc20946a0094df71cb31a565a6a0d03bd8be in mainline linux

18 months agodrm/amdgpu: skip psp suspend for IMU enabled ASICs mode2 reset
jsg [Mon, 17 Apr 2023 05:21:13 +0000 (05:21 +0000)]
drm/amdgpu: skip psp suspend for IMU enabled ASICs mode2 reset

From Tim Huang
62de38c8201d853b130fc54ddbfab748180053e2 in linux-6.1.y/6.1.24
e11c775030c5585370fda43035204bb5fa23b139 in mainline linux

18 months agodrm/amdgpu: for S0ix, skip SDMA 5.x+ suspend/resume
jsg [Mon, 17 Apr 2023 05:19:09 +0000 (05:19 +0000)]
drm/amdgpu: for S0ix, skip SDMA 5.x+ suspend/resume

From Alex Deucher
73ca74fc7ab6c1679c3b2720579c0c20b73a9764 in linux-6.1.y/6.1.24
2a7798ea7390fd78f191c9e9bf68f5581d3b4a02 in mainline linux

18 months agodrm/amd/display: Clear MST topology if it fails to resume
jsg [Mon, 17 Apr 2023 05:17:20 +0000 (05:17 +0000)]
drm/amd/display: Clear MST topology if it fails to resume

From Roman Li
245525543f48cd9eabd2964d8931043e9e3c31cf in linux-6.1.y/6.1.24
3f6752b4de41896c7f1609b1585db2080e8150d8 in mainline linux

18 months agodrm/i915: fix race condition UAF in i915_perf_add_config_ioctl
jsg [Mon, 17 Apr 2023 05:15:40 +0000 (05:15 +0000)]
drm/i915: fix race condition UAF in i915_perf_add_config_ioctl

From Min Li
240b1502708858b5e3f10b6dc5ca3f148a322fef in linux-6.1.y/6.1.24
dc30c011469165d57af9adac5baff7d767d20e5c in mainline linux

18 months agodrm/i915: Fix context runtime accounting
jsg [Mon, 17 Apr 2023 05:13:20 +0000 (05:13 +0000)]
drm/i915: Fix context runtime accounting

From Tvrtko Ursulin
4e29fb89f771316caed9e4d166213b10dd49eb2e in linux-6.1.y/6.1.24
dc3421560a67361442f33ec962fc6dd48895a0df in mainline linux

18 months agofix double word
jsg [Mon, 17 Apr 2023 04:46:04 +0000 (04:46 +0000)]
fix double word

18 months agoOops, ramdisk case should be -fcf-protection=none
deraadt [Mon, 17 Apr 2023 01:14:24 +0000 (01:14 +0000)]
Oops, ramdisk case should be -fcf-protection=none
spotted by brynet

18 months agoEnable Indirect Branch Tracking (IBT) for the kernel
jsg [Mon, 17 Apr 2023 00:42:04 +0000 (00:42 +0000)]
Enable Indirect Branch Tracking (IBT) for the kernel

endbr64 (f3 0f 1e fa) is placed at valid targets of an indirect jmp or
call.  A nop on older machines.  When IBT is enabled, an indirect jmp or
call with no endbr will trigger a control protection trap.

IBT is present on Intel Tiger Lake (Core gen 11) and later.

with and ok deraadt@

18 months agoFor future userland IBT, the sigcode needs to start with a endbr64.
deraadt [Mon, 17 Apr 2023 00:14:59 +0000 (00:14 +0000)]
For future userland IBT, the sigcode needs to start with a endbr64.
This is simpler than clearing the cet_u bits in the kernel.
ok guenther, kettenis

18 months agoThe bootblocks are 32-bit binaries which use the ENTRY() macros which now
deraadt [Mon, 17 Apr 2023 00:05:35 +0000 (00:05 +0000)]
The bootblocks are 32-bit binaries which use the ENTRY() macros which now
include endbr64 macros.  That's not going to work, so use the simple method
of -Dendbr64= to remove them from the instruction stream.
ok kettenis guenther

18 months agoIDTVEC_NOALIGN() was the incorrect way to create a label in two places,
deraadt [Mon, 17 Apr 2023 00:03:59 +0000 (00:03 +0000)]
IDTVEC_NOALIGN() was the incorrect way to create a label in two places,
use GENTRY() instead.  Also add two endbr64 which cannot be supplied by
macros
ok guenther

18 months agoAdd endbr64 instructions to most of the ENTRY() macros.
deraadt [Mon, 17 Apr 2023 00:02:14 +0000 (00:02 +0000)]
Add endbr64 instructions to most of the ENTRY() macros.
The IDTVEC() and KIDTVEC() macros also get a endbr64, and therefore we need
to change the way that vectors are aliased with a new IDTVEC_ALIAS() macro.
with guenther, jsg

18 months agocompile regular kernels with -fcf-protection=branch, and ramdisks with
deraadt [Sun, 16 Apr 2023 23:57:59 +0000 (23:57 +0000)]
compile regular kernels with -fcf-protection=branch, and ramdisks with
-fcf-protection=none, regardless of what the compiler default is.
-fcf-protection=branch puts endbr64 instructions on functions which could
be reached indirectly.
ok guenther kettenis

18 months agoFix previous: add a missing and
tb [Sun, 16 Apr 2023 23:19:28 +0000 (23:19 +0000)]
Fix previous: add a missing and

18 months agoclockintr: add shadow copy of running clock interrupt to clockintr_queue
cheloha [Sun, 16 Apr 2023 21:19:26 +0000 (21:19 +0000)]
clockintr: add shadow copy of running clock interrupt to clockintr_queue

cq_shadow is a private copy of the running clock interrupt passed to
cl_func() during the dispatch loop.  It resembles the real clockintr
object, though the two are distinct (hence "shadow").  A private copy
is useful for two reasons:

1. Scheduling operations performed on cq_shadow (advance, cancel,
   schedule) are recorded as requests with the CLST_SHADOW_PENDING
   flag and are normally performed on the real clockintr when cl_func()
   returns.  However, if an outside thread performs a scheduling
   operation on the real clockintr while cl_func() is running, the
   CLST_IGNORE_SHADOW flag is set and any scheduling operations
   requested by the running clock interrupt are ignored.

   The upshot of this arrangement is that outside scheduling operations
   have priority over those requested by the running clock interrupt.
   Because there is no race, periodic clock interrupts can now be safely
   stopped without employing the serialization mechanisms needed to safely
   stop periodic timeouts or tasks.

2. &cq->cq_shadow is a unique address, so most clockintr_* API calls
   made while cl_func() is running now don't need to enter/leave
   cq_mtx: the API can recognize when it is being called in the midst
   of clockintr_dispatch().

Tested by mlarkin@.  With input from dlg@.

In particular, dlg@ expressed some design concerns but then stopped
responding.  I have changes planned to address some of the concerns.
I think if we hit a wall with the current clockintr design we could
change the allocation scheme without too much suffering.  I don't
anticipate there being more than ~20 distinct clock interrupts.

18 months agoif (actually... when) the compiler is flipped to do BTI/ENDBR by default,
deraadt [Sun, 16 Apr 2023 19:57:01 +0000 (19:57 +0000)]
if (actually... when) the compiler is flipped to do BTI/ENDBR by default,
the install media would grow too much, so use the same strategy as we
for stack protector and other things: disable them, just on the install
media
ok kettenis

18 months agoDump (leak) info using utrace(2) and compile the code always in
otto [Sun, 16 Apr 2023 19:46:17 +0000 (19:46 +0000)]
Dump (leak) info using utrace(2) and compile the code always in
except for bootblocks. This way we have built-in leak detecction
always (if enable by malloc flags). See man pages for details.

18 months agoAdd a -u label option to print selected utrace records, used by upcoming
otto [Sun, 16 Apr 2023 19:42:40 +0000 (19:42 +0000)]
Add a -u label option to print selected utrace records, used by upcoming
malloc (leak) dump fucntion. ok semarie@

18 months agoGarbage collect the now unused obfuscating macro string_stack_free()
tb [Sun, 16 Apr 2023 19:16:32 +0000 (19:16 +0000)]
Garbage collect the now unused obfuscating macro string_stack_free()

18 months agoInline the three uses of string_stack_free()
tb [Sun, 16 Apr 2023 19:15:31 +0000 (19:15 +0000)]
Inline the three uses of string_stack_free()

sk_OPENSSL_STRING_pop_free() is much more explicit and isn't that much
more complicated. x509_util.c can also use it directly...

No binary change

18 months agoRemove the now unused vpm_int.h
tb [Sun, 16 Apr 2023 18:50:28 +0000 (18:50 +0000)]
Remove the now unused vpm_int.h

18 months agox509_vfy.c and x509_vpm.c don't need vpm_int.h anymore
tb [Sun, 16 Apr 2023 18:48:58 +0000 (18:48 +0000)]
x509_vfy.c and x509_vpm.c don't need vpm_int.h anymore

18 months agoMove X509_VERIFY_PARAM_st from vpm_int.h to x509_local.h
tb [Sun, 16 Apr 2023 18:42:30 +0000 (18:42 +0000)]
Move X509_VERIFY_PARAM_st from vpm_int.h to x509_local.h

18 months agoFix (and simplify) link speed reporting.
kettenis [Sun, 16 Apr 2023 17:26:14 +0000 (17:26 +0000)]
Fix (and simplify) link speed reporting.

ok jsg@

18 months agoProvide EVP methods for SHA3 224/256/384/512.
jsing [Sun, 16 Apr 2023 17:06:19 +0000 (17:06 +0000)]
Provide EVP methods for SHA3 224/256/384/512.

ok tb@

18 months agoProvide EVP methods for SHA512/224 and SHA512/256.
jsing [Sun, 16 Apr 2023 16:42:06 +0000 (16:42 +0000)]
Provide EVP methods for SHA512/224 and SHA512/256.

ok tb@

18 months agoBounds check mdlen that is passed to sha3_init().
jsing [Sun, 16 Apr 2023 15:32:16 +0000 (15:32 +0000)]
Bounds check mdlen that is passed to sha3_init().

While here, use KECCAK_BYTE_WIDTH instead of hardcoding the value.

18 months agoAdd PT_GNU_PROPERTY define.
kettenis [Sun, 16 Apr 2023 13:35:58 +0000 (13:35 +0000)]
Add PT_GNU_PROPERTY define.

ok deraadt@

18 months agovmd(8): correct comment in vioraw, cleanup formatting.
dv [Sun, 16 Apr 2023 12:52:54 +0000 (12:52 +0000)]
vmd(8): correct comment in vioraw, cleanup formatting.

Comment incorrectly mentioned returning sectors when this function
returns bytes; the logic in virtio.c computes the number of 512
byte sectors after calling virtio_raw_init.

While here, adjust the formatting of return's to match the rest of vmd.

No functional change.

18 months agovmd(8): clean up fd closing in vmm process.
dv [Sun, 16 Apr 2023 12:47:26 +0000 (12:47 +0000)]
vmd(8): clean up fd closing in vmm process.

Some mild tidying of fd closing in the vmm process in prep for
landing parts of my fork+exec diff.

With input from guenther@ on the nuances of if/when EINTR may happen
in a call to close(2).

ok mlarkin@

18 months agoAdd support for the PCIe controller found on M2 Pro/Max SoCs. While the
kettenis [Sun, 16 Apr 2023 12:09:01 +0000 (12:09 +0000)]
Add support for the PCIe controller found on M2 Pro/Max SoCs.  While the
bindings are still preliminary I don't exepect any substantial changes
that would affect the driver.  Hopefully the bindings will end up
officially approved before OpenBSD 7.4 gets released.

ok patrick@

18 months agoShuffle ext_cmp() and ext_list_free() up a bit
tb [Sun, 16 Apr 2023 12:08:03 +0000 (12:08 +0000)]
Shuffle ext_cmp() and ext_list_free() up a bit

18 months agoRemove unnecessary prototypes in the middle of the code
tb [Sun, 16 Apr 2023 12:05:31 +0000 (12:05 +0000)]
Remove unnecessary prototypes in the middle of the code

In addition, ext_cmp() was already prototyped earlier...

18 months agoUse more usual version of inlined nitems(). No binary change.
tb [Sun, 16 Apr 2023 12:01:15 +0000 (12:01 +0000)]
Use more usual version of inlined nitems(). No binary change.

18 months agoFix comment formatting and grammar, drop usless and outdated comment
tb [Sun, 16 Apr 2023 11:59:50 +0000 (11:59 +0000)]
Fix comment formatting and grammar, drop usless and outdated comment

18 months agoRemove now empty/unused ext_dat.h
tb [Sun, 16 Apr 2023 11:53:40 +0000 (11:53 +0000)]
Remove now empty/unused ext_dat.h

18 months agoMerge ext_dat.h back into x509_lib.c
tb [Sun, 16 Apr 2023 11:52:52 +0000 (11:52 +0000)]
Merge ext_dat.h back into x509_lib.c

There is no point in having this in a separate internal header.

discussed with jsing

18 months agoToo many ACPI implementations advertise serial ports that aren't actually
kettenis [Sun, 16 Apr 2023 11:38:42 +0000 (11:38 +0000)]
Too many ACPI implementations advertise serial ports that aren't actually
implemented.  This leads to hangs when we run "ttyflags -a" in /etc/rc.
Add the same probe that we have in the ISA version of the driver to make
sure the port is actually there.

ok patrick@

18 months agoAdd no-op implementations of the WSDISPLAYIO_GVIDEO and WSDISPLAYIO_SVIDEO
kettenis [Sun, 16 Apr 2023 11:34:32 +0000 (11:34 +0000)]
Add no-op implementations of the WSDISPLAYIO_GVIDEO and WSDISPLAYIO_SVIDEO
ioctls.  Everything we need from them is handled by wsdisplay(4) already,
but we need to handle them here to signal that we actually implement
burner support.

ok tb@, tobhe@

18 months agoMake enabling the BTI feature a per-pmap thing by storing the ATTR_GP bit
kettenis [Sun, 16 Apr 2023 11:14:26 +0000 (11:14 +0000)]
Make enabling the BTI feature a per-pmap thing by storing the ATTR_GP bit
in a new pm_guarded member of struct pmap and using this member to add
the bits to the PTEs

ok deraadt@

18 months agoClear BTYPE bits when setting up a signal handler and when handling a
kettenis [Sun, 16 Apr 2023 10:14:59 +0000 (10:14 +0000)]
Clear BTYPE bits when setting up a signal handler and when handling a
PT_CONTINUE ptrace(2) request.  Otherwise we would trap if userland was
interrupted at a point where it is doing an indirect branch that has set
the bits but before it has executed the BTI instruction at the branch
target.

The PT_SETREGS request may need similar treatment, at least when the
PC is changed.  But Linux doesn't do this and debuggers might want full
control over the BTYPE bits.  So leave this alone for now.

ok guenther@

18 months agoMark X9.31 BN API for removal
tb [Sun, 16 Apr 2023 09:13:46 +0000 (09:13 +0000)]
Mark X9.31 BN API for removal

This supports a mostly forgotten, seemingly unused and long retired
standard. No need for this in our public API Dyson sphere.

ok jsing

18 months agoThe BN reciprocal API will also become internal-only
tb [Sun, 16 Apr 2023 09:11:06 +0000 (09:11 +0000)]
The BN reciprocal API will also become internal-only

This is unused outside of the library and could do with some reworking.
That's easier without having to care about outside consumers.

ok jsing

18 months agoVarious BN*init() will be removed from the public API
tb [Sun, 16 Apr 2023 09:08:20 +0000 (09:08 +0000)]
Various BN*init() will be removed from the public API

With the corresponding structs now being opaque, the only thing they are
good for outside the library are memory leaks. They will be removed
completely or become internal only.

ok jsing

18 months agoMark public bn_nist and ec_nist API for removal
tb [Sun, 16 Apr 2023 08:55:44 +0000 (08:55 +0000)]
Mark public bn_nist and ec_nist API for removal

The faster nist code is rife with problematic C. While this is generally
considered to be a pleonasm nowadays, here it specifically refers to
aliasing issues and other flavors of undefined behavior. With compilers
and standardization committees becoming seemingly more determined about
making C even more unusable than it already is, this code has resulted
in miscompilations and generally is a target rich environment for fuzzers
to feast on. We're better off without it. Go look while it's still there.
It's some of the very worst we have to offer.

ok jsing

18 months agoMark EC_KEY_{get,insert}_method_data() for removal
tb [Sun, 16 Apr 2023 08:36:13 +0000 (08:36 +0000)]
Mark EC_KEY_{get,insert}_method_data() for removal

This is unused and in the way of some house keeping. Thus it will be
relocated to the attic.

ok jsing

18 months agoMark TS_VERIFY_CTX_init() for removal
tb [Sun, 16 Apr 2023 08:31:54 +0000 (08:31 +0000)]
Mark TS_VERIFY_CTX_init() for removal

With opaque TS_VERIFY_CTX the init function dangerous and useless.
It will be dropped.

ok jsing

18 months agoPrepare addition of X509_STORE_CTX_get1_{certs,crls}(3)
tb [Sun, 16 Apr 2023 08:30:21 +0000 (08:30 +0000)]
Prepare addition of X509_STORE_CTX_get1_{certs,crls}(3)

X509_STORE_get1_{certs,crls}(3) was added to the OpenSSL 1.1 API with the
usual care. At some point later it was noticed that they didn't deal with
an X509_STORE at all, but rather with an X509_STORE_CTX, so were misnamed.
The fact that X509_STORE_CTX and X509_STORE have their roles reversed when
compared to other FOO vs FOO_CTX in this API may or may not be related.

Anyway, the X509_STORE versions will be demoted to compat defines and the
X509_STORE_CTX will be added to match OpenSSL 1.1 API more closely. This
was pointed out by schwarze a long time ago and missed in a few bumps.
Hopefully we'll manage to do it this time around.

ok jsing

18 months agoMark remaining policy tree public API for removal
tb [Sun, 16 Apr 2023 08:21:12 +0000 (08:21 +0000)]
Mark remaining policy tree public API for removal

ok jsing

18 months agoAnnotate policy tree STACK_OF() goo for removal from public API
tb [Sun, 16 Apr 2023 08:18:10 +0000 (08:18 +0000)]
Annotate policy tree STACK_OF() goo for removal from public API

ok jsing

18 months agoThe policy tree types become internal ony. Annotate them.
tb [Sun, 16 Apr 2023 08:17:04 +0000 (08:17 +0000)]
The policy tree types become internal ony. Annotate them.

ok jsing

18 months agoCipher text stealing will go away. Mark it for removal.
tb [Sun, 16 Apr 2023 08:14:34 +0000 (08:14 +0000)]
Cipher text stealing will go away. Mark it for removal.

ok jsing

18 months agoMark proxy policy API for removal in upcoming bump
tb [Sun, 16 Apr 2023 08:11:38 +0000 (08:11 +0000)]
Mark proxy policy API for removal in upcoming bump

ok jsing

18 months agoRemove the now unused ex_pcpathlen from the X509 struct
tb [Sun, 16 Apr 2023 08:08:34 +0000 (08:08 +0000)]
Remove the now unused ex_pcpathlen from the X509 struct

ok jsing

18 months agoMore ProxyCertInfo tentacles go to the attic
tb [Sun, 16 Apr 2023 08:06:42 +0000 (08:06 +0000)]
More ProxyCertInfo tentacles go to the attic

This removes ProxyCertInfo from extension caching, issuer checking
and it also drops the special path validation for proxy certs from
the legacy verifier.

ok jsing

18 months agoThe lowest performance level state for the E-cores on the M2 Pro/Max is
kettenis [Sun, 16 Apr 2023 08:02:45 +0000 (08:02 +0000)]
The lowest performance level state for the E-cores on the M2 Pro/Max is
2 instead of 1.  Handle this by taking the lowest state from the opp tables
instead of hardcoding it.  Fixes cpuperf on the M2 Pro/Max.

ok patrick@

18 months agoRemove some dead code from the new verifier
tb [Sun, 16 Apr 2023 07:59:57 +0000 (07:59 +0000)]
Remove some dead code from the new verifier

The new verifier API is currently unused as we still operate the verifier
in legacy mode. Therefore ctx->xsc is always set and the EXFLAG_PROXY will
soon be dropped from the library, so this error on encountering proxy certs
is effectively doubly dead code.

ok jsing

18 months agoDrop support for the ProxyCertInfo extension
tb [Sun, 16 Apr 2023 07:49:36 +0000 (07:49 +0000)]
Drop support for the ProxyCertInfo extension

This removes the ProxyCertInfo extension from RFC 3820 from the list of
supported extensions. Since it is a critical extension, this means that
certificates containing it will no longer be considered valid by default.

ok jsing

18 months agoMake pcy_int.h pull in x509_local.h it will need it soon
tb [Sun, 16 Apr 2023 07:36:43 +0000 (07:36 +0000)]
Make pcy_int.h pull in x509_local.h it will need it soon

ok jsing

18 months agoAdd /etc/mixerctl.conf to changelist(5).
ajacoutot [Sun, 16 Apr 2023 07:16:58 +0000 (07:16 +0000)]
Add /etc/mixerctl.conf to changelist(5).

ok deraadt@ kn@ semarie@

18 months agocall default db_ktrap() with tf_err, not 0 for exception error code
jsg [Sun, 16 Apr 2023 06:43:49 +0000 (06:43 +0000)]
call default db_ktrap() with tf_err, not 0 for exception error code
ok guenther@

18 months agoHandle T_CP traps from userland by generating SIGILL, with
guenther [Sun, 16 Apr 2023 06:38:50 +0000 (06:38 +0000)]
Handle T_CP traps from userland by generating SIGILL, with
code ILL_ILLOPC or ILL_BADSTK depending on the error from hardware

lack of handling noted by deraadt@
ok jsg@

18 months agoTrap 17 (T_ALIGNFLT) supplies an error code in hardware; use TRAP()
guenther [Sun, 16 Apr 2023 05:40:25 +0000 (05:40 +0000)]
Trap 17 (T_ALIGNFLT) supplies an error code in hardware; use TRAP()
instead of ZTRAP().  T_ALIGNFLT fixed in NetBSD on 2003-12-12

ok deraadt@ jsg@

18 months agoBoth trap 21 (T_CP) and trap 17 (T_ALIGNFLT) supply an error code
guenther [Sun, 16 Apr 2023 05:39:33 +0000 (05:39 +0000)]
Both trap 21 (T_CP) and trap 17 (T_ALIGNFLT) supply an error code
in hardware; use TRAP() instead of ZTRAP().  T_ALIGNFLT fixed in
NetBSD on 2012-4-21

ok deraadt@ jsg@

18 months agovmm(4): save and restore Intel CET state on vm entry/exit.
dv [Sun, 16 Apr 2023 01:50:12 +0000 (01:50 +0000)]
vmm(4): save and restore Intel CET state on vm entry/exit.

18 months agoec_point_conversion: do not rely on ec.h pulling in bn.h
tb [Sat, 15 Apr 2023 21:53:38 +0000 (21:53 +0000)]
ec_point_conversion: do not rely on ec.h pulling in bn.h

18 months agoUse size_t rather than int.
jsing [Sat, 15 Apr 2023 20:00:24 +0000 (20:00 +0000)]
Use size_t rather than int.

Also buy a vowel for rsiz.

18 months agoAdd SHA3 digest length define that was previously missed.
jsing [Sat, 15 Apr 2023 19:44:36 +0000 (19:44 +0000)]
Add SHA3 digest length define that was previously missed.

18 months agoRemove sha3() function, which will not be used or exposed.
jsing [Sat, 15 Apr 2023 19:30:31 +0000 (19:30 +0000)]
Remove sha3() function, which will not be used or exposed.

18 months agoMark sha3_keccakf() as static and remove prototype from header.
jsing [Sat, 15 Apr 2023 19:29:20 +0000 (19:29 +0000)]
Mark sha3_keccakf() as static and remove prototype from header.

18 months agoUse memset() to zero the context, instead of zeroing manually.
jsing [Sat, 15 Apr 2023 19:27:54 +0000 (19:27 +0000)]
Use memset() to zero the context, instead of zeroing manually.

18 months agoProvide SHA3 length related defines.
jsing [Sat, 15 Apr 2023 19:22:34 +0000 (19:22 +0000)]
Provide SHA3 length related defines.

These will make EVP integration easier, as well as being used in the SHA3
implementation itself.

18 months agoUse the same byte order tests as we do elsewhere in libcrypto.
jsing [Sat, 15 Apr 2023 19:15:53 +0000 (19:15 +0000)]
Use the same byte order tests as we do elsewhere in libcrypto.

18 months agoAdjust documentation of X9.31 padding mode
tb [Sat, 15 Apr 2023 18:59:49 +0000 (18:59 +0000)]
Adjust documentation of X9.31 padding mode

18 months agoStop supporting the long-retired X9.31 standard
tb [Sat, 15 Apr 2023 18:48:52 +0000 (18:48 +0000)]
Stop supporting the long-retired X9.31 standard

This isolates the three API functions from the library so they can be
easily removed and any attempt to use RSA_X931_PADDING mode will now
result in an error.

ok jsing

18 months agoPrepare rsa.h for X9.31 support removal
tb [Sat, 15 Apr 2023 18:44:17 +0000 (18:44 +0000)]
Prepare rsa.h for X9.31 support removal

This wraps the three public functions in the usual #if stanza.

RSA_X931_PADDING is unfortunately exposed by rust-openssl and erlang.
Therefore it will remain visible to avoid breaking the build of
lang/rust. Its use in the library will be neutered shortly.

ok jsing

18 months agoRemove now unused GF2m perlasm generators
tb [Sat, 15 Apr 2023 18:37:36 +0000 (18:37 +0000)]
Remove now unused GF2m perlasm generators

18 months agoRename SHA3 context struct field from 'st' to 'state'.
jsing [Sat, 15 Apr 2023 18:32:55 +0000 (18:32 +0000)]
Rename SHA3 context struct field from 'st' to 'state'.

18 months agoRename SHA3 context to align with existing code.
jsing [Sat, 15 Apr 2023 18:30:27 +0000 (18:30 +0000)]
Rename SHA3 context to align with existing code.

18 months agoMove some defines out of the sha3_internal.h header.
jsing [Sat, 15 Apr 2023 18:29:26 +0000 (18:29 +0000)]
Move some defines out of the sha3_internal.h header.

18 months agoStop building GF2m assembly
tb [Sat, 15 Apr 2023 18:23:54 +0000 (18:23 +0000)]
Stop building GF2m assembly

GF2m support will be removed shortly. In the interim drop some of this
unused code already and let it fall back to the C implementation.

ok jsing

18 months agoRevise header guards.
jsing [Sat, 15 Apr 2023 18:22:53 +0000 (18:22 +0000)]
Revise header guards.

18 months agoPull constant tables out of sha3_keccakf().
jsing [Sat, 15 Apr 2023 18:19:06 +0000 (18:19 +0000)]
Pull constant tables out of sha3_keccakf().

18 months agoStrip and reformat comments.
jsing [Sat, 15 Apr 2023 18:14:21 +0000 (18:14 +0000)]
Strip and reformat comments.

Remove various comments that are unhelpful or obvious. Reformat remaining
comments per style(9).

18 months agoApply style(9) (first pass).
jsing [Sat, 15 Apr 2023 18:07:44 +0000 (18:07 +0000)]
Apply style(9) (first pass).

18 months agoImport sha3_internal.h.
jsing [Sat, 15 Apr 2023 18:00:57 +0000 (18:00 +0000)]
Import sha3_internal.h.

18 months agoAdd license to sha3 files.
jsing [Sat, 15 Apr 2023 17:59:50 +0000 (17:59 +0000)]
Add license to sha3 files.

18 months agoImport tiny_sha3
jsing [Sat, 15 Apr 2023 17:56:35 +0000 (17:56 +0000)]
Import tiny_sha3

This is a minimal and readable SHA3 implementation.

ok tb@

18 months agossltest: Drop more policy go from this test.
tb [Sat, 15 Apr 2023 16:50:05 +0000 (16:50 +0000)]
ssltest: Drop more policy go from this test.

Hopefully that is all. What an absolutely horrid mess.