openbsd
14 months agoAdd some regress coverage for various ASN1_STRING types to codify some
tb [Tue, 15 Aug 2023 19:14:42 +0000 (19:14 +0000)]
Add some regress coverage for various ASN1_STRING types to codify some
quirks and invariants.

14 months agoZap extra parens
tb [Tue, 15 Aug 2023 18:05:15 +0000 (18:05 +0000)]
Zap extra parens

14 months agosync
sthen [Tue, 15 Aug 2023 17:52:23 +0000 (17:52 +0000)]
sync

14 months agoFix typo in previous
tb [Tue, 15 Aug 2023 17:40:06 +0000 (17:40 +0000)]
Fix typo in previous

14 months agoAvoid undefined behavior with memcmp(NULL, x, 0) in ASN1_STRING_cmp()
tb [Tue, 15 Aug 2023 17:38:00 +0000 (17:38 +0000)]
Avoid undefined behavior with memcmp(NULL, x, 0) in ASN1_STRING_cmp()

ok jsing miod

14 months agoNo MS-DOS filesystem support on amd64 floppy
jsg [Tue, 15 Aug 2023 14:37:26 +0000 (14:37 +0000)]
No MS-DOS filesystem support on amd64 floppy

14 months agoNo MS-DOS filesystem support on floppy anymore
miod [Tue, 15 Aug 2023 14:27:27 +0000 (14:27 +0000)]
No MS-DOS filesystem support on floppy anymore

14 months agodrop MSDOSFS from i386 floppy
jsg [Tue, 15 Aug 2023 14:24:53 +0000 (14:24 +0000)]
drop MSDOSFS from i386 floppy
sthen mentioned it is out of space. ok deraadt@

14 months agoldd can pledge "stdio rpath proc exec prot_exec". We can later bifurbicate
deraadt [Tue, 15 Aug 2023 13:50:53 +0000 (13:50 +0000)]
ldd can pledge "stdio rpath proc exec prot_exec".  We can later bifurbicate
at the dlopen vs execve split, dropping either "proc" or "prot_exec".
ok gnezdo

14 months agosync
sthen [Tue, 15 Aug 2023 12:37:58 +0000 (12:37 +0000)]
sync

14 months agoFix bug when using gzflush() with a very small buffer.
tb [Tue, 15 Aug 2023 12:18:46 +0000 (12:18 +0000)]
Fix bug when using gzflush() with a very small buffer.

from upstream

14 months agoSHA-3 is not a symmetric cipher.
schwarze [Tue, 15 Aug 2023 11:54:38 +0000 (11:54 +0000)]
SHA-3 is not a symmetric cipher.
Fix a copy and paste mistake that Ronald Tse introduced in 2017 even
though Richard Levitte and Bernd Edlinger reviewed his commit - and that
i unwittingly copied.  Even in the OpenSSL 3 main trunk, it wasn't fixed
until 2022, and in OpenSSL-1.1.1, it is still wrong.
Unfortunately, we need to be really careful before believing anything
the OpenSSL documentation says...

14 months agoImport the EVP_chacha20(3) manual page from the OpenSSL 1.1 branch,
schwarze [Tue, 15 Aug 2023 11:26:49 +0000 (11:26 +0000)]
Import the EVP_chacha20(3) manual page from the OpenSSL 1.1 branch,
which is still under a free license, to work on it in the tree.
The required content changes have not been done yet,
i only tweaked the markup and wording so far.

14 months agoAvoid memcmp() with NULL pointer and 0 length
tb [Tue, 15 Aug 2023 11:20:57 +0000 (11:20 +0000)]
Avoid memcmp() with NULL pointer and 0 length

14 months agoAdd meta bindings for status line menus as well as the existing pane one
nicm [Tue, 15 Aug 2023 09:51:48 +0000 (09:51 +0000)]
Add meta bindings for status line menus as well as the existing pane one
for terminals which steal the mouse menu button.

14 months agoscrub the mbuf flowid for packets going out a sec interface.
dlg [Tue, 15 Aug 2023 09:46:30 +0000 (09:46 +0000)]
scrub the mbuf flowid for packets going out a sec interface.

maybe ipsec should do this for all packets it encapsulates.

tested by hrvoje

14 months agoClean up alignment handling.
jsing [Tue, 15 Aug 2023 08:39:27 +0000 (08:39 +0000)]
Clean up alignment handling.

