openbsd
7 months agoalso create a relink kit for ssh-agent, since it is a long-running setgid
deraadt [Mon, 1 Apr 2024 15:50:17 +0000 (15:50 +0000)]
also create a relink kit for ssh-agent, since it is a long-running setgid
program carrying keys with some (not very powerful) communication channels.
solution for testing the binary from dtucker.  agreement from djm.
Will add it into /etc/rc in a few days.

7 months agonew-style relink kit for sshd. The old scheme created a Makefile by
deraadt [Mon, 1 Apr 2024 15:48:16 +0000 (15:48 +0000)]
new-style relink kit for sshd.  The old scheme created a Makefile by
concatenating two Makefiles and was incredibly fragile.  In the new way
a narrow-purposed install.sh script is created and shipped with the objects.
A recently commited /etc/rc script understands these files.

7 months agoThe previous unveil feature test assumed that having the
florian [Mon, 1 Apr 2024 14:24:30 +0000 (14:24 +0000)]
The previous unveil feature test assumed that having the
unistd.h header file was enough. The new feature tests also
requires that the required unveil system calls are
supported.

7 months agoAdd some #ifdef XML_TESTING to the libexpat tests.
bluhm [Mon, 1 Apr 2024 13:46:06 +0000 (13:46 +0000)]
Add some #ifdef XML_TESTING to the libexpat tests.

Upstream builds special libexpat objects for testing with an internal
flag and counter.  As OpenBSD does test the installed production
library, disable tests that depend on special options.  Use the
same define that activates the test code in the library.  Without
this, regress would not compile.

7 months agoUpdate libexpat to version 2.6.2.
bluhm [Mon, 1 Apr 2024 13:30:41 +0000 (13:30 +0000)]
Update libexpat to version 2.6.2.

The fix for CVE-2024-28757 has been applied earlier.  Relevant for
OpenBSD are bug fixes #839 #841, and other change #829.  No library
bump is necessary.

OK deraadt@

7 months agoMention that port can be specified as 0 in some situations, so that the
deraadt [Mon, 1 Apr 2024 12:40:18 +0000 (12:40 +0000)]
Mention that port can be specified as 0 in some situations, so that the
system will allocate a port.

7 months agoEnforce the pinsyscall rules on non-static/ld.so/libc.so text segments
deraadt [Mon, 1 Apr 2024 12:00:15 +0000 (12:00 +0000)]
Enforce the pinsyscall rules on non-static/ld.so/libc.so text segments
also. Previously this was handled by msyscall(2), but that was just
removed and anton fond out a piece of enforcement was missed..

7 months agoAdd clocks for the RK3588 PWM controller.
patrick [Mon, 1 Apr 2024 11:16:11 +0000 (11:16 +0000)]
Add clocks for the RK3588 PWM controller.

ok kettenis@

7 months agosync
deraadt [Mon, 1 Apr 2024 05:47:03 +0000 (05:47 +0000)]
sync

7 months agoDelete 108 lines of ASM from vmx_enter_guest() that predated lots
guenther [Mon, 1 Apr 2024 05:11:49 +0000 (05:11 +0000)]
Delete 108 lines of ASM from vmx_enter_guest() that predated lots
of later enhancements, removing the save/restore of flags, selectors,
and MSRs: flags are caller-saved and don't need restoring while
selectors and MSRs are auto-restored.  The FSBASE, GSBASE, and
KERNELGSBASE MSRs just need the correct values set with vmwrite()
in the "on new CPU?" block of vcpu_run_vmx().

Also, only rdmsr(MSR_MISC_ENABLE) once in vcpu_reset_regs_vmx(),
give symbolic names to the exit-load MSR slots, eliminate
VMX_NUM_MSR_STORE, and #if 0 the vc_vmx_msr_entry_load_{va,pa} code
and definitions as unused.

ok dv@

7 months agoEnable rge(4).
kettenis [Sun, 31 Mar 2024 19:17:53 +0000 (19:17 +0000)]
Enable rge(4).

