openbsd
7 months agoExpand ROTATE macro to crypto_rol_u32().
jsing [Thu, 28 Mar 2024 07:13:02 +0000 (07:13 +0000)]
Expand ROTATE macro to crypto_rol_u32().

7 months agoDemacro sha1.
jsing [Thu, 28 Mar 2024 07:06:12 +0000 (07:06 +0000)]
Demacro sha1.

Replace macros with static inline functions and use names that follow
the spec more closely. Unlike SHA256/SHA512, the functions and constants do
not align with the number of words loaded, which means we cannot easily loop
and just end up just unrolling everything.

ok joshua@ tb@

7 months agoInline initial hash values.
jsing [Thu, 28 Mar 2024 07:04:21 +0000 (07:04 +0000)]
Inline initial hash values.

7 months agoClean up various defines and prototypes.
jsing [Thu, 28 Mar 2024 07:03:25 +0000 (07:03 +0000)]
Clean up various defines and prototypes.

No assembly implementations remain, hence we can clean the mess up and
replace it with a single static void function.

7 months agoUse TLS_ERROR_INVALID_ARGUMENT for "too large" and "too small" errors
joshua [Thu, 28 Mar 2024 06:55:02 +0000 (06:55 +0000)]
Use TLS_ERROR_INVALID_ARGUMENT for "too large" and "too small" errors

ok beck tb

7 months agoNuke more gost
beck [Thu, 28 Mar 2024 06:48:25 +0000 (06:48 +0000)]
Nuke more gost

7 months agoNuke more leftover GOST tendrils.
beck [Thu, 28 Mar 2024 06:45:36 +0000 (06:45 +0000)]
Nuke more leftover GOST tendrils.

ok tb@

7 months agounstub guc functions
jsg [Thu, 28 Mar 2024 05:41:40 +0000 (05:41 +0000)]
unstub guc functions

7 months agoadd more iosys_map interfaces used by inteldrm guc code
jsg [Thu, 28 Mar 2024 05:38:36 +0000 (05:38 +0000)]
add more iosys_map interfaces used by inteldrm guc code
based in part on FreeBSD changes

7 months agoTidy includes.
jsing [Thu, 28 Mar 2024 05:21:20 +0000 (05:21 +0000)]
Tidy includes.

7 months agoExpand HASH_* defines.
jsing [Thu, 28 Mar 2024 05:16:11 +0000 (05:16 +0000)]
Expand HASH_* defines.

No change to generated assembly.

7 months agoReorder functions.
jsing [Thu, 28 Mar 2024 05:00:27 +0000 (05:00 +0000)]
Reorder functions.

No functional change.

7 months agoInline functions from md32_common.h for ripemd.
jsing [Thu, 28 Mar 2024 04:56:47 +0000 (04:56 +0000)]
Inline functions from md32_common.h for ripemd.

No change to generated assembly.

7 months agoFix line wrapping.
jsing [Thu, 28 Mar 2024 04:23:02 +0000 (04:23 +0000)]
Fix line wrapping.

7 months agoreduce diff to linux
jsg [Thu, 28 Mar 2024 02:36:38 +0000 (02:36 +0000)]
reduce diff to linux

7 months agosync
deraadt [Thu, 28 Mar 2024 02:27:14 +0000 (02:27 +0000)]
sync

7 months agosys
deraadt [Thu, 28 Mar 2024 02:23:31 +0000 (02:23 +0000)]
sys

7 months agoDelete pinsyscall(2) [which was specific only to SYS_execve] now
deraadt [Thu, 28 Mar 2024 02:19:57 +0000 (02:19 +0000)]
Delete pinsyscall(2) [which was specific only to SYS_execve] now
that it has been replaced with pinsyscalls(2) [which tells the kernel
the location of all system calls in libc.so]
floated to various people before release, but it was prudent to wait.