Instead of using HOST_{c2l,l2c} macros, provide and use
crypto_load_le32toh() and crypto_store_htole32(). In some cases just
use htole32() directly.

ok tb@

14 months agoUse MD5_LONG instead of unsigned int for consistency.
jsing [Tue, 15 Aug 2023 08:35:33 +0000 (08:35 +0000)]
Use MD5_LONG instead of unsigned int for consistency.

ok tb@

14 months agoCondition only on #ifdef MD5_ASM.
jsing [Tue, 15 Aug 2023 08:30:49 +0000 (08:30 +0000)]
Condition only on #ifdef MD5_ASM.

There are a bunch of unnecessary preprocessor directives - just condition
on MD5_ASM, the same as we do elsewhere.

ok tb@

14 months agoReplace a bunch of (1 << 31) with (1U << 31)
miod [Tue, 15 Aug 2023 08:27:29 +0000 (08:27 +0000)]
Replace a bunch of (1 << 31) with (1U << 31)

14 months agofix openssl11 regress compilation
tb [Tue, 15 Aug 2023 08:01:01 +0000 (08:01 +0000)]
fix openssl11 regress compilation

reminded by anton

14 months agoUse the proper ofw node in com_fdt_attach(), likely a cut'n'paste error
miod [Tue, 15 Aug 2023 07:56:27 +0000 (07:56 +0000)]
Use the proper ofw node in com_fdt_attach(), likely a cut'n'paste error
from com_fdt_init_cons().
ok patrick@

14 months agoAdd an option menu-selected-style to configure the currently selected
nicm [Tue, 15 Aug 2023 07:01:47 +0000 (07:01 +0000)]
Add an option menu-selected-style to configure the currently selected
menu item, from Alexis Hildebrandt.

14 months agoImprove handling of dlopen(RTLD_TRACE) aka ldd, of a library that
guenther [Tue, 15 Aug 2023 06:26:34 +0000 (06:26 +0000)]
Improve handling of dlopen(RTLD_TRACE) aka ldd, of a library that
is already loaded:
 * add a 'trace' argument to _dl_show_objects() and exit the
   walk-the-objects loop if you hit that traced object
 * in dlopen(), pass the trace object to _dl_show_objects()
 * also, invoke _dl_show_objects() + exit if the object was
   already opened
 * pass NULL to _dl_show_objects() for all the other calls
 * oh hey, _dl_tracelib is now superfluous: _dl_show_objects()
   should do the walk-the-objects loop only if trace is not NULL.

Problem noted by gnezdo@
ok millert@

14 months agoSkip the _dl_msyscall() invocation if tracing library loading.
guenther [Tue, 15 Aug 2023 06:23:31 +0000 (06:23 +0000)]
Skip the _dl_msyscall() invocation if tracing library loading.

Problem noted by gnezdo@
ok millert@

14 months agomake sure the end result is NULL if malloc failed
jsg [Tue, 15 Aug 2023 03:51:29 +0000 (03:51 +0000)]
make sure the end result is NULL if malloc failed

14 months agosec_start needs to show bpf the packets going out.
dlg [Tue, 15 Aug 2023 02:31:07 +0000 (02:31 +0000)]
sec_start needs to show bpf the packets going out.

from and ok goda@
requested by many

14 months agospacial -> spatial
jsg [Tue, 15 Aug 2023 00:43:00 +0000 (00:43 +0000)]
spacial -> spatial
ok stsp@

14 months agoPrepare tlsfuzzer.py for ports update
tb [Mon, 14 Aug 2023 18:10:42 +0000 (18:10 +0000)]
Prepare tlsfuzzer.py for ports update

14 months agoInline INIT_DATA_* defines.
jsing [Mon, 14 Aug 2023 15:48:16 +0000 (15:48 +0000)]
Inline INIT_DATA_* defines.

ok tb@

14 months agostyle(9)
jsing [Mon, 14 Aug 2023 15:26:01 +0000 (15:26 +0000)]
style(9)

14 months agoBelow SEE ALSO, point to all pages documenting the evp.h sub-library, and
schwarze [Mon, 14 Aug 2023 14:46:40 +0000 (14:46 +0000)]
Below SEE ALSO, point to all pages documenting the evp.h sub-library, and
also point to a selection of functions from other sub-libraries that rely
on evp.h objects, in particular on EVP_CIPHER, EVP_MD, and EVP_PKEY.