7 months agoCombine route_cache() and rtalloc_mpath() in new route_mpath().
bluhm [Sun, 31 Mar 2024 15:53:12 +0000 (15:53 +0000)]
Combine route_cache() and rtalloc_mpath() in new route_mpath().

Fill and check the cache and call rtalloc_mpath() together.  Then
the caller of route_mpath() does not have to care about the uint32_t
*src pointer and just pass struct in_addr.  All the conversions are
done inside the functions.

A previous version of this diff was backed out.  There was an
additional rtisvalid() in rtalloc_mpath() that prevented packet
output via interfaces that were not up.  Now the route in the cache
has to be valid, but after new lookup, rtalloc_mpath() may return
invalid routes.  This generates less errors in userland an preserves
existing behavior.

OK sashan@

7 months agoAllow listen(2) only on sockets of type SOCK_STREAM or SOCK_SEQPACKET.
mvs [Sun, 31 Mar 2024 14:01:28 +0000 (14:01 +0000)]
Allow listen(2) only on sockets of type SOCK_STREAM or SOCK_SEQPACKET.
listen(2) man(1) page clearly prohibits sockets of other types.

Reported-by: syzbot+00450333592fcd38c6fe@syzkaller.appspotmail.com
ok bluhm

7 months agoMark `so_rcv' sockbuf of udp(4) sockets as SB_OWNLOCK.
mvs [Sun, 31 Mar 2024 13:50:00 +0000 (13:50 +0000)]
Mark `so_rcv' sockbuf of udp(4) sockets as SB_OWNLOCK.

sbappend*() and soreceive() of SB_MTXLOCK marked sockets uses `sb_mtx'
mutex(9) for protection, meanwhile buffer usage check and corresponding
sbwait() sleep still serialized by solock(). Mark udp(4) as SB_OWNLOCK
to avoid solock() serialization and rely to `sb_mtx' mutex(9). The
`sb_state' and `sb_flags' modifications must be protected by `sb_mtx'
too.

ok bluhm

7 months agoRegen
miod [Sun, 31 Mar 2024 10:14:46 +0000 (10:14 +0000)]
Regen

7 months agoFix /dev/bio major.
miod [Sun, 31 Mar 2024 10:14:35 +0000 (10:14 +0000)]
Fix /dev/bio major.

7 months agoRemove long dead isa-on-powerpc leftovers.
miod [Sun, 31 Mar 2024 09:49:33 +0000 (09:49 +0000)]
Remove long dead isa-on-powerpc leftovers.

7 months agoStop referring to dead-since-30-years gatherstats() in comments.
miod [Sun, 31 Mar 2024 07:23:29 +0000 (07:23 +0000)]
Stop referring to dead-since-30-years gatherstats() in comments.

7 months agoPrevent a recursion inside wakeup(9) when scheduler tracepoints are enabled.
mpi [Sat, 30 Mar 2024 13:33:20 +0000 (13:33 +0000)]
Prevent a recursion inside wakeup(9) when scheduler tracepoints are enabled.

Tracepoints like "sched:enqueue" and "sched:unsleep" were called from inside
the loop iterating over sleeping threads as part of wakeup_proc().  When such
tracepoints were enabled they could result in another wakeup(9) possibly
corrupting the sleepqueue.

Rewrite wakeup(9) in two stages, first dequeue threads from the sleepqueue then
call setrunnable() and possible tracepoints for each of them.

This requires moving unsleep() outside of setrunnable() because it messes with
the sleepqueue.

ok claudio@

7 months agoDocument that pmemrange control data are protected by `uvm.fpageqlock'.
mpi [Sat, 30 Mar 2024 12:47:47 +0000 (12:47 +0000)]
Document that pmemrange control data are protected by `uvm.fpageqlock'.

7 months agoregen
jsg [Sat, 30 Mar 2024 11:13:17 +0000 (11:13 +0000)]
regen