7 months agoRemove fallback files that are now always included in the build.
jsing [Thu, 28 Mar 2024 02:09:28 +0000 (02:09 +0000)]
Remove fallback files that are now always included in the build.

7 months agoUse TLS_ERROR_OUT_OF_MEMORY error code for calloc errors in libtls
joshua [Thu, 28 Mar 2024 02:08:24 +0000 (02:08 +0000)]
Use TLS_ERROR_OUT_OF_MEMORY error code for calloc errors in libtls

ok jsing

7 months agoMove rc4.c to primary Makefile.
jsing [Thu, 28 Mar 2024 01:57:00 +0000 (01:57 +0000)]
Move rc4.c to primary Makefile.

This is now built on all platforms.

7 months agoUse C functions for RC4 public API.
jsing [Thu, 28 Mar 2024 01:49:29 +0000 (01:49 +0000)]
Use C functions for RC4 public API.

Rather than having public API switch between C and assembly, always
use C functions as entry points, which then call an assembly
implementation (if available). This makes it significantly easier
to deal with symbol aliasing/namespaces and it also means we
benefit from vulnerability prevention provided by the C compiler.

Rename the assembly generated functions from RC4() to rc4_internal()
and RC4_set_key() to rc4_set_key_internal(). Always include rc4.c
and change it to use defines that are similar to those used in BN.

ok beck@ joshua@ tb@

7 months agoFix coverity complaints.
beck [Thu, 28 Mar 2024 01:45:18 +0000 (01:45 +0000)]
Fix coverity complaints.

7 months agoCheck the return value of EVP_CIPHER_CTX_reset()
tb [Thu, 28 Mar 2024 01:42:02 +0000 (01:42 +0000)]
Check the return value of EVP_CIPHER_CTX_reset()

The function call can't actually fail, but all other calls check its
return value.

ok joshua jsing

7 months agoMove des sources to primary Makefile.
jsing [Thu, 28 Mar 2024 01:41:16 +0000 (01:41 +0000)]
Move des sources to primary Makefile.

Now that all platforms use a C des implementation, move it to the primary
Makefile.

7 months agoRemove now unused des assembly.
jsing [Thu, 28 Mar 2024 01:35:21 +0000 (01:35 +0000)]
Remove now unused des assembly.

7 months agoStop building the assembly implementation of des on sparc64.
jsing [Thu, 28 Mar 2024 01:34:04 +0000 (01:34 +0000)]
Stop building the assembly implementation of des on sparc64.

This one was hiding behind an m4 script.

Build tested by tb@

7 months agoRemove now unused ripemd i386 assembly.
jsing [Thu, 28 Mar 2024 01:28:49 +0000 (01:28 +0000)]
Remove now unused ripemd i386 assembly.

7 months agoStop building the assembly implementation of des and ripemd on i386.
jsing [Thu, 28 Mar 2024 01:14:31 +0000 (01:14 +0000)]
Stop building the assembly implementation of des and ripemd on i386.

This is the only architecture that has an assembly implementation for these
algorithms. There is little to gain from accelerating legacy algorithms on
a legacy architecture.

Discussed with beck@ and tb@

7 months agoConsolidate most of the AES modes into a single C file.
jsing [Thu, 28 Mar 2024 00:57:26 +0000 (00:57 +0000)]
Consolidate most of the AES modes into a single C file.

Discussed with tb@

7 months agoPKCS#1.5 PBE: test and assign
tb [Thu, 28 Mar 2024 00:44:26 +0000 (00:44 +0000)]
PKCS#1.5 PBE: test and assign

7 months agoStop pandering to the loadbalancer industrial complex.
beck [Thu, 28 Mar 2024 00:22:35 +0000 (00:22 +0000)]
Stop pandering to the loadbalancer industrial complex.

So we initially kept this hack around for f5 boxes that
should have been patched in 2014, and were not as of 2017.

