jsg [Tue, 4 Jul 2023 09:47:51 +0000 (09:47 +0000)]
Remove mbuf low watermark vars. Unused since uipc_mbuf.c rev 1.244.
ok kn@ bluhm@
kettenis [Tue, 4 Jul 2023 09:00:24 +0000 (09:00 +0000)]
Add some extra parenthesis for consistency.
stolen from jsing@
tb [Tue, 4 Jul 2023 08:47:01 +0000 (08:47 +0000)]
Plug leak in the ssltest
Removing -tls1 moved some tests from the legacy stack to the TLSv1.3 stack.
On a HRR, the alpn callback would be called twice and allocate the global
twice, thereby leaking. So free it up front.
Joint suffering with bcook and beck
tb [Tue, 4 Jul 2023 07:38:31 +0000 (07:38 +0000)]
Factor the computation of ECDSA s into a function
ossl_ecdsa_sign_sig() is already complicated enough. The math bit is
entirely self contained and does not need to obfuscate control flow
and logic.
with feedback from and ok jsing
espie [Tue, 4 Jul 2023 07:04:11 +0000 (07:04 +0000)]
document the recent addition of "Building from scratch" and what it means.
dlg [Tue, 4 Jul 2023 03:59:21 +0000 (03:59 +0000)]
add support for unix domain sockets to ssh -W
ok djm@ dtucker@
jsg [Tue, 4 Jul 2023 03:56:07 +0000 (03:56 +0000)]
m_reclaim() was removed in uipc_mbuf.c rev 1.195
dlg [Tue, 4 Jul 2023 02:56:11 +0000 (02:56 +0000)]
a little knf, no functional change
jsg [Tue, 4 Jul 2023 02:01:55 +0000 (02:01 +0000)]
remove unused global var
ok sashan@
espie [Mon, 3 Jul 2023 19:12:08 +0000 (19:12 +0000)]
record when pkg_add is actually doing something.
details of rc code to be set in stone later (currently as an option)
anton [Mon, 3 Jul 2023 17:55:51 +0000 (17:55 +0000)]
favor REGRESS_EXPECTED_FAILURES
espie [Mon, 3 Jul 2023 17:01:59 +0000 (17:01 +0000)]
also make things 5.36 if not used
nicm [Mon, 3 Jul 2023 16:47:43 +0000 (16:47 +0000)]
Add support for marking lines with a shell prompt based on the OSC 133
extension, from Munif Tanjim in GitHub issue 3596.
tobhe [Mon, 3 Jul 2023 15:54:07 +0000 (15:54 +0000)]
Enable mouse.tp.mtbuttons for apldcms
ok bru@
kn [Mon, 3 Jul 2023 15:52:51 +0000 (15:52 +0000)]
use consistent queue(9) example for LIST removal; OK bluhm mvs
krw [Mon, 3 Jul 2023 15:27:07 +0000 (15:27 +0000)]
An empty string indicates there is no NXTNUM().
Fixes segfault in -e if you happen to delete everything after
a partition line's ":".
tb [Mon, 3 Jul 2023 14:51:09 +0000 (14:51 +0000)]
sign_sig: drop ckinv
The only reason ckinv exists is to be able to avoid a copy. This copy
leaks some timing info, that will be mitigated in a subsequent step.
It is an unused or at least uncommonly used codepath.
ok jsing
tb [Mon, 3 Jul 2023 13:53:54 +0000 (13:53 +0000)]
Rework the logic in ECDSA sign_sig()
If the caller supplied both kinv and r, we don't loop but rather throw
an undocumented error code that no one uses, which is intended to tell
the caller to run ECDSA_sign_setup() and try again.
Use a boolean that indicates this situation so that the logic becomes
a bit more transparent.
ok jsing
jasper [Mon, 3 Jul 2023 13:51:55 +0000 (13:51 +0000)]
add regress tests for the remainder of the function provided by our uuid.h
jasper [Mon, 3 Jul 2023 13:44:45 +0000 (13:44 +0000)]
add a few tests related to --cflags and --libs in combination with Requires.private.
skipping one (currently failing) test which exhibits the behaviour described
by humm@ljabl.com on bugs@
claudio [Mon, 3 Jul 2023 11:51:27 +0000 (11:51 +0000)]
Use new ibuf API. Use ibuf_data() and ibuf_size() instead of direct
struct access and use ibuf_set_n16() to update the length field.
OK tb@
tobhe [Mon, 3 Jul 2023 11:43:15 +0000 (11:43 +0000)]
Delete some more references to dead policy code.
Fixes -DNAMESPACE
ok tb@
tb [Mon, 3 Jul 2023 11:10:28 +0000 (11:10 +0000)]
sign_sig: test on assignment
tb [Mon, 3 Jul 2023 11:06:28 +0000 (11:06 +0000)]
sign_setup: split another check into two
tobhe [Mon, 3 Jul 2023 10:59:16 +0000 (10:59 +0000)]
typo
nicm [Mon, 3 Jul 2023 10:48:26 +0000 (10:48 +0000)]
Do not risk writing over the end of the buffer when it ends in #
(because strchr \0 will be non-NULL), reported by Robert Morris in
GitHub issue 3610.
claudio [Mon, 3 Jul 2023 10:34:31 +0000 (10:34 +0000)]
Use ibuf_data() and ibuf_size() instead of accessing struct ibuf.
OK tb@
claudio [Mon, 3 Jul 2023 10:34:08 +0000 (10:34 +0000)]
Use ibuf_data() and ibuf_size() instead of accessing struct ibuf.
OK tb@
tb [Mon, 3 Jul 2023 10:21:25 +0000 (10:21 +0000)]
Split range checks for ECDSA r and ECDSA s
requested by jsing
tb [Mon, 3 Jul 2023 10:19:52 +0000 (10:19 +0000)]
Switch a couple of test from ucmp to cmp
This is confusing, as both sides involved should be unsigned. The ec
code is undecided on whether the group order can be negative. It should
never be, so lets see what happen with this slightly stricter check.
discussed with jsing
tb [Mon, 3 Jul 2023 10:16:14 +0000 (10:16 +0000)]
ossl_ecdsa_verify_sig(): simplify range checks
The checks whether r and s lie in the interval [1, order) were a bit
uglier than necessary. Clean this up.
ok beck jsing
tb [Mon, 3 Jul 2023 10:10:58 +0000 (10:10 +0000)]
List variables in a somewhat more sensible order
tb [Mon, 3 Jul 2023 10:09:12 +0000 (10:09 +0000)]
In ossl_ecdsa_verify_sig() use BN_CTX more idiomatically
ok beck jsing
tb [Mon, 3 Jul 2023 10:06:00 +0000 (10:06 +0000)]
Split a bunch of unrelated checks
ok beck jsing
tb [Mon, 3 Jul 2023 10:04:05 +0000 (10:04 +0000)]
Make ossl_ecdsa_verify_sig() single exit
ok beck jsing
tb [Mon, 3 Jul 2023 09:59:20 +0000 (09:59 +0000)]
Switch ossl_ecdsa_verify() to timingsafe_memcmp()
Requested by jsing
tb [Mon, 3 Jul 2023 09:55:42 +0000 (09:55 +0000)]
Streamline ossl_ecdsa_verify()
Make it single exit and use API more idiomatically and some other
cosmetics.
ok beck jsing
claudio [Mon, 3 Jul 2023 09:51:38 +0000 (09:51 +0000)]
Use ibuf_data() instead of direct access to ibuf->buf,
use ibuf_size() instead of direct access to ibuf->wpos,
use ibuf_left() in places where the code checks if there is enough
space left in the ibuf.
OK tb@
claudio [Mon, 3 Jul 2023 09:40:47 +0000 (09:40 +0000)]
Use ibuf_data() instead of directly accessing ibuf->buf.
OK tb@
claudio [Mon, 3 Jul 2023 09:38:08 +0000 (09:38 +0000)]
Use ibuf_data() instead of accessing ibuf->buf directly.
OK tb@
tb [Mon, 3 Jul 2023 09:37:30 +0000 (09:37 +0000)]
Explicit parameter printing can also use get0_order()
ok beck jsing
tb [Mon, 3 Jul 2023 09:35:26 +0000 (09:35 +0000)]
Convert ossl_ec_key_gen() and EC_KEY_check_key()
These also get the EC_GROUP_get0_order() treatment
ok beck jsing
tb [Mon, 3 Jul 2023 09:29:55 +0000 (09:29 +0000)]
Convert EC_GROUP_check() to EC_GROUP_get0_order()
ok beck jsing
tb [Mon, 3 Jul 2023 09:25:44 +0000 (09:25 +0000)]
Inline two copies of EC_GROUP_order_bits()
This code is way more complicated than it needs to be. Simplify. ec_bits()
was particularly stupid.
ok beck jsing
jsg [Mon, 3 Jul 2023 09:12:05 +0000 (09:12 +0000)]
use semicolon not comma at eol
ok stsp@
jasper [Mon, 3 Jul 2023 08:53:27 +0000 (08:53 +0000)]
fix uuid_dec_{b,l}e prototypes
ok jmc@
jmc [Mon, 3 Jul 2023 08:37:22 +0000 (08:37 +0000)]
some minor fix up;
nicm [Mon, 3 Jul 2023 08:37:14 +0000 (08:37 +0000)]
Another warning fix for GCC from Thomas Klausner.
jasper [Mon, 3 Jul 2023 08:32:20 +0000 (08:32 +0000)]
when shutting down a vm, handle the VM id in the same way as a VM name argument
ok dv@
krw [Mon, 3 Jul 2023 08:16:36 +0000 (08:16 +0000)]
Nuke unused label 'next:'.
beck [Mon, 3 Jul 2023 08:03:56 +0000 (08:03 +0000)]
Bring back no_tls1 and no_tls1_1 as undocumented silently discarded opitons
While I'm here, change the no_ssl2 and no_ssl3 options to use
OPTION_DISCARD as well instead of continuing to set a no-op
option flag.
ok jsing@ tb@
kn [Mon, 3 Jul 2023 07:40:52 +0000 (07:40 +0000)]
typofix lladdr in function names; OK deraadt jan
tb [Mon, 3 Jul 2023 07:28:05 +0000 (07:28 +0000)]
Switch ECDSA code to using EC_GROUP_get0_order()
ok jsing
tb [Mon, 3 Jul 2023 07:26:40 +0000 (07:26 +0000)]
Provide internal-only EC_GROUP_get0_order()
ok jsing
guenther [Mon, 3 Jul 2023 06:45:44 +0000 (06:45 +0000)]
Bring malloc(9) and <sys/malloc.h> into sync for M_* entries, such
that the former's text comes from the latter's comments. Rationalize
capitalization, whitespace, and plural-vs-singular. Mark things for
for automation in the future.
Prompted by loss of sync from the addition of M_IFGROUP and M_PF
Previously worked up in discussion with schwarze@ and jmc@
ok deraadt@, miod@, jmc@
beck [Mon, 3 Jul 2023 06:22:07 +0000 (06:22 +0000)]
Remove the tls1.0 and 1.1 related options from the openssl(1) toolkit
ok tb@
krw [Mon, 3 Jul 2023 06:07:40 +0000 (06:07 +0000)]
The only thing worse than treating 'return' as a function call is
randomly mixing 'return (blah)' and 'return blah' idioms.
Nuke the '()'s. No intentional functional change.
tb [Mon, 3 Jul 2023 05:48:18 +0000 (05:48 +0000)]
Another empty line did not want to go in
beck [Mon, 3 Jul 2023 05:45:53 +0000 (05:45 +0000)]
Stop caring about tls 1.0 and 1.1.
Syslogd is not a tls protocol tester in any case. These tests
should not care what version of tls they use
beck [Mon, 3 Jul 2023 05:31:56 +0000 (05:31 +0000)]
Stop testing tls 1.0 and 1.1
They have gone behind the barn.
tb [Mon, 3 Jul 2023 05:29:03 +0000 (05:29 +0000)]
Trade a pair of extra braces for a missing empty line
bru [Sun, 2 Jul 2023 21:44:04 +0000 (21:44 +0000)]
Add button mappings for two- and three-finger clicks on clickpads.
Based on a proposal of tobhe@.
ok tobhe@
tb [Sun, 2 Jul 2023 20:16:47 +0000 (20:16 +0000)]
Simplify allocation checks
Instead of attempting to allocate a few times and only then check all the
returned pointers for NULL, allocate and check one after the othre. This
is easier on the eyes and what we usually do.
Prompted by a report by Ilya Shipitsin
ok beck
bluhm [Sun, 2 Jul 2023 19:59:15 +0000 (19:59 +0000)]
Use TSO and LRO on the loopback interface to transfer TCP faster.
If tcplro is activated on lo(4), ignore the MTU with TCP packets.
They are passed along with the information that they have to be
chopped in case they are forwarded later. New netstat(1) counter
shows that software LRO is in effect. The feature is currently
turned off by default.
tested by jan@; OK claudio@ jan@
tb [Sun, 2 Jul 2023 19:52:01 +0000 (19:52 +0000)]
Clean up dynamic tables in OPENSSL_cleanup()
This is not currently done in OpenSSL, but it looks more like something
that was mised rather than desired behavior. There are some thread safety
issues here, but those are rife in this codebase anyway (although I heard
claims on some versions of this lib being "fully threadsafe").
no objection jsing
cheloha [Sun, 2 Jul 2023 19:02:27 +0000 (19:02 +0000)]
all platforms, kernel: remove __HAVE_CLOCKINTR symbol
Every platform made the clockintr switch at least six months ago.
The __HAVE_CLOCKINTR symbol is now redundant. Remove it.
Prompted by claudio@.
Link: https://marc.info/?l=openbsd-tech&m=168826181015032&w=2
"makes sense" mlarkin@
beck [Sun, 2 Jul 2023 17:21:32 +0000 (17:21 +0000)]
Disable TLS 1.0 and TLS 1.1 in libssl
Their time has long since past, and they should not be used.
This change restricts ssl to versions 1.2 and 1.3, and changes
the regression tests to understand we no longer speak the legacy
protocols.
For the moment the magical "golden" byte for byte comparison
tests of raw handshake values are disabled util jsing fixes them.
ok jsing@ tb@
tb [Sun, 2 Jul 2023 17:12:17 +0000 (17:12 +0000)]
Convert some tables to C99 initializers
ok & "happy pirate day" beck
tb [Sun, 2 Jul 2023 15:02:52 +0000 (15:02 +0000)]
Fix return values of ecx methods
It is hard to get your return values right if you choose them to be a
random subset of {-2, ..., 3}. The item_verify() and the digestverify()
methods don't return 0 on error, but -1. Here 0 means "failed to verify",
obviously.
ok jsing
jsing [Sun, 2 Jul 2023 14:57:58 +0000 (14:57 +0000)]
Demacro SHA-512.
Use static inline functions instead of macros to implement SHA-512. At
the same time, make two key changes - firstly, rather than trying to
outsmart the compiler and shuffle variables around, write the algorithm
the way it is documented and actually swap the variable contents. Secondly,
instead of interleaving the message schedule update and the round, do the
full message schedule update first, then process the round.
Overall, we get safer and more readable code. Additionally, the compiler
can generate smaller and faster code (with a gain of 5-10% across a range
of architectures).
ok beck@ tb@
tb [Sun, 2 Jul 2023 14:54:37 +0000 (14:54 +0000)]
Fix typo in previous
tb [Sun, 2 Jul 2023 14:53:18 +0000 (14:53 +0000)]
Use asprintf() to avoid repetition in string constants
... since ASN1_bn_print() is stupid.
ok jsing
tb [Sun, 2 Jul 2023 13:48:47 +0000 (13:48 +0000)]
Split ECPKParameters_print()
This function has two entirely independent parts, so instead of a huge
if/else just use two functions. In ecpk_print_explicity parameters() do
some additional boring cleanup such as switching to actually using the
local BN_CTX and shuffling things into a slightly more sensible order.
ok jsing
tb [Sun, 2 Jul 2023 13:37:09 +0000 (13:37 +0000)]
Switch sign_sig() and sign_setup() to using BN_CTX
Both these functions use a BN_CTX internally to deal with the EC API
that usually requires one. However, they don't actually make use of it.
Get the BIGNUMs from the BN_CTX instead, which simplifies the cleanup.
Also defer allocation of the ECDSA_SIG to the very end. Instead of using
its internal r and s, use two local r and s variables and transfer those
to the ECDSA_SIG on success.
ok beck jsing
espie [Sun, 2 Jul 2023 13:33:10 +0000 (13:33 +0000)]
lost silence_children behavior by accident
add a hook to compute the exit_code in more fun ways
tb [Sun, 2 Jul 2023 13:26:36 +0000 (13:26 +0000)]
Revert hunk accidentally committed in r1.39
tb [Sun, 2 Jul 2023 13:18:54 +0000 (13:18 +0000)]
Rework handling of the out_kinv and out_r pointers
suggested by jsing
jsing [Sun, 2 Jul 2023 13:11:23 +0000 (13:11 +0000)]
Replace bn_sqr_words() with bn_sqr_add_words().
In order to implement efficient squaring, we compute the sum of products
(omitting the squares), double the sum of products and then finally
compute and add in the squares. However, for reasons unknown the final
calculation was implemented as two separate steps.
Replace bn_sqr_words() with bn_sqr_add_words() such that we do the
computation in one step, avoid the need for temporary BN and remove
needless overhead. This gives us a performance gain across most
architectures (even with the loss of sse2 on i386, for example).
ok tb@
tb [Sun, 2 Jul 2023 13:05:29 +0000 (13:05 +0000)]
Rename ctx_in into in_ctx, kinvp into out_kinv and rp into out_r
tb [Sun, 2 Jul 2023 12:48:59 +0000 (12:48 +0000)]
Rename a few variables from X to x
deraadt [Sun, 2 Jul 2023 12:45:01 +0000 (12:45 +0000)]
sync
tb [Sun, 2 Jul 2023 12:25:33 +0000 (12:25 +0000)]
Simplify things by switching to bn_rand_interval()
This avoids some silly dances in ECDSA signature generation by replacing
them with a single API call. Also garbage collect the now unnecessary
range.
ok beck jsing
tb [Sun, 2 Jul 2023 11:29:36 +0000 (11:29 +0000)]
Unconditionally zero the ECDH key
While memset() is quite expensive, we can afford zeroing a few extra bytes
to make this code more readable.
ok beck jsing
deraadt [Sun, 2 Jul 2023 11:16:03 +0000 (11:16 +0000)]
PS_CHROOT flag must also be copied when forking. This will block
a ypconnect(2) from reading inside an incorrectly configured space.
ok kettenis
tb [Sun, 2 Jul 2023 07:08:57 +0000 (07:08 +0000)]
Teach openssl ca about
Ed25519 certificates
This adds a few logic curlies to end up setting the EVP_MD to EVP_md_null()
as required by the API. This way ASN1_item_sign() now knows how to behave.
"ok = (rv == 2);" beck
tb [Sun, 2 Jul 2023 07:05:14 +0000 (07:05 +0000)]
Teach openssl req about EdDSA certs
After a few things in libcrypto were adjusted, this diff makes issuing
certificate requests with
Ed25519 work.
ok beck
beck [Sun, 2 Jul 2023 06:37:27 +0000 (06:37 +0000)]
Remove the ability to do tls 1.0 and 1.1 from libtls.
With this change any requests from configurations to request
versions of tls before tls 1.2 will use tls 1.2. This prepares
us to deprecate tls 1.0 and tls 1.1 support from libssl.
ok tb@
tb [Sun, 2 Jul 2023 04:17:00 +0000 (04:17 +0000)]
ECDSA_size(): move order a few lines down
tb [Sun, 2 Jul 2023 03:20:44 +0000 (03:20 +0000)]
Invert method checks to avoid stupid line breaks
tb [Sun, 2 Jul 2023 03:11:51 +0000 (03:11 +0000)]
Move the EC_POINT a bit down and a * to the right place
tb [Sun, 2 Jul 2023 02:28:20 +0000 (02:28 +0000)]
ech_key.c: Fix includes
We need stdint.h for uintptr_t, stdlib.h for malloc, ec.h for various
things, but there's no need for objects. or sha.h.
cheloha [Sun, 2 Jul 2023 00:55:18 +0000 (00:55 +0000)]
clockintr_cpu_init: stagger clock interrupts by MAXCPUS
During clockintr_cpu_init(), we can't stagger by ncpus because not
every platform has fully incremented it yet. Instead, stagger by
MAXCPUS. The resulting intervals are smaller, but are probably still
sufficiently large to avoid aggravating lock contention, even on
platforms where MAXCPUS is large.
While here, don't bother staggering the statclock if it is randomized.
With input from claudio@.
drahn [Sat, 1 Jul 2023 18:59:11 +0000 (18:59 +0000)]
Add sensor to qccpu to be able to show all cpu frequencies.
otto [Sat, 1 Jul 2023 18:35:14 +0000 (18:35 +0000)]
Document that small allocations are initially junked with 0xdf now
drahn [Sat, 1 Jul 2023 16:39:11 +0000 (16:39 +0000)]
Manpage for qccpu.4
drahn [Sat, 1 Jul 2023 16:34:29 +0000 (16:34 +0000)]
Add driver for QC cpu Power States.
ok kettenis@ patrick@
drahn [Sat, 1 Jul 2023 15:50:18 +0000 (15:50 +0000)]
Enable AC detection in qcpas driver.
Will enable apm -A once cpu P-state driver is added.
tb [Sat, 1 Jul 2023 15:10:28 +0000 (15:10 +0000)]
Reverse polarity to avoid an overlong line
tb [Sat, 1 Jul 2023 15:09:54 +0000 (15:09 +0000)]
Reword comment to fit on a single line
tb [Sat, 1 Jul 2023 15:03:05 +0000 (15:03 +0000)]
tmp is a silly name for a point on an elliptic curve