7 months agoadd ids seen on Milk-V Pioneer
jsg [Sat, 30 Mar 2024 11:12:20 +0000 (11:12 +0000)]
add ids seen on Milk-V Pioneer

but not the Cadence ppb, it seems unlikely they asked Cadence to use it
ok deraadt@ kettenis@

7 months agoUse illop1 as failure instruction in the locore gap file.
miod [Sat, 30 Mar 2024 10:43:38 +0000 (10:43 +0000)]
Use illop1 as failure instruction in the locore gap file.

7 months agoPrefer illop1 rather than nop for text padding in the ld.so linker script.
miod [Sat, 30 Mar 2024 10:42:26 +0000 (10:42 +0000)]
Prefer illop1 rather than nop for text padding in the ld.so linker script.

7 months agoProvide illop1 instruction encoding as TRAP.
miod [Sat, 30 Mar 2024 10:41:17 +0000 (10:41 +0000)]
Provide illop1 instruction encoding as TRAP.

7 months agoAdd missing LCRYPTO_ALIAS()
tb [Sat, 30 Mar 2024 10:10:58 +0000 (10:10 +0000)]
Add missing LCRYPTO_ALIAS()

HMAC_CTX_reset() and HMAC_Init() had missing LCRYPTO_ALIAS().

ok beck jsing

7 months agoFix LCRYPTO_UNUSED() in namespace builds
tb [Sat, 30 Mar 2024 10:09:43 +0000 (10:09 +0000)]
Fix LCRYPTO_UNUSED() in namespace builds

If namespace builds are enabled, static links don't work due to missing
_lcry_* symbols. Make LCRYPTO_UNUSED() match LCRYPTO_USED() with an extra
deprecated attribute. This way we can remove the !LIBRESSL_INTERNAL #ifdef
wrapping in public headers.

ok beck joshua

7 months agoInitialize quic_method in tlsexttest
tb [Sat, 30 Mar 2024 09:53:41 +0000 (09:53 +0000)]
Initialize quic_method in tlsexttest

This is only there to pretend a quic method was set on the SSL, but
apparently some compilers warn about an uninitialized variable.

from Christian Andersen

7 months agoReplace silly test1_exit() with exit()
tb [Sat, 30 Mar 2024 09:49:59 +0000 (09:49 +0000)]
Replace silly test1_exit() with exit()

Appeases some compiler.

from Christian Andersen

7 months agoRemove call to lh_FUNCTION_free()
tb [Sat, 30 Mar 2024 09:41:25 +0000 (09:41 +0000)]
Remove call to lh_FUNCTION_free()

This is a wrapper around lh_free() which is already tested.

From Christian Andersen

7 months agoRemove nonsensical comments. NFC
miod [Sat, 30 Mar 2024 08:44:20 +0000 (08:44 +0000)]
Remove nonsensical comments. NFC

7 months agoIn _malloc_init(), round up the region being mprotected RW to the malloc
miod [Sat, 30 Mar 2024 07:50:39 +0000 (07:50 +0000)]
In _malloc_init(), round up the region being mprotected RW to the malloc
page size, rather than relying upon mprotect to round up to the actual mmu
page size.

This repairs malloc operation on systems where the malloc page size
(1 << _MAX_PAGE_SHIFT) is larger than the mmu page size.

ok otto@

7 months agoBring back an inline db_enter(), which makes backtraces easier to grok
miod [Sat, 30 Mar 2024 07:45:21 +0000 (07:45 +0000)]
Bring back an inline db_enter(), which makes backtraces easier to grok
when sh*t hits the fan; per kettenis@ request and forgotten in previous
cleaning commit.

7 months agoImplement else branching logic including 'else if'.
mpi [Sat, 30 Mar 2024 07:41:45 +0000 (07:41 +0000)]
Implement else branching logic including 'else if'.

Statement lists for if & else conditions are now wrapped in a new
'struct bt_cond'.  Handling B_AC_TEST statements moved to stmt_eval()
to handle nested conditional statements.

From Christian Ludwig christian_ludwig at genua.de