The f5 article for the bug archived on their web site,
and any of these devices on the public internet will have
since been upgraded to deal with a host of record layer, TLS,
and other bugs, or they likely won't be talking to modern
stacks, since as of this point the software with the bug
would not have been updated in 10 years.

So just make this spec compliant and reject a supported groups
extension that should not have been sent by a server.

ok tb@ jsing@

7 months agofix leaks in the horrible ssl whackery necessary for this test.
beck [Wed, 27 Mar 2024 23:56:34 +0000 (23:56 +0000)]
fix leaks in the horrible ssl whackery necessary for this test.

ok tb@

7 months agoThe RISC-V architecture specification says that memory read/writes are
kettenis [Wed, 27 Mar 2024 23:10:18 +0000 (23:10 +0000)]
The RISC-V architecture specification says that memory read/writes are
not ordered with respect to mmio read/writes.  This appears to happen on
T-Head C920 cores as I'm seeing interrupts being enabled before the lock
is released in mtx_leave() despite program order releasing the lock
before enabling interrupts.  This is fixed by adding the necessary fences
in more or less the same places where Linux uses them.

ok patrick@, jca@

7 months agoFix fdt_find_node(). We should make sure we match the full name when
kettenis [Wed, 27 Mar 2024 23:05:27 +0000 (23:05 +0000)]
Fix fdt_find_node().  We should make sure we match the full name when
matching path components (but we do allow matches with the @unit bit).

This fixes a problem on the Milk-V Pioneer where /soc/serial@123456
accidentally match a /socket0-clocks node and we would fail to find the
serial console.

ok miod@

7 months agoIntroduce SB_OWNLOCK to mark sockets which `so_rcv' buffer modified
mvs [Wed, 27 Mar 2024 22:47:53 +0000 (22:47 +0000)]
Introduce SB_OWNLOCK to mark sockets which `so_rcv' buffer modified
outside socket lock.

`sb_mtx' mutex(9) used for this case and it should not be released between
`so_rcv' usage check and corresponding sbwait() sleep. Otherwise wakeup()
could be lost sometimes.

ok bluhm

7 months agoFix up server processing of key shares.
beck [Wed, 27 Mar 2024 22:27:09 +0000 (22:27 +0000)]
Fix up server processing of key shares.

Ensure that the client can not provide a duplicate key share
for any group, or send more key shares than groups they support.

Ensure that the key shares must be provided in the same order
as the client preference order specified in supported_groups.

Ensure we only will choose to use a key share that is for the
most preferred group by the client that we also support,
to avoid the client being downgraded by sending a less preferred
key share. If we do not end up with a key share for the most preferred
mutually supported group, will then do a hello retry request
selecting that group.

Add regress for this to regress/tlsext/tlsexttest.c

ok jsing@

7 months agoWhen the syscall number has to be loaded from a pc-relative location,
miod [Wed, 27 Mar 2024 20:03:29 +0000 (20:03 +0000)]
When the syscall number has to be loaded from a pc-relative location,
abuse END macros to place the number at the end of the syscall wrapper
rather than in the middle of it, so that there is no need to branch
around it; this saves two instructions per syscall number >= 128.

While there, also tweak the error return (SET_ERRNO_AND_RETURN) to only
return a 64-bit value for lseek; this saves another instruction for
all other syscalls.

With input from guenther@; "Anything that makes the machine faster" deraadt@

7 months agoInitialize uvm_km_pages.mtx before use.
kurt [Wed, 27 Mar 2024 15:41:40 +0000 (15:41 +0000)]
Initialize uvm_km_pages.mtx before use.
okay mpi@ miod@

7 months agoInitialize pmap_tramp.pm_mtx before use.
kurt [Wed, 27 Mar 2024 15:40:50 +0000 (15:40 +0000)]
Initialize pmap_tramp.pm_mtx before use.
okay mpi@ miod@