While here, merge a few trivial improvements to orthography and
punctuation from the OpenSSL 1.1 branch.

14 months agoimport EVP_sha3_224(3) from the OpenSSL 1.1 branch, which is still under
schwarze [Mon, 14 Aug 2023 14:22:32 +0000 (14:22 +0000)]
import EVP_sha3_224(3) from the OpenSSL 1.1 branch, which is still under
a free license, tweaked by me

14 months agoSkip leading dash in kernel boot options instead of complaining it is an
miod [Mon, 14 Aug 2023 13:49:42 +0000 (13:49 +0000)]
Skip leading dash in kernel boot options instead of complaining it is an
unknown option character.

14 months agounreferneced -> unreferenced
miod [Mon, 14 Aug 2023 12:03:12 +0000 (12:03 +0000)]
unreferneced -> unreferenced

14 months agoImprove error message when if_indextoname() fails.
tobhe [Mon, 14 Aug 2023 12:02:02 +0000 (12:02 +0000)]
Improve error message when if_indextoname() fails.

14 months agoAdd explicit NULL checks for sa_cp_addr and sa_cp_addr6.
tobhe [Mon, 14 Aug 2023 11:55:03 +0000 (11:55 +0000)]
Add explicit NULL checks for sa_cp_addr and sa_cp_addr6.

14 months agoSync expected failures with reality. Recent libm changes caused
anton [Mon, 14 Aug 2023 09:26:37 +0000 (09:26 +0000)]
Sync expected failures with reality. Recent libm changes caused
nearbyint_test.c to pass on amd64.

ok miod@

14 months agozap useless MAN bits
kn [Mon, 14 Aug 2023 08:56:20 +0000 (08:56 +0000)]
zap useless MAN bits