7 months agoprogram relinking currently uses a Makefile.relink inside the re-link kit.
deraadt [Sat, 30 Mar 2024 07:35:01 +0000 (07:35 +0000)]
program relinking currently uses a Makefile.relink inside the re-link kit.
For sshd (the only relinked program at the moment), this file is created
in an extremely nasty way.  It'll be better if we have a proper clean
install.sh script, which I've built for sshd.  But let's first commit the
change to /etc/rc which will handle that in the near future.
ok djm

7 months agoin OpenSSH private key format, correct type for subsequent private
djm [Sat, 30 Mar 2024 05:56:22 +0000 (05:56 +0000)]
in OpenSSH private key format, correct type for subsequent private
keys in blob. From Jakub Jelen via GHPR430

7 months agoHide symbols in aes
joshua [Sat, 30 Mar 2024 05:14:12 +0000 (05:14 +0000)]
Hide symbols in aes

ok jsing

7 months agoHide symbols in camellia
joshua [Sat, 30 Mar 2024 04:58:12 +0000 (04:58 +0000)]
Hide symbols in camellia

ok tb

7 months agoRewrite RSA_padding_add_PKCS1_type_{1,2}() with CBS/CBB.
jsing [Sat, 30 Mar 2024 04:34:17 +0000 (04:34 +0000)]
Rewrite RSA_padding_add_PKCS1_type_{1,2}() with CBS/CBB.

ok tb@

7 months agoallow WAYLAND_DISPLAY to enable SSH_ASKPASS
djm [Sat, 30 Mar 2024 04:27:44 +0000 (04:27 +0000)]
allow WAYLAND_DISPLAY to enable SSH_ASKPASS

From dkg via GHPR479; ok dtucker@

7 months agoHide symbols in whrlpool
joshua [Sat, 30 Mar 2024 03:45:47 +0000 (03:45 +0000)]
Hide symbols in whrlpool

ok tb

7 months agoDo multiple padding add/check iterations.
jsing [Sat, 30 Mar 2024 02:20:39 +0000 (02:20 +0000)]
Do multiple padding add/check iterations.

This increases the chance of triggering bugs due to input and/or randomised
padding.

7 months agoHide symbols in CMS
joshua [Sat, 30 Mar 2024 01:53:05 +0000 (01:53 +0000)]
Hide symbols in CMS

ok jsing

7 months agouse void in function decl with no args; avoids non-ANSI smatch warnings
jsg [Sat, 30 Mar 2024 01:13:56 +0000 (01:13 +0000)]
use void in function decl with no args; avoids non-ANSI smatch warnings

7 months agoAdd initial regress for RSA padding.
jsing [Sat, 30 Mar 2024 00:36:14 +0000 (00:36 +0000)]
Add initial regress for RSA padding.

7 months agoRemove pointless guard in cms header
joshua [Sat, 30 Mar 2024 00:35:15 +0000 (00:35 +0000)]
Remove pointless guard in cms header

ok jsing

7 months agoTidy indentation.
jsing [Sat, 30 Mar 2024 00:34:40 +0000 (00:34 +0000)]
Tidy indentation.

Requested by tb@

7 months agoRemove -app2_1 flags being passed to dsa and rsa regress.
jsing [Sat, 30 Mar 2024 00:32:13 +0000 (00:32 +0000)]
Remove -app2_1 flags being passed to dsa and rsa regress.

Nothing does flag handling in these tests.

7 months agoUse SBI calls to reboot or power down the machine when the firmware
kettenis [Fri, 29 Mar 2024 22:11:34 +0000 (22:11 +0000)]
Use SBI calls to reboot or power down the machine when the firmware
supports them.

ok jca@

7 months agoSkip calculating timings if we can't determine the frequency of the clock.
kettenis [Fri, 29 Mar 2024 22:08:09 +0000 (22:08 +0000)]
Skip calculating timings if we can't determine the frequency of the clock.
This avoids programming the hardware with clearly wrong values.  On the
Milk-V Pioneer this means the I2C controller remains functional and
rebooting using the appropriate SBI call still works.