7 months agoSupport having bcmpcie(4) as both PCIe bus and simplebus to enable
patrick [Wed, 27 Mar 2024 15:15:00 +0000 (15:15 +0000)]
Support having bcmpcie(4) as both PCIe bus and simplebus to enable
use of the Raspberry Pi 5's RP1 I/O controller, which is connected
over PCIe.  With this, the peripherals on the RP1 are enumerated and
attached as well.

ok kettenis@

7 months agoprinttime: use the Unix epoch if the file's timestamp is invalid
millert [Wed, 27 Mar 2024 14:44:52 +0000 (14:44 +0000)]
printtime: use the Unix epoch if the file's timestamp is invalid
Fixes a crash in "ls -l" for files with bogus timestamp values.
OK miod@ denis@

7 months agoRemove unused rc4 parisc assembly.
jsing [Wed, 27 Mar 2024 12:59:12 +0000 (12:59 +0000)]
Remove unused rc4 parisc assembly.

This is already disabled since it is "about 35% slower than C code".

7 months agoCatch the blowfish that escaped.
jsing [Wed, 27 Mar 2024 12:56:25 +0000 (12:56 +0000)]
Catch the blowfish that escaped.

7 months agoConsolidate rc4 code.
jsing [Wed, 27 Mar 2024 12:54:42 +0000 (12:54 +0000)]
Consolidate rc4 code.

Discussed with tb@

7 months agoRemove assembly for stitched modes.
jsing [Wed, 27 Mar 2024 12:42:30 +0000 (12:42 +0000)]
Remove assembly for stitched modes.

The stitched modes have been removed, so having assembly for them is of
little use.

7 months agoRemove empty rc4_local.h include.
jsing [Wed, 27 Mar 2024 12:14:35 +0000 (12:14 +0000)]
Remove empty rc4_local.h include.

Discussed with tb@

7 months agoRemove private_RC4_set_key() from the public rc4.h header.
jsing [Wed, 27 Mar 2024 12:13:08 +0000 (12:13 +0000)]
Remove private_RC4_set_key() from the public rc4.h header.

This does not exist in libcrypto.

7 months agoUnifdef BF_PTR2.
jsing [Wed, 27 Mar 2024 11:54:29 +0000 (11:54 +0000)]
Unifdef BF_PTR2.

This removes the unused Intel special version of BF_ENC().

ok tb@

7 months agoRemove unused c2l/c2ln/l2c/l2cn macros.
jsing [Wed, 27 Mar 2024 11:44:39 +0000 (11:44 +0000)]
Remove unused c2l/c2ln/l2c/l2cn macros.

7 months agoConsolidate blowfish code.
jsing [Wed, 27 Mar 2024 11:24:15 +0000 (11:24 +0000)]
Consolidate blowfish code.

Requested by tb@

7 months agoReplace GETU32 and PUTU32.
jsing [Wed, 27 Mar 2024 11:15:44 +0000 (11:15 +0000)]
Replace GETU32 and PUTU32.

Replace GETU32 with crypto_load_be32toh() and PUTU32 with
crypto_store_htobe32(). Make the offset handling cleaner at the
same time.

ok beck@ joshua@ tb@

7 months agoRemove now unused files.
jsing [Wed, 27 Mar 2024 11:12:46 +0000 (11:12 +0000)]
Remove now unused files.

7 months agoMove bf_enc.c to the primary Makefile.
jsing [Wed, 27 Mar 2024 11:12:08 +0000 (11:12 +0000)]
Move bf_enc.c to the primary Makefile.

Now that all architectures are using bf_enc.c, it does not make sense to
have it in every Makefile.inc file.

7 months agoStop building the assembly implementation of blowfish on i386.
jsing [Wed, 27 Mar 2024 10:59:48 +0000 (10:59 +0000)]
Stop building the assembly implementation of blowfish on i386.

This is the only architecture that has an assembly implementation. There is
little to gain from accelerating a legacy algorithm on a legacy
architecture.