distrib/special/Makefile.inc sets MAN= NOMAN=1, thus setting MAN* in
distrib/special/*/Makefile is useless;  no manuals in the installer.

disklabel(8) and fdisk(8) remain exceptions with their NOMAN handling
as they embed their manual for use with interactive commands.

OK miod

14 months agoExtend scheduler tracepoints to follow CPU jumping.
mpi [Mon, 14 Aug 2023 08:33:24 +0000 (08:33 +0000)]
Extend scheduler tracepoints to follow CPU jumping.

- Add two new tracpoints sched:fork & sched:steal
- Include selected CPU number in sched:wakeup
- Add sched:unsleep corresponding to sched:sleep which matches add/removal
of threads on the sleep queue

ok claudio@

14 months agoCheck SignedData and SignerInfo versions to be 3
tb [Mon, 14 Aug 2023 08:25:26 +0000 (08:25 +0000)]
Check SignedData and SignerInfo versions to be 3

This adds two missing checks required by RFC 6488, section 3.

ok job

14 months agoMore files need to be removed by make clean.
miod [Mon, 14 Aug 2023 08:16:26 +0000 (08:16 +0000)]
More files need to be removed by make clean.

14 months agonetcat: avoid issuing syscalls on fd -1
tb [Mon, 14 Aug 2023 08:07:27 +0000 (08:07 +0000)]
netcat: avoid issuing syscalls on fd -1

In case a socket error condition occurs, readwrite() invalidates the
corresponding fd. Later on, readwrite() may still issue a syscall on
it. Avoid that by adding a couple of checks for fd == -1.

Reported and fix suggested by Leah Neukirchen.
Fixes https://github.com/libressl/openbsd/issues/143

"looks right" deraadt

14 months agoRemove non-MULTIPROCESSOR chunk defining copyin32 as copyin now that all
miod [Mon, 14 Aug 2023 07:42:34 +0000 (07:42 +0000)]
Remove non-MULTIPROCESSOR chunk defining copyin32 as copyin now that all
platforms provide it.

14 months agoAdd a copyin32() implementation.
miod [Mon, 14 Aug 2023 07:40:08 +0000 (07:40 +0000)]
Add a copyin32() implementation.

14 months agoadd message number of SSH2_MSG_NEWCOMPRESS defined in RFC8308
djm [Mon, 14 Aug 2023 03:37:00 +0000 (03:37 +0000)]
add message number of SSH2_MSG_NEWCOMPRESS defined in RFC8308

14 months agoThe 8042 emulation found on Chromebooks does not support the RESET command,
miod [Sun, 13 Aug 2023 21:54:02 +0000 (21:54 +0000)]
The 8042 emulation found on Chromebooks does not support the RESET command,
for no good reason, and causes pckbc not to attach. However, sending a `get
keyboard id' works, so this can be used as a second check to give those
fawlty pieces of hardware a chance to work.

Based on a diff submitted by, and tested by,  Vladimir 'phcoder' Serbinenko.

14 months agoIgnore failure when deleting regress/ttest anchor
sashan [Sun, 13 Aug 2023 21:21:53 +0000 (21:21 +0000)]
Ignore failure when deleting regress/ttest anchor
in 'stamp-setup' target. Found by anton@.

14 months agoremove by now unused test.sh script
anton [Sun, 13 Aug 2023 18:36:20 +0000 (18:36 +0000)]
remove by now unused test.sh script

14 months agoUse a dedicated regress target for each test case.
anton [Sun, 13 Aug 2023 18:34:49 +0000 (18:34 +0000)]
Use a dedicated regress target for each test case.

ok gnezdo@

14 months agoFix P_WSLEEP handling when continuing SSTOP-ed processes
claudio [Sun, 13 Aug 2023 15:53:31 +0000 (15:53 +0000)]
Fix P_WSLEEP handling when continuing SSTOP-ed processes

When continuing a process on the sleep queue just let it switch to
p_stat = SSLEEP even when P_WSLEEP is set. Once a proc is SSTOP-ed
in sleep_finish() a valid sleep point has been reached and there is
no need to make the process runnable again (which results in some
hairy race conditions). Instead simply clear P_WSLEEP since a stopped
proc reached the sleep state and there is no race with wakeup() anymore.

OK mpi@

14 months agobtrace(8): fix yacc reduce conflicts and undefined symbol warnings.
dv [Sun, 13 Aug 2023 13:19:23 +0000 (13:19 +0000)]
btrace(8): fix yacc reduce conflicts and undefined symbol warnings.

Define the STR symbol, used for the str function.

Tune the grammar, simplifying the 'pat' rule to 'expr'. Resolves
the reduce conflicts related to 'pat' and 'factor' both matching a
lone CSTRING token.

ok mpi@

14 months agosync with userland
tb [Sun, 13 Aug 2023 12:25:36 +0000 (12:25 +0000)]
sync with userland

14 months agoConditionally disable MSAN
tb [Sun, 13 Aug 2023 12:25:12 +0000 (12:25 +0000)]
Conditionally disable MSAN

from upstream

14 months agofix whitespace
tb [Sun, 13 Aug 2023 12:09:14 +0000 (12:09 +0000)]
fix whitespace

14 months agoRevert "drm/i915: Disable DC states for all commits"
jsg [Sun, 13 Aug 2023 10:40:45 +0000 (10:40 +0000)]
Revert "drm/i915: Disable DC states for all commits"

From Greg Kroah-Hartman
673cdde74fd13fff0acc4c6c41f5f949434156a5 in linux-6.1.y/6.1.45

14 months agodrm/amdgpu: Use apt name for FW reserved region
jsg [Sun, 13 Aug 2023 10:36:26 +0000 (10:36 +0000)]
drm/amdgpu: Use apt name for FW reserved region

From Lijo Lazar
af7215182417c892e09bcb6829377ce5c69f127f in linux-6.1.y/6.1.45
db3b5cb64a9ca301d14ed027e470834316720e42 in mainline linux

14 months agodrm/amdgpu: Remove unnecessary domain argument
jsg [Sun, 13 Aug 2023 10:33:48 +0000 (10:33 +0000)]
drm/amdgpu: Remove unnecessary domain argument

From Luben Tuikov
3d0a34c42f0d50c06ca21761d625a823e245118e in linux-6.1.y/6.1.45
3273f11675ef11959d25a56df3279f712bcd41b7 in mainline linux

14 months agodrm/amdgpu: add vram reservation based on vram_usagebyfirmware_v2_2
jsg [Sun, 13 Aug 2023 10:30:28 +0000 (10:30 +0000)]
drm/amdgpu: add vram reservation based on vram_usagebyfirmware_v2_2

From Tong Liu01
526defeec474ea8002b8312b9c88f96fa1f85a48 in linux-6.1.y/6.1.45
4864f2ee9ee2acf4a1009b58fbc62f17fa086d4e in mainline linux

14 months agodrm/amd/display: skip CLEAR_PAYLOAD_ID_TABLE if device mst_en is 0
jsg [Sun, 13 Aug 2023 10:27:32 +0000 (10:27 +0000)]
drm/amd/display: skip CLEAR_PAYLOAD_ID_TABLE if device mst_en is 0

From Peichen Huang
56562676102e135e7aebada26c2aea146a5b5ad0 in linux-6.1.y/6.1.45
a1c9a1e27022d13c70a14c4faeab6ce293ad043b in mainline linux

14 months agodrm/amd/display: Ensure that planes are in the same order
jsg [Sun, 13 Aug 2023 10:25:34 +0000 (10:25 +0000)]
drm/amd/display: Ensure that planes are in the same order

From Rodrigo Siqueira
63eeb50fa11009cc4c82919b040c361c4ea0f14e in linux-6.1.y/6.1.45
bb46a6a9bab134b9d15043ea8fa9d6c276e938b8 in mainline linux

14 months agodrm/i915/gt: Cleanup aux invalidation registers
jsg [Sun, 13 Aug 2023 10:23:58 +0000 (10:23 +0000)]
drm/i915/gt: Cleanup aux invalidation registers

From Andi Shyti
37f6073f7db329c9db4357f82e565958fb64ea16 in linux-6.1.y/6.1.45
d14560ac1b595aa2e792365e91fea6aeaee66c2b in mainline linux

14 months agosimplify previous;
jmc [Sun, 13 Aug 2023 10:23:26 +0000 (10:23 +0000)]
simplify previous;

14 months agodrm/i915: Fix premature release of request's reusable memory
jsg [Sun, 13 Aug 2023 10:22:20 +0000 (10:22 +0000)]
drm/i915: Fix premature release of request's reusable memory

From Janusz Krzysztofik
4db8b39418a685179263b7ad895a3182d72be358 in linux-6.1.y/6.1.45
a337b64f0d5717248a0c894e2618e658e6a9de9f in mainline linux

14 months agodrm/ttm: check null pointer before accessing when swapping
jsg [Sun, 13 Aug 2023 10:20:31 +0000 (10:20 +0000)]
drm/ttm: check null pointer before accessing when swapping

From Guchun Chen
1fdd16d89c01336d9a942b5f03673c17d401da87 in linux-6.1.y/6.1.45
2dedcf414bb01b8d966eb445db1d181d92304fb2 in mainline linux

14 months agoAdd support for storing builtin TID and PID in variables.
mpi [Sun, 13 Aug 2023 09:52:47 +0000 (09:52 +0000)]
Add support for storing builtin TID and PID in variables.

14 months agoRegression test for the use-after-free in map insertion
mpi [Sun, 13 Aug 2023 09:49:47 +0000 (09:49 +0000)]
Regression test for the use-after-free in map insertion

14 months agoPrevent user-after/double free in map insertion.
mpi [Sun, 13 Aug 2023 09:48:27 +0000 (09:48 +0000)]
Prevent user-after/double free in map insertion.

Freeing arguments tied to statements is not an option because rules are
parsed multiple times.  Always make a copy of them if they are assigned
to a key in a map.

14 months agokevent: Add precision and abstimer flags for EVFILT_TIMER
visa [Sun, 13 Aug 2023 08:29:28 +0000 (08:29 +0000)]
kevent: Add precision and abstimer flags for EVFILT_TIMER

Add timer precision flags NOTE_SECONDS, NOTE_MSECONDS, NOTE_USECONDS
and NOTE_NSECONDS for EVFILT_TIMER. Also, add an initial implementation
of NOTE_ABSTIME timers.

Similar kevent(2) flags exist on FreeBSD, NetBSD and XNU.

Initial diff by and OK aisha@
OK mpi@

14 months agoAdd modff()/modfl() inf/nan tests; from Willemijn Coene.
miod [Sun, 13 Aug 2023 07:02:36 +0000 (07:02 +0000)]
Add modff()/modfl() inf/nan tests; from Willemijn Coene.

14 months agoExtent the modf() tests; from Willemijn Coene.
miod [Sun, 13 Aug 2023 06:57:04 +0000 (06:57 +0000)]
Extent the modf() tests; from Willemijn Coene.

14 months agoMake sure modff() returns correct values for infinities.
miod [Sun, 13 Aug 2023 06:56:10 +0000 (06:56 +0000)]
Make sure modff() returns correct values for infinities.

Reported by Willemijn Coene.

14 months agoMake sure modf() returns correct values for infinities. While there, drop
miod [Sun, 13 Aug 2023 06:55:37 +0000 (06:55 +0000)]
Make sure modf() returns correct values for infinities. While there, drop
the few assembler versions as has been done on other *BSD systems; this
function (modf) turns out to be non-trivial enough, having only one
known-to-work version is preferrable.

Reported by Willemijn Coene.

14 months agounifdef appeared in 4.1c before 2.9
jsg [Sun, 13 Aug 2023 02:20:23 +0000 (02:20 +0000)]
unifdef appeared in 4.1c before 2.9
dates checked in CSRG archives and already changed upstream in unifdef3

14 months agoMention recent developments.
miod [Sat, 12 Aug 2023 20:49:29 +0000 (20:49 +0000)]
Mention recent developments.

14 months agoBetter uwacom(4) support for Intuos S and One S tablets; most of the work
miod [Sat, 12 Aug 2023 20:47:06 +0000 (20:47 +0000)]
Better uwacom(4) support for Intuos S and One S tablets; most of the work
done by Vladimir Meshcheriakov (first name dot last name at epita somewhere in
frogland), thanks!

Tested by Peter J. Philipp on Intuos Draw and by espie@ on Intuos S.

14 months agoRegen
miod [Sat, 12 Aug 2023 20:44:32 +0000 (20:44 +0000)]
Regen

14 months agoAnother Wacom tablet; from Vladimir Meshcheriakov (first name dot last name
miod [Sat, 12 Aug 2023 20:43:49 +0000 (20:43 +0000)]
Another Wacom tablet; from Vladimir Meshcheriakov (first name dot last name
at epita somewhere in france)

14 months agodocument return values of the control function in EVP_MD_meth_set_ctrl(3)
schwarze [Sat, 12 Aug 2023 16:48:23 +0000 (16:48 +0000)]
document return values of the control function in EVP_MD_meth_set_ctrl(3)

14 months agofirst batch of intentionally undocumented EVP constants:
schwarze [Sat, 12 Aug 2023 16:36:41 +0000 (16:36 +0000)]
first batch of intentionally undocumented EVP constants:
some EVP_MD_CTRL_*, some EVP_MD_CTX_FLAG_*, and all of EVP_F_* and EVP_R_*

14 months ago1. Tweak the descriptions of EVP_MD_CTX_ctrl(3), EVP_MD_CTX_set_flags(3),
schwarze [Sat, 12 Aug 2023 16:12:19 +0000 (16:12 +0000)]
1. Tweak the descriptions of EVP_MD_CTX_ctrl(3), EVP_MD_CTX_set_flags(3),
EVP_MD_CTX_clear_flags(3), EVP_MD_CTX_test_flags(3), and the atrocious
EVP_MD_CTX_set_pkey_ctx(3) for precision.
2. Tweak the description of EVP_MD_type(3) and EVP_MD_CTX_type(3)
for conciseness.
3. Add a few missing HISTORY bits.

14 months agoFix bug when gzungetc() is used immediately after gzopen().
tb [Sat, 12 Aug 2023 13:49:29 +0000 (13:49 +0000)]
Fix bug when gzungetc() is used immediately after gzopen().

from upstream

14 months agofix typo
tb [Sat, 12 Aug 2023 13:48:37 +0000 (13:48 +0000)]
fix typo

from upstream

14 months agoCheck for a full read, avoid warn when errno might be unmodified
gnezdo [Sat, 12 Aug 2023 13:43:22 +0000 (13:43 +0000)]
Check for a full read, avoid warn when errno might be unmodified

Promote size from int to size_t.

From: lucas at sexy dot is

Regress tests by gnezdo@

deraadt: yes

14 months agoRepair compilability for non-MULTIPROCESSOR kernels.
miod [Sat, 12 Aug 2023 13:19:28 +0000 (13:19 +0000)]
Repair compilability for non-MULTIPROCESSOR kernels.

14 months agoDon't power down if the device is already opened. This happens when an
kettenis [Sat, 12 Aug 2023 10:03:05 +0000 (10:03 +0000)]
Don't power down if the device is already opened.  This happens when an
ikbd(4) attaches and becomes the console keyboard.  We would power down
the device but never power it on again when userland opened ikbd(4) as
an input device since that is only done on the first open.  The result
was a non-functioning keyboard if the hardware actually implemented the
power down command.  A lot of hardware actually doesn't (which is why
this wasn't noticed for some time) but the ASUS X205T does.

ok miod@

14 months agoRemove a blatant lie about DSA_dup_DH
tb [Sat, 12 Aug 2023 08:26:38 +0000 (08:26 +0000)]
Remove a blatant lie about DSA_dup_DH

q is copied across since OpenSSL 31360957 which hit our tree with
OpenSSL 1.0.1c in October 2012.

14 months agoThe int_ prefix also leaves the ec_ameth mess
tb [Sat, 12 Aug 2023 08:07:35 +0000 (08:07 +0000)]
The int_ prefix also leaves the ec_ameth mess

The prefixes in here are all over the place... This removes one variety.

14 months agoRSA's _free and _size also lose their int_ prefix
tb [Sat, 12 Aug 2023 08:02:43 +0000 (08:02 +0000)]
RSA's _free and _size also lose their int_ prefix

14 months agoDrop silly int_ prefix from _free() and _size()
tb [Sat, 12 Aug 2023 07:59:48 +0000 (07:59 +0000)]
Drop silly int_ prefix from _free() and _size()

14 months agoFree {priv,pub}_key before assigning to it
tb [Sat, 12 Aug 2023 07:50:47 +0000 (07:50 +0000)]
Free {priv,pub}_key before assigning to it

While it isn't the case for the default implementations, custom DH and DSA
methods could conceivably populate private and public keys, which in turn
would result in leaks in the pub/priv decode methods.

ok jsing

14 months agoReadability tweak for key parameters in DSA
tb [Sat, 12 Aug 2023 07:46:14 +0000 (07:46 +0000)]
Readability tweak for key parameters in DSA

ok jsing

14 months agoSimplify and unify missing_parameters() for DH and DSA
tb [Sat, 12 Aug 2023 07:43:48 +0000 (07:43 +0000)]
Simplify and unify missing_parameters() for DH and DSA

ok jsing

14 months agoAdd sanity checks in uvm_pagelookup().
mpi [Sat, 12 Aug 2023 07:22:56 +0000 (07:22 +0000)]
Add sanity checks in uvm_pagelookup().

ok kettenis@

14 months agoNow that the DH is sensibly called dh instead of a, we can also rename
tb [Sat, 12 Aug 2023 06:30:43 +0000 (06:30 +0000)]
Now that the DH is sensibly called dh instead of a, we can also rename
abuf, alen and aout to names that make sense, such as buf, buf_len and
secret_len.

14 months agoFix comments regarding pcb_onfault maintainence. No code change.
miod [Sat, 12 Aug 2023 06:28:13 +0000 (06:28 +0000)]
Fix comments regarding pcb_onfault maintainence. No code change.

14 months agoa is a silly name for a DH
tb [Sat, 12 Aug 2023 06:28:04 +0000 (06:28 +0000)]
a is a silly name for a DH

14 months agoUse printf for consistency
tb [Sat, 12 Aug 2023 06:25:26 +0000 (06:25 +0000)]
Use printf for consistency

14 months agoCheck that {DH,DSA}_get0_engine() returns NULL if OPENSSL_NO_ENGINE is
tb [Sat, 12 Aug 2023 06:23:59 +0000 (06:23 +0000)]
Check that {DH,DSA}_get0_engine() returns NULL if OPENSSL_NO_ENGINE is
defined.

14 months agoConvert {DH,DSA}_new_method() to using calloc()
tb [Sat, 12 Aug 2023 06:14:36 +0000 (06:14 +0000)]
Convert {DH,DSA}_new_method() to using calloc()

Due to OPENSSL_NO_ENGINE the engine member of dh and dsa is currently
uninitialized. As a consequence, {DH,DSA}_get0_engine() will return a
garbage pointer, which is particularly bad because the only reason we
kept them in the first place is that they are used by some software...

A side effect of freeing with {DH,DSA}_free() instead of a hand-rolled
version is that we may call ->meth->finish() before ->meth->init() was
called. We need a NULL check for ->meth to be on the safe side in case
we should need to bring ENGINE back.

with nits from djm
ok deraadt djm