ok miod@

7 months agoDrop the first argument of intr_establish().
miod [Fri, 29 Mar 2024 21:29:33 +0000 (21:29 +0000)]
Drop the first argument of intr_establish().

Instead, require all callers to put the right value in the ih_pil field, and
have intr_establish() trust them rather than assigning this field again from
its first argument.

ok claudio@ kettenis@

7 months agoStore the physical address of each pcb in struct mdproc, and use this in
miod [Fri, 29 Mar 2024 21:27:53 +0000 (21:27 +0000)]
Store the physical address of each pcb in struct mdproc, and use this in
order to speed up window spills, rather than doing an inline pmap_extract
(well, pseg_get).

ok claudio@ kettenis@

7 months agoRemove truly unneeded includes (not included indirectly).
miod [Fri, 29 Mar 2024 21:26:38 +0000 (21:26 +0000)]
Remove truly unneeded includes (not included indirectly).

ok claudio@ kettenis@

7 months agoCheck for %otherwin being nonzero earlier in rft_user.
miod [Fri, 29 Mar 2024 21:25:55 +0000 (21:25 +0000)]
Check for %otherwin being nonzero earlier in rft_user.

There is one code path using it in %g2 and another using it in %g7.
There is no reason for them to use different registers, and fixing
this allows the check to be performed a bit earlier.

ok claudio@ kettenis@

7 months agoSimplify two more places where we don't need to check for unbiased stacks.
miod [Fri, 29 Mar 2024 21:23:17 +0000 (21:23 +0000)]
Simplify two more places where we don't need to check for unbiased stacks.

ok claudio@ kettenis@

7 months agoSTACKFRAME macro is always invoked on a well-formed 64-bit stack, no need
miod [Fri, 29 Mar 2024 21:20:03 +0000 (21:20 +0000)]
STACKFRAME macro is always invoked on a well-formed 64-bit stack, no need
to check for missing BIAS.

ok claudio@ kettenis@

7 months agoText faults should not invoke uvm_grow() since the fault address is not on
miod [Fri, 29 Mar 2024 21:19:30 +0000 (21:19 +0000)]
Text faults should not invoke uvm_grow() since the fault address is not on
stack. Remove duplicated "panic if uvm_fault() fails and we are in kernel mode"
blocks.

ok claudio@ kettenis@

7 months agosend_softint() was designed as being able to target a particular cpu, but the
miod [Fri, 29 Mar 2024 21:18:19 +0000 (21:18 +0000)]
send_softint() was designed as being able to target a particular cpu, but the
code for this was never written and all uses target the running cpu anyway,
so stop pretending it may do things it won't do and drop that cpu argument.

ok claudio@ kettenis@

7 months agoUpdate/fix/remove obsolete or just plainly wrong comments.
miod [Fri, 29 Mar 2024 21:17:13 +0000 (21:17 +0000)]
Update/fix/remove obsolete or just plainly wrong comments.

ok claudio@ kettenis@

7 months agoStop including <machine/signal.h> in locore and remove _LOCORE guards
miod [Fri, 29 Mar 2024 21:16:38 +0000 (21:16 +0000)]
Stop including <machine/signal.h> in locore and remove _LOCORE guards
from this header file.

ok claudio@ kettenis@

7 months agoMove C declarations from intreg.h to <machine/intr.h> which includes it.
miod [Fri, 29 Mar 2024 21:16:01 +0000 (21:16 +0000)]
Move C declarations from intreg.h to <machine/intr.h> which includes it.

This makes intreg.h locore-friendly - it only contains the MAXINTNUM define
after that.

ok claudio@ kettenis@

7 months agoGet rid of unnecessary defines in assym.h.
miod [Fri, 29 Mar 2024 21:14:56 +0000 (21:14 +0000)]
Get rid of unnecessary defines in assym.h.

ok claudio@ kettenis@