ok beck@ tb@

7 months agoDo not allow duplicate groups in supported groups.
beck [Wed, 27 Mar 2024 10:44:17 +0000 (10:44 +0000)]
Do not allow duplicate groups in supported groups.

While we are here refactor this to single return.

ok jsing@ tb@

7 months agozlib: sync with base
tb [Wed, 27 Mar 2024 10:21:36 +0000 (10:21 +0000)]
zlib: sync with base

7 months agozlib: sync with upstream
tb [Wed, 27 Mar 2024 10:21:11 +0000 (10:21 +0000)]
zlib: sync with upstream

The change in zconf.h only affects mingw;
The change in inflate.h updates a comment

7 months agoRemove near duplicate AES_set_{encrypt,decrypt}_key() functions.
jsing [Wed, 27 Mar 2024 08:24:13 +0000 (08:24 +0000)]
Remove near duplicate AES_set_{encrypt,decrypt}_key() functions.

There are currently three ways in which AES is implemented - all in
assembly (amd64 et al), all in C (aarch64 et al) and, half in C and
half in assembly (hppa and sparc64). The last of these cases currently
makes use of a near duplicate AES_set_{encrypt,decrypt}_key()
implementation that avoids using the AES tables.

Remove the near duplicate version and if only a half assembly version is
implemented, use the same C version of AES_set_{encrypt,decrypt}_key() as
everyone else. This adds around 8KB of rodata to libcrypto on these two
platforms.

Discussed with beck and tb.

7 months agoExplain the weird copy dance in EVP_DigestSignFinal()
tb [Wed, 27 Mar 2024 07:36:59 +0000 (07:36 +0000)]
Explain the weird copy dance in EVP_DigestSignFinal()

with jsing

7 months agoAdd TLS_ERROR_INVALID_ARGUMENT error code to libtls
joshua [Wed, 27 Mar 2024 07:35:30 +0000 (07:35 +0000)]
Add TLS_ERROR_INVALID_ARGUMENT error code to libtls

This is an initial pass, defining the error code and using it for
"too long"/length-related errors.

ok beck jsing

7 months agoFix whitespace
tb [Wed, 27 Mar 2024 06:53:15 +0000 (06:53 +0000)]
Fix whitespace

7 months agoUse crypto_rol_u32() instead of an undefined ROTATE macro.
jsing [Wed, 27 Mar 2024 06:51:59 +0000 (06:51 +0000)]
Use crypto_rol_u32() instead of an undefined ROTATE macro.

ok tb@

7 months agoUnify up_ref implementations in libssl
tb [Wed, 27 Mar 2024 06:47:52 +0000 (06:47 +0000)]
Unify up_ref implementations in libssl

ok jsing

7 months agoRemove unused NDEBUG define.
jsing [Wed, 27 Mar 2024 06:39:46 +0000 (06:39 +0000)]
Remove unused NDEBUG define.

7 months agoTidy includes and a comment.
jsing [Wed, 27 Mar 2024 06:38:54 +0000 (06:38 +0000)]
Tidy includes and a comment.

7 months agoRemove rather scary unused experimental code.
jsing [Wed, 27 Mar 2024 06:37:28 +0000 (06:37 +0000)]
Remove rather scary unused experimental code.

ok tb@

7 months agoClean up use of EVP_MD_CTX_{legacy_clear,cleanup} in
joshua [Wed, 27 Mar 2024 06:33:51 +0000 (06:33 +0000)]
Clean up use of EVP_MD_CTX_{legacy_clear,cleanup} in
EVP_DigestSignFinal

Additionally, this cleans up some more surrounding code.
This is a fixed version of r1.21.

ok tb

7 months agoDemacro md4.
jsing [Wed, 27 Mar 2024 06:15:18 +0000 (06:15 +0000)]
Demacro md4.

Use static inline functions instead of macros. Also number rounds as per
the RFC.

ok joshua@ tb@