7 months agoClean the fpu trap code:
miod [Fri, 29 Mar 2024 21:14:31 +0000 (21:14 +0000)]
Clean the fpu trap code:
- since there are no hardware fpu operation queues on real sparc64 hardware,
  don't bother declaring the relevant struct and fields.
- when an fpu instruction needs to be emulated, pass it directly to
  fpu_cleanup rather than fake its appearance in the fpu queue. While there,
  also pass the ready-to-use union sigval computed in trap() in case a
  signal needs to be delivered.

ok claudio@ kettenis@

7 months agoBe sure to reset p->p_md.md_fpstate to NULL after freeing it in cpu_exit().
miod [Fri, 29 Mar 2024 21:12:58 +0000 (21:12 +0000)]
Be sure to reset p->p_md.md_fpstate to NULL after freeing it in cpu_exit().
There should hopefully be no further faults on this proc causing an fpu
state to be handled, but better play safe than sorry.

ok claudio@ kettenis@

7 months agoClean-up cache-related definitions and routines.
miod [Fri, 29 Mar 2024 21:11:31 +0000 (21:11 +0000)]
Clean-up cache-related definitions and routines.

ok claudio@ kettenis@

7 months agoComment out unused routines. They might become used in the future, so they
miod [Fri, 29 Mar 2024 21:09:49 +0000 (21:09 +0000)]
Comment out unused routines. They might become used in the future, so they
are better not moved to the Attic yet.

ok claudio@ kettenis@

7 months agoRemove dead code. Some of it had been dead since the very beginning of the
miod [Fri, 29 Mar 2024 21:09:04 +0000 (21:09 +0000)]
Remove dead code. Some of it had been dead since the very beginning of the
sparc64 port.

ok claudio@ kettenis@

7 months agoNo longer include <machine/fsr.h> from <machine/reg.h>, and have the few
miod [Fri, 29 Mar 2024 21:08:10 +0000 (21:08 +0000)]
No longer include <machine/fsr.h> from <machine/reg.h>, and have the few
users which need both explicitly include both.

ok claudio@ kettenis@

7 months agoDe-register fpu completion code.
miod [Fri, 29 Mar 2024 21:07:11 +0000 (21:07 +0000)]
De-register fpu completion code.

There are pending changes to some of these files, and this would get in the
way.

ok claudio@ kettenis@

7 months agoRemove dead defines, prototypes and data, and duplicate or misleading comments.
miod [Fri, 29 Mar 2024 21:06:14 +0000 (21:06 +0000)]
Remove dead defines, prototypes and data, and duplicate or misleading comments.

ok claudio@ kettenis@

7 months agoRemove unconditional define of _LOCORE.
miod [Fri, 29 Mar 2024 21:05:34 +0000 (21:05 +0000)]
Remove unconditional define of _LOCORE.

This was used to get once-protected-by-_LOCORE defines from
<machine/frame.h>, but is now completely unnecessary and possibly dangerous.

ok claudio@ kettenis@

7 months agoNow that this file is no longer used by any libc C file, get rid of checks
miod [Fri, 29 Mar 2024 21:04:37 +0000 (21:04 +0000)]
Now that this file is no longer used by any libc C file, get rid of checks
for the _LIBC preprocessor symbol.

Also move the CC64FSZ and BIAS defines earlier in order to only have one
!_LOCORE block.

ok claudio@ kettenis@

7 months agoDo not include <machine/frame.h> in libc sparc64 fpu routines, they don't
miod [Fri, 29 Mar 2024 21:02:11 +0000 (21:02 +0000)]
Do not include <machine/frame.h> in libc sparc64 fpu routines, they don't
need any of its contents.
ok claudio@ kettenis@

7 months agoFix writing the prefetchable mmio window base/limit.
kettenis [Fri, 29 Mar 2024 12:45:13 +0000 (12:45 +0000)]
Fix writing the prefetchable mmio window base/limit.

ok patrick@