7 months agoHide symbols in engine
tb [Wed, 27 Mar 2024 06:08:45 +0000 (06:08 +0000)]
Hide symbols in engine

ok jsing

7 months agodrm: Fix drm_fixp2int_round() making it add 0.5
jsg [Wed, 27 Mar 2024 04:58:34 +0000 (04:58 +0000)]
drm: Fix drm_fixp2int_round() making it add 0.5

From Arthur Grillo
296e6678a432aaff0b8c6a6a17b9b2b193556c71 in linux-6.6.y/6.6.23
807f96abdf14c80f534c78f2d854c2590963345c in mainline linux

7 months agodrm/amd/pm: Fix esm reg mask use to get pcie speed
jsg [Wed, 27 Mar 2024 04:55:35 +0000 (04:55 +0000)]
drm/amd/pm: Fix esm reg mask use to get pcie speed

From Asad Kamal
310ae9eb3d2a13345f2590e7581fd45d97323a02 in linux-6.6.y/6.6.23
b485b899e5b8f83723833feca30a1a1e3df778df in mainline linux

7 months agodrm/amdgpu: Fix missing break in ATOM_ARG_IMM Case of atom_get_src_int()
jsg [Wed, 27 Mar 2024 04:52:45 +0000 (04:52 +0000)]
drm/amdgpu: Fix missing break in ATOM_ARG_IMM Case of atom_get_src_int()

From Srinivasan Shanmugam
bf13e50a4b760a0155d4cce869dac8480c5ae839 in linux-6.6.y/6.6.23
7cf1ad2fe10634238b38442a851d89514cb14ea2 in mainline linux

7 months agodrm/amd/display: Add 'replay' NULL check in 'edp_set_replay_allow_active()'
jsg [Wed, 27 Mar 2024 04:50:30 +0000 (04:50 +0000)]
drm/amd/display: Add 'replay' NULL check in 'edp_set_replay_allow_active()'

From Srinivasan Shanmugam
f610c46771ef1047e46d61807aa7c69cd29e63d8 in linux-6.6.y/6.6.23
f6aed043ee5d75b3d1bfc452b1a9584b63c8f76b in mainline linux

7 months agodrm/amd/display: fix NULL checks for adev->dm.dc in amdgpu_dm_fini()
jsg [Wed, 27 Mar 2024 04:48:35 +0000 (04:48 +0000)]
drm/amd/display: fix NULL checks for adev->dm.dc in amdgpu_dm_fini()

From Nikita Zhandarovich
e040f1fbe9abae91b12b074cfc3bbb5367b79811 in linux-6.6.y/6.6.23
2a3cfb9a24a28da9cc13d2c525a76548865e182c in mainline linux

7 months agodrm/radeon/ni: Fix wrong firmware size logging in ni_init_microcode()
jsg [Wed, 27 Mar 2024 04:44:37 +0000 (04:44 +0000)]
drm/radeon/ni: Fix wrong firmware size logging in ni_init_microcode()

From Nikita Zhandarovich
6fc5fb8ebef803285a8f71e298e8a658d836a492 in linux-6.6.y/6.6.23
c4891d979c7668b195a0a75787967ec95a24ecef in mainline linux

7 months agodrm/amdgpu: Fix potential out-of-bounds access in 'amdgpu_discovery_reg_base_init()'
jsg [Wed, 27 Mar 2024 04:42:17 +0000 (04:42 +0000)]
drm/amdgpu: Fix potential out-of-bounds access in 'amdgpu_discovery_reg_base_init()'

From Srinivasan Shanmugam
8f3e68c6a3fff53c2240762a47a0045d89371775 in linux-6.6.y/6.6.23
cdb637d339572398821204a1142d8d615668f1e9 in mainline linux

7 months agodrm/amd/display: Fix potential NULL pointer dereferences in 'dcn10_set_output_transfe...
jsg [Wed, 27 Mar 2024 04:40:04 +0000 (04:40 +0000)]
drm/amd/display: Fix potential NULL pointer dereferences in 'dcn10_set_output_transfer_func()'

From Srinivasan Shanmugam
2d9fe7787af01188dc470a649bdbb842d6511fd7 in linux-6.6.y/6.6.23
9ccfe80d022df7c595f1925afb31de2232900656 in mainline linux

7 months agodrm/amd/display: Fix a potential buffer overflow in 'dp_dsc_clock_en_read()'
jsg [Wed, 27 Mar 2024 04:37:32 +0000 (04:37 +0000)]
drm/amd/display: Fix a potential buffer overflow in 'dp_dsc_clock_en_read()'

From Srinivasan Shanmugam
ad76fd30557d6a106c481e4606a981221ca525f7 in linux-6.6.y/6.6.23
4b09715f1504f1b6e8dff0e9643630610bc05141 in mainline linux

7 months agodrm: Don't treat 0 as -1 in drm_fixp2int_ceil
jsg [Wed, 27 Mar 2024 04:32:19 +0000 (04:32 +0000)]
drm: Don't treat 0 as -1 in drm_fixp2int_ceil

From Harry Wentland
bac3d37d2f7cab3d9c42a7c9775c84aee4fa89d9 in linux-6.6.y/6.6.23
cf8837d7204481026335461629b84ac7f4538fa5 in mainline linux

7 months agodrm/amdgpu: Enable gpu reset for S3 abort cases on Raven series
jsg [Wed, 27 Mar 2024 04:27:17 +0000 (04:27 +0000)]
drm/amdgpu: Enable gpu reset for S3 abort cases on Raven series

From Prike Liang
b5f085b46f0e9482f5035f798b402d1ad7ee8e3c in linux-6.6.y/6.6.23
c671ec01311b4744b377f98b0b4c6d033fe569b3 in mainline linux

7 months agoRecommit r1.20
joshua [Wed, 27 Mar 2024 04:18:50 +0000 (04:18 +0000)]
Recommit r1.20

ok tb jsing

7 months agoRevert to r1.19 while we track down a bug in the last two commits.
jsing [Wed, 27 Mar 2024 03:05:59 +0000 (03:05 +0000)]
Revert to r1.19 while we track down a bug in the last two commits.

7 months agoClean up use of EVP_MD_CTX_{legacy_clear,cleanup} in
joshua [Wed, 27 Mar 2024 01:55:40 +0000 (01:55 +0000)]
Clean up use of EVP_MD_CTX_{legacy_clear,cleanup} in
EVP_DigestSignFinal

Additionally, this cleans up some more surrounding code.

ok tB

7 months agoUse dsa for DSA and dh for DH
tb [Wed, 27 Mar 2024 01:49:31 +0000 (01:49 +0000)]
Use dsa for DSA and dh for DH

This unifies variable names and does some other cleanup. Only change in
generated assembly is line number changes.

7 months agoUse dh for DH function arguments.
tb [Wed, 27 Mar 2024 01:26:30 +0000 (01:26 +0000)]
Use dh for DH function arguments.

No need for a variety of r, d, ...

7 months agoUnify *_up_ref() implementations
tb [Wed, 27 Mar 2024 01:22:30 +0000 (01:22 +0000)]
Unify *_up_ref() implementations

No need for an inconsistently named local variable and a ternary operator.

ok jsing

7 months agoAdditional length check for IPv6 reassembled fragments.
bluhm [Tue, 26 Mar 2024 23:48:49 +0000 (23:48 +0000)]
Additional length check for IPv6 reassembled fragments.

FreeBSD-SA-23:06.ipv6 security advisory has added an additional
overflow check in frag6_input().  OpenBSD is not affected by that
as the bug was introduced by another change in 2019.  The existing
code is complicated and NetBSD has taken the FreeBSD fix, although
they were also not affected.