7 months agoTweak defines since the Td4 table is only used for AES_{encrypt,decrypt}
jsing [Fri, 29 Mar 2024 11:19:01 +0000 (11:19 +0000)]
Tweak defines since the Td4 table is only used for AES_{encrypt,decrypt}

7 months agoAlways use C functions for AES_{encrypt,decrypt}().
jsing [Fri, 29 Mar 2024 11:00:57 +0000 (11:00 +0000)]
Always use C functions for AES_{encrypt,decrypt}().

Always provide AES_{encrypt,decrypt}() via C functions, which then either
use a C implementation or call the assembly implementation.

ok tb@

7 months agoUse egrep instead of grep -E. Some plaforms don't have the latter so this
dtucker [Fri, 29 Mar 2024 10:40:07 +0000 (10:40 +0000)]
Use egrep instead of grep -E.  Some plaforms don't have the latter so this
makes things easier in -portable.

7 months agoskip dwqe_tx_proc() processing while the interface is not up
stsp [Fri, 29 Mar 2024 08:19:40 +0000 (08:19 +0000)]
skip dwqe_tx_proc() processing while the interface is not up

Prevents a crash seen by bluhm@ while running flood ping in parallel
to looping ifconfig dwqe0 down up:
kernel: protection fault trap, code=0
Stopped at      m_tag_delete_chain+0x30:        movq    0(%rsi),%rax

ok kettenis@ dlg@ patrick@ deraadt@

7 months agoSYS_msyscall will go away soon. kdump does not need a special handler
deraadt [Fri, 29 Mar 2024 07:53:32 +0000 (07:53 +0000)]
SYS_msyscall will go away soon.  kdump does not need a special handler
for it.
ok tb

7 months agoRemove previously missed idea file.
jsing [Fri, 29 Mar 2024 07:45:36 +0000 (07:45 +0000)]
Remove previously missed idea file.

7 months agoConsolidate cast code.
jsing [Fri, 29 Mar 2024 07:36:38 +0000 (07:36 +0000)]
Consolidate cast code.

7 months agoConsolidate camellia code.
jsing [Fri, 29 Mar 2024 07:26:21 +0000 (07:26 +0000)]
Consolidate camellia code.

7 months agoMove camellia to primary Makefile.
jsing [Fri, 29 Mar 2024 07:24:09 +0000 (07:24 +0000)]
Move camellia to primary Makefile.

These files are now built on all platforms.

7 months agoAdd table-driven Whirlpool tests
joshua [Fri, 29 Mar 2024 07:13:38 +0000 (07:13 +0000)]
Add table-driven Whirlpool tests

ok tb

7 months agoRemove now unused camellia assembly implementations.
jsing [Fri, 29 Mar 2024 07:09:37 +0000 (07:09 +0000)]
Remove now unused camellia assembly implementations.

7 months agosync
deraadt [Fri, 29 Mar 2024 07:08:45 +0000 (07:08 +0000)]
sync

7 months agoStop building camellia assembly on amd64 and i386.
jsing [Fri, 29 Mar 2024 07:06:21 +0000 (07:06 +0000)]
Stop building camellia assembly on amd64 and i386.

This is a legacy algorithm and the assembly is only marginally faster than
the C code.

Discussed with beck@ and tb@

7 months agoStop printing the "syscall" bit related to msyscall(2), since the subsystem
deraadt [Fri, 29 Mar 2024 06:54:13 +0000 (06:54 +0000)]
Stop printing the "syscall" bit related to msyscall(2), since the subsystem
is being deleted.

7 months agoNo longer build the objective-C compiler (cc1obj). Its standard library
miod [Fri, 29 Mar 2024 06:52:50 +0000 (06:52 +0000)]
No longer build the objective-C compiler (cc1obj). Its standard library
(libobjc) had been removed from the build years ago, there is no need to
keep the compiler.
ok beck@ joshua@

7 months agoRemove one global variable duplicating uvmexp.pagesize.
miod [Fri, 29 Mar 2024 06:50:06 +0000 (06:50 +0000)]
Remove one global variable duplicating uvmexp.pagesize.
ok guenther@ deraadt@