The additional check makes the complicated code more robust.  Length
calculation taken from NetBSD.  Discussed with FreeBSD.

OK sashan@ mvs@

7 months agoRemove superfluous parentheses in X509_REQ setters
tb [Tue, 26 Mar 2024 23:45:05 +0000 (23:45 +0000)]
Remove superfluous parentheses in X509_REQ setters

No change in generated assembly

7 months agoCosmetics, mostly removal of silly parentheses
tb [Tue, 26 Mar 2024 23:41:45 +0000 (23:41 +0000)]
Cosmetics, mostly removal of silly parentheses

No change in generated assembly

7 months agoDrop superfluous parentheses in X509_set_version()
tb [Tue, 26 Mar 2024 23:21:36 +0000 (23:21 +0000)]
Drop superfluous parentheses in X509_set_version()

7 months agoThe devicetree standard allows for multiple /memory nodes, each with
kettenis [Tue, 26 Mar 2024 22:46:48 +0000 (22:46 +0000)]
The devicetree standard allows for multiple /memory nodes, each with
multiple memory ranges.  We support the latter, but not the former.
Fix this, such that we detect all the memory on the Milk-V Pioneer
board.

ok miod@

7 months agoTweak versions comment for CRLs
tb [Tue, 26 Mar 2024 22:45:38 +0000 (22:45 +0000)]
Tweak versions comment for CRLs

7 months agopiuid and psuid have annoyed me for long enough
tb [Tue, 26 Mar 2024 22:44:57 +0000 (22:44 +0000)]
piuid and psuid have annoyed me for long enough

7 months agox509 trust: remove unneeded headers
tb [Tue, 26 Mar 2024 22:43:42 +0000 (22:43 +0000)]
x509 trust: remove unneeded headers

7 months agoImplement support for the RISC-V UEFI Boot Protocol. This provides us
kettenis [Tue, 26 Mar 2024 22:26:04 +0000 (22:26 +0000)]
Implement support for the RISC-V UEFI Boot Protocol.  This provides us
the boot hart ID for firmware that doesn't provide it through the device
tree such as the EDK2-based firmware for the Sophgo SG2042 SoC.

ok patrick@, miod@

7 months agoadd cfi instructions to repair this test on amd64 and arm64.
miod [Tue, 26 Mar 2024 19:12:34 +0000 (19:12 +0000)]
add cfi instructions to repair this test on amd64 and arm64.
ok kettenis@

7 months agoImprove spinning in mtx_enter().
bluhm [Tue, 26 Mar 2024 18:18:30 +0000 (18:18 +0000)]
Improve spinning in mtx_enter().

Instead of calling mtx_enter_try() in each spinning loop, do it
only if the result of a lockless read indicates that the mutex has
been released.  This avoids some expensive atomic compare-and-swap
operations.  Up to 5% reduction of spinning time during kernel build
can been seen on a 8 core amd64 machine.  On other machines there
was no visible effect.

Test on powerpc64 has revealed a bug in mtx_owner declaration.  Not
the variable was volatile, but the object it points to.  Move the
volatile declaration in struct mutex to avoid a hang when going to
multiuser.

from Mateusz Guzik; input kettenis@ jca@; OK mpi@

7 months agoImplement the chmod a-x bsd.upgrade trick in the sparc64 ofwboot bootloader.
claudio [Tue, 26 Mar 2024 14:46:48 +0000 (14:46 +0000)]
Implement the chmod a-x bsd.upgrade trick in the sparc64 ofwboot bootloader.
OK deraadt@ florian@ kn@

7 months agoRework input and output handling for sha1.
jsing [Tue, 26 Mar 2024 12:54:22 +0000 (12:54 +0000)]
Rework input and output handling for sha1.

Use be32toh(), htobe32() and crypto_{load,store}_htobe32() as appropriate.

Also use the same while() loop that is used for other hash functions.

ok joshua@ tb@