7 months agoSimplify the conditionals for architectures which do not need any particular
miod [Fri, 29 Mar 2024 06:49:00 +0000 (06:49 +0000)]
Simplify the conditionals for architectures which do not need any particular
md files lists.
ok guenther@ deraadt@

7 months agothe msyscall(2) manual page can be deleted.
deraadt [Fri, 29 Mar 2024 06:48:04 +0000 (06:48 +0000)]
the msyscall(2) manual page can be deleted.
Also, the details described in sigaltstack(2) are no longer true.
ok jmc

7 months agoRemove the at-syscall-time check for msyscall(2)'s behaviour. msyscall(2)
deraadt [Fri, 29 Mar 2024 06:47:05 +0000 (06:47 +0000)]
Remove the at-syscall-time check for msyscall(2)'s behaviour.  msyscall(2)
was a big coding effort to ensure that system calls could only be performed
from static-binary/ld.so/libc.so/sigtramp regions of memory, by caching a
uvm entry with a serial number; new mmap/mprotect calls would increment
the map serial, and the entry would need to be looked up again.  So the
cost was O(1) in the usual case, but O(log n) with some locking if a map
change required a new lookup.
In the new world order, such regions are immutable so they cannot be
changed/split by mmap/mprotect; also we know the precise entry locations
of the syscalls due to system call pinning (ELF OPENBSD_SYSCALL and
pinsyscalls(2)), and this is all done as O(1) without any locking.

All the other parts of the subsystem will be ripped out but please
run a kernel with this before I make changes to ld.so..
ok kettenis

7 months agoSprinkle a few references to RFC 8419
tb [Fri, 29 Mar 2024 06:43:12 +0000 (06:43 +0000)]
Sprinkle a few references to RFC 8419

7 months agoAdd regress coverage for EdDSA in CMS
tb [Fri, 29 Mar 2024 06:42:42 +0000 (06:42 +0000)]
Add regress coverage for EdDSA in CMS

7 months agoImplement Ed25519 signatures for CMS (RFC 8419)
tb [Fri, 29 Mar 2024 06:41:58 +0000 (06:41 +0000)]
Implement Ed25519 signatures for CMS (RFC 8419)

This adds support for Edwards curve digital signature algorithms in the
cryptographic message syntax, as specified in RFC 8419. Only Ed25519 is
supported since that is the only EdDSA algorithm that LibreSSL supports
(this is unlikely to change ever, but, as they say - never is a very
long time).

This has the usual curly interactions between EVP and CMS with poorly
documented interfaces and lots of confusing magic return values and
controls. This improves upon existing control handlers by documenting
what is being done and why. Unlike other (draft) implementations we
also happen to use the correct hashing algorithm.

There are no plans to implement RFC 8418.

joint work with job at p2k23

ok jsing

7 months agoMove aes_core.c to the primary Makefile.
jsing [Fri, 29 Mar 2024 06:03:20 +0000 (06:03 +0000)]
Move aes_core.c to the primary Makefile.

This is now built on all platforms.

7 months agoConsolidate idea into a single C file.
jsing [Fri, 29 Mar 2024 05:23:50 +0000 (05:23 +0000)]
Consolidate idea into a single C file.

7 months agoRemove unused n2ln, l2nn, n2l and l2n macros.
jsing [Fri, 29 Mar 2024 05:03:48 +0000 (05:03 +0000)]
Remove unused n2ln, l2nn, n2l and l2n macros.

7 months agoMake X509_VERIFY_PARAM_set1_policies() less bad
tb [Fri, 29 Mar 2024 04:50:11 +0000 (04:50 +0000)]
Make X509_VERIFY_PARAM_set1_policies() less bad

If any OBJ_dup() fails along the way, a partially copied policy stack
would remain on the params object. This makes no sense. Implement and
use an sk_ASN1_OBJECT_deep_copy(), that copies the full stack or else
returns NULL.

Remove unnecessary NULL check and streamline some other logic.

ok jsing