openbsd
16 months agoHide symbols in chacha
beck [Wed, 5 Jul 2023 16:17:19 +0000 (16:17 +0000)]
Hide symbols in chacha

ok jsing@

16 months agobackport the implementation of ranges::find{, _if, _if_not}
robert [Wed, 5 Jul 2023 15:34:52 +0000 (15:34 +0000)]
backport the implementation of ranges::find{, _if, _if_not}

this will be required by future chromium releases

From ee0f8c4010309a25c95115a9f727a02741e2de48 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser@berlin.de>
Date: Sat, 12 Mar 2022 01:45:35 +0100
Subject: [PATCH] [libc++][ranges] Implement ranges::find{, _if, _if_not}

ok tb@

16 months agoMake softdep mounts a no-op
beck [Wed, 5 Jul 2023 15:13:28 +0000 (15:13 +0000)]
Make softdep mounts a no-op

Softdep is a significant impediment to progressing in the vfs layer
so we plan to get it out of the way. It is too clever for us to
continue maintaining as it is.

ok kettenis@ kn@ tobhe@ and most of the g2k23 room except bluhm@

16 months agoAdd iwm/iwx background scan task to the queue which it will be deleted from.
stsp [Wed, 5 Jul 2023 15:07:28 +0000 (15:07 +0000)]
Add iwm/iwx background scan task to the queue which it will be deleted from.

The corresponding task_add and task_del calls were operating on different
queues by mistake. Background scan tasks should now get cancelled properly
during driver state transitions.

ok mvs@

16 months agoOne more ECDSAerror goes.
tb [Wed, 5 Jul 2023 14:41:18 +0000 (14:41 +0000)]
One more ECDSAerror goes.

16 months agoECDHerror() and ECDSAerror will go away
tb [Wed, 5 Jul 2023 14:39:05 +0000 (14:39 +0000)]
ECDHerror() and ECDSAerror will go away

Move some trivial ones to ECerror().

discussed with jsing

16 months agoAdjust the public declaration of OpenSSLDie to use a portable
bcook [Wed, 5 Jul 2023 13:06:06 +0000 (13:06 +0000)]
Adjust the public declaration of OpenSSLDie to use a portable
method of indicating that the function does not return.

ok tb@

16 months agoDrop an incorrect part from a comment
tb [Wed, 5 Jul 2023 13:01:44 +0000 (13:01 +0000)]
Drop an incorrect part from a comment

16 months agoDrop kernel lock before panic to avoid WITNESS report during fault
kn [Wed, 5 Jul 2023 12:58:55 +0000 (12:58 +0000)]
Drop kernel lock before panic to avoid WITNESS report during fault

holding a spinlock, eg. malloc's malloc_mutex in "Data modified on freelist ..."
triggers "acquiring blockable sleep lock with spinlock or critical section held"
since kpageflttrap() grabs the kernel lock before fault() to serialise multiple
threds/faults avoid interleaved console text.

But fault() immediately sets the per-CPU panic string, so the kernel lock does
not really help here.

Use 'show panic' to recover from garbled console text if need be, as usual.
The i386 equivalent does not use the kernel lock, either.

OK bluhm kettenis

16 months agoMissing . in comment
tb [Wed, 5 Jul 2023 12:56:52 +0000 (12:56 +0000)]
Missing . in comment

16 months agoFix #includes
tb [Wed, 5 Jul 2023 12:54:46 +0000 (12:54 +0000)]
Fix #includes

16 months agoRemove local prototypes for public API (?!)
tb [Wed, 5 Jul 2023 12:51:11 +0000 (12:51 +0000)]
Remove local prototypes for public API (?!)

16 months agoImprove BN_bn2bin() error check for readability
tb [Wed, 5 Jul 2023 12:49:42 +0000 (12:49 +0000)]
Improve BN_bn2bin() error check for readability

16 months agoMerge ECDH code that will stay into ecdh.c
tb [Wed, 5 Jul 2023 12:31:14 +0000 (12:31 +0000)]
Merge ECDH code that will stay into ecdh.c

16 months agoMove ECDSA_size() to a more sensible place in this file
tb [Wed, 5 Jul 2023 12:27:36 +0000 (12:27 +0000)]
Move ECDSA_size() to a more sensible place in this file

16 months agoMerge ECDSA code that will stay into ecdsa.c
tb [Wed, 5 Jul 2023 12:18:21 +0000 (12:18 +0000)]
Merge ECDSA code that will stay into ecdsa.c

discussed with jsing

16 months agoDocument DIOCXEND in pf(4) manpage.
sashan [Wed, 5 Jul 2023 12:00:01 +0000 (12:00 +0000)]
Document DIOCXEND in pf(4) manpage.
With many improvements from jmc@ and kn@

OK jmc@, kn@ deraadt@

16 months agoRename ecs_local.h into ecdsa_local.h
tb [Wed, 5 Jul 2023 11:37:45 +0000 (11:37 +0000)]
Rename ecs_local.h into ecdsa_local.h

16 months agoMake variables in prototypes match function declarations
tb [Wed, 5 Jul 2023 11:28:50 +0000 (11:28 +0000)]
Make variables in prototypes match function declarations

16 months agoImplement support for the GPIOs on the JH7110. Makes it possible to reboot
kettenis [Wed, 5 Jul 2023 11:07:36 +0000 (11:07 +0000)]
Implement support for the GPIOs on the JH7110.  Makes it possible to reboot
the VisionFive 2 from OpenBSD.

ok jsing@

16 months agodrm/radeon: fix race condition UAF in radeon_gem_set_domain_ioctl
jsg [Wed, 5 Jul 2023 10:41:57 +0000 (10:41 +0000)]
drm/radeon: fix race condition UAF in radeon_gem_set_domain_ioctl

From Min Li
1af1cd7be370b08694d8752c97325fe51fdab6aa in linux-6.1.y/6.1.36
982b173a6c6d9472730c3116051977e05d17c8c5 in mainline linux

16 months agodrm/amd/display: fix the system hang while disable PSR
jsg [Wed, 5 Jul 2023 10:40:14 +0000 (10:40 +0000)]
drm/amd/display: fix the system hang while disable PSR

From Tom Chung
9bcac453890bf2c0ab5a7cefb407c0a9d6cbc4cb in linux-6.1.y/6.1.36
ea2062dd1f0384ae1b136d333ee4ced15bedae38 in mainline linux

16 months agodrm/amd/display: Add wrapper to call planes and stream update
jsg [Wed, 5 Jul 2023 10:38:11 +0000 (10:38 +0000)]
drm/amd/display: Add wrapper to call planes and stream update

From Rodrigo Siqueira
e538342002cbe468224f71b7ae116586e55c1134 in linux-6.1.y/6.1.36
81f743a08f3b214638aa389e252ae5e6c3592e7c in mainline linux

16 months agodrm/amd/display: Use dc_update_planes_and_stream
jsg [Wed, 5 Jul 2023 10:36:28 +0000 (10:36 +0000)]
drm/amd/display: Use dc_update_planes_and_stream

From Rodrigo Siqueira
8d855bc67630fa2b17855d85de61b9cd4300e3ad in linux-6.1.y/6.1.36
f7511289821ffccc07579406d6ab520aa11049f5 in mainline linux

16 months agoThey may have fixed the cache coherency problems in the JH7110, but it is
kettenis [Wed, 5 Jul 2023 09:25:55 +0000 (09:25 +0000)]
They may have fixed the cache coherency problems in the JH7110, but it is
still criplled as the SD/MMC controllers only do 32-bit DMA.

ok jsing@

16 months agoDrop useless ossl_ prefixes
tb [Wed, 5 Jul 2023 08:39:40 +0000 (08:39 +0000)]
Drop useless ossl_ prefixes

discussed with jsing

16 months agoSuspend from suspend_taskq in apmioctl.
tobhe [Wed, 5 Jul 2023 08:26:56 +0000 (08:26 +0000)]
Suspend from suspend_taskq in apmioctl.

ok kettenis@

16 months agoremove unused armv7 max_processes global
jsg [Wed, 5 Jul 2023 08:15:34 +0000 (08:15 +0000)]
remove unused armv7 max_processes global
ok miod@

16 months agoSimplify and clarify the description of auto allocation.
krw [Wed, 5 Jul 2023 08:05:04 +0000 (08:05 +0000)]
Simplify and clarify the description of auto allocation.

Tweaks and ok jmc@

16 months agoRestore (R)esize functionality to sparc64 disklabel(8).
krw [Wed, 5 Jul 2023 07:28:10 +0000 (07:28 +0000)]
Restore (R)esize functionality to sparc64 disklabel(8).

Empty or FS_UNUSED partitions don't intrude into the OpenBSD area
of a disk and therefore should not disable partition resizing.

Encountered by claudio@

16 months agofw_update is in section 8 not 1
jsg [Wed, 5 Jul 2023 01:21:51 +0000 (01:21 +0000)]
fw_update is in section 8 not 1

16 months agoIntroduce SBL_WAIT and SBL_NOINTR sbwait() flags.
mvs [Tue, 4 Jul 2023 22:28:24 +0000 (22:28 +0000)]
Introduce SBL_WAIT and SBL_NOINTR sbwait() flags.

This refactoring is another step to make standalone socket buffers
locking. sblock() uses M_WAITOK and M_NOWAIT flags passed as the third
argument together with the SB_NOINTR flag on the `sb_flags' to control
sleep behaviour. To perform uninterruptible acquisition, SB_NOINTR flag
should be set before sblock() call. `sb_flags' modification requires to
hold solock() around sblock()/sbunlock() that makes standalone call
impossible.

Also `sb_flags' modifications outside sblock()/sbunlock() makes
uninterruptible acquisition code huge enough. This time only sorflush()
does this (and forgets to restore SB_NOINTR flag, so shutdown(SHUT_RDWR)
call permanently modifies socket locking behaviour) and this looks not
the big problem. But with the standalone socket buffer locking it will
be many such places, so this huge construction is unwanted.

Introduce new SBL_NOINTR flag passed as third sblock() argument. The
sblock() acquisition will be uninterruptible when existing SB_NOINTR
flag is set on `sb_flags' or SBL_NOINTR was passed.

The M_WAITOK and M_NOWAIT flags belongs to malloc(9). It has no M_NOINTR
flag and there is no reason to introduce it. So for consistency reasons
introduce new SBL_WAIT and use it together with SBL_NOINTR instead of
M_WAITOK and M_NOINTR respectively.

ok bluhm

16 months agofavor hw.ncpuonline; ok bluhm@
anton [Tue, 4 Jul 2023 19:01:46 +0000 (19:01 +0000)]
favor hw.ncpuonline; ok bluhm@

16 months agoamd64: cpu_info: rearrange members, keep ci_mds_tmp 32-byte aligned
cheloha [Tue, 4 Jul 2023 17:29:32 +0000 (17:29 +0000)]
amd64: cpu_info: rearrange members, keep ci_mds_tmp 32-byte aligned

ci_mds_tmp needs to be 32-byte aligned, otherwise we trip a CTASSERT
in amd64/cpu.c and break kernel compilation.  However, ci_mds_tmp's
32-byte alignment is at risk: the size of schedstate_percpu is about
to change.

Move ci_curproc and ci_schedstate up just after ci_mds_buf.  This puts
ci_mds_tmp at page offset 64 with no structs ahead of it in cpu_info.
With this arrangement it should remain 32-byte aligned without much
effort.

With input from guenther@.

ok guenther@

16 months agoAvoid outputting invalid signatures
tb [Tue, 4 Jul 2023 15:09:31 +0000 (15:09 +0000)]
Avoid outputting invalid signatures

The caller can provide an r which will be added to the ECDSA_SIG unchecked.
This can happen via ECDSA_{,do_}sign_ex() or ECDSA_sign_setup() or else via
a custom sign_sig() handler. Therefore add a check that it is in the bounds
required.

Since k was long thrown away, there's no way to check kinv, so it needs to
be trusted. Misdesigned APIs that will output garbage everywhere...

ok jsing

16 months agoClean up ECDSA verification
tb [Tue, 4 Jul 2023 14:59:32 +0000 (14:59 +0000)]
Clean up ECDSA verification

Use variable names that correspond more closely to the standard. Use an
additional variable for s^-1 for readability. Annotate the code with
the corresponding steps from FIPS 186-5.

ok jsing

16 months agoECDSA signing: annotate code with steps corresponding to FIPS 185-6.
tb [Tue, 4 Jul 2023 14:57:05 +0000 (14:57 +0000)]
ECDSA signing: annotate code with steps corresponding to FIPS 185-6.

ok jsing

16 months agouse local assignment to $ENV{TZ} like we do for signal handlers
espie [Tue, 4 Jul 2023 14:41:26 +0000 (14:41 +0000)]
use local assignment to $ENV{TZ} like we do for signal handlers

16 months agoInstead of waiting for the inbound item to show up in the interrupt
patrick [Tue, 4 Jul 2023 14:32:21 +0000 (14:32 +0000)]
Instead of waiting for the inbound item to show up in the interrupt
handler, allocate it ourselves.  The firmware doesn't seem to mind
that it's us doing the allocation.  This fixes a splassert, because
the code that retrieves the item reaches through the shared memory
driver, which acquires the hardware mutex, which in turn mallocs.

ok kettenis@

16 months agoThis diff limits the number of transactions/tickets
sashan [Tue, 4 Jul 2023 14:23:38 +0000 (14:23 +0000)]
This diff limits the number of transactions/tickets
pf_open_trans() can issue for each clone of /dev/pf
to 512. The pf_open_trans() is currently being used
by DIOCGETRULES ioctl(2). The limit avoids processes
to consume all kernel memory by asking DIOCGETRULES
for more tickets. If DIOCGETRULES hits the limit, then
the application will see EBUSY error.

This diff was fine tuned with feedback from cluadio@,
deraadt@ and kn@.

OK kn@

16 months agostop saying the format is "simple" there are so many annotations.
espie [Tue, 4 Jul 2023 14:08:30 +0000 (14:08 +0000)]
stop saying the format is "simple" there are so many annotations.
"straightforward" is a better description at this point.

16 months agoadd some more fluff to documentation
espie [Tue, 4 Jul 2023 14:03:16 +0000 (14:03 +0000)]
add some more fluff to documentation

16 months agoexplain why NO_TS_IN_PLIST exists
espie [Tue, 4 Jul 2023 14:00:18 +0000 (14:00 +0000)]
explain why NO_TS_IN_PLIST exists

16 months agofix some very minor syntactic nits
espie [Tue, 4 Jul 2023 13:58:01 +0000 (13:58 +0000)]
fix some very minor syntactic nits

16 months agoCheck for interface type ethernet before call ether_brport_isset()
jan [Tue, 4 Jul 2023 13:37:47 +0000 (13:37 +0000)]
Check for interface type ethernet before call ether_brport_isset()

Pointed out by bluhm.

ok bluhm@

16 months agoenable dwqe(4)
kettenis [Tue, 4 Jul 2023 13:04:08 +0000 (13:04 +0000)]
enable dwqe(4)

16 months agoAdd StarFive JH7110 support.
kettenis [Tue, 4 Jul 2023 12:58:42 +0000 (12:58 +0000)]
Add StarFive JH7110 support.
Based on an initial diff from jsing@

ok jsing@, patrick@

16 months agoHandle rx error.
kettenis [Tue, 4 Jul 2023 12:48:42 +0000 (12:48 +0000)]
Handle rx error.

ok jsing@, patrick@

16 months agoconsistenly name instruction defines
jasper [Tue, 4 Jul 2023 12:27:44 +0000 (12:27 +0000)]
consistenly name instruction defines

16 months agoUnbreak kprobes. Since LLVM emits endbr64 instructions for IBT, dt could no
jasper [Tue, 4 Jul 2023 12:20:10 +0000 (12:20 +0000)]
Unbreak kprobes. Since LLVM emits endbr64 instructions for IBT, dt could no
longer identify function boundaries and as such no kprobes were found anymore.
Adjust the parser accordingly.

ok mpi@

16 months agoThe recent change to DIOCGETRULE allows applications which
sashan [Tue, 4 Jul 2023 11:34:19 +0000 (11:34 +0000)]
The recent change to DIOCGETRULE allows applications which
periodically read rules from pf(4) to consume all kernel
memory. The bug has been discovered and root caused by florian@.
In this particular case it was snmpd(8) what ate all kernel
memory.

This commit introduces DIOCXEND to pf(4) so applications such
as snmpd(8) and systat(1) to close ticket/transaction when
they are done with fetching the rules. This change also
updates snmpd(8) and systat(1) to use newly introduced
DIOCXEND ioctl(2).

OK claudio@, deraadt@, kn@

16 months agoRun Perl tests from our regress tree. It needs a Perl obj directory
bluhm [Tue, 4 Jul 2023 11:27:13 +0000 (11:27 +0000)]
Run Perl tests from our regress tree.  It needs a Perl obj directory
with Makefile.  To create the test environment, use the
Makefile.bsd-wrapper in /usr/src/gnu/usr.bin/perl and build Perl
there if it does not exist.  This allows to test Perl easily and
in a consistent manner.  Do not link tests to regress tree due to
this reach around and the combination of build and test.

16 months agoremove prototypes for removed functions
jsg [Tue, 4 Jul 2023 11:14:00 +0000 (11:14 +0000)]
remove prototypes for removed functions

16 months agoExtract private key and group order in s computation
tb [Tue, 4 Jul 2023 10:53:42 +0000 (10:53 +0000)]
Extract private key and group order in s computation

This pushes a few variables no longer needed in ossl_ecdsa_sign_sig() into
ecdsa_compute_s() separating API logic and pure computation a bit more.

ok beck

16 months agoRemove redundant code when calculating checksum.
bluhm [Tue, 4 Jul 2023 10:48:19 +0000 (10:48 +0000)]
Remove redundant code when calculating checksum.
OK jmatthew@

16 months agoAdd a bunch of clocks for GMAC0 and GMAC1 on the JH7110 SoC.
kettenis [Tue, 4 Jul 2023 10:34:03 +0000 (10:34 +0000)]
Add a bunch of clocks for GMAC0 and GMAC1 on the JH7110 SoC.
Based on an initial diff from jsing@

ok jsing@

16 months agoUse key for the EC_KEY everywhere
tb [Tue, 4 Jul 2023 10:31:57 +0000 (10:31 +0000)]
Use key for the EC_KEY everywhere

16 months agoSome more consistency in variable names
tb [Tue, 4 Jul 2023 10:26:47 +0000 (10:26 +0000)]
Some more consistency in variable names

16 months agoNormalize ECDSA_SIG to be sig everywhere
tb [Tue, 4 Jul 2023 10:23:34 +0000 (10:23 +0000)]
Normalize ECDSA_SIG to be sig everywhere

16 months agoMake the hardware counters available on BCM5705 and newer available as
jmatthew [Tue, 4 Jul 2023 10:22:39 +0000 (10:22 +0000)]
Make the hardware counters available on BCM5705 and newer available as
kstats.  Some of the hardware counters are already used in
bge_stats_update_regs() to update interface counters and work around
hardware bugs, and all counters reset on read, so to keep things simple
the work is split between that function and bge_kstat_read(), which
reads the rest of the counters.

tested by bluhm@ on BCM5720 (with counters) and BCM5704 (without), and
by me on BCM5720 A0 (with counters and hardware bugs)
ok bluhm@ dlg@

16 months agoNormalize on digest and digest_len rather than dgst dlen dgstlen, etc.
tb [Tue, 4 Jul 2023 10:14:37 +0000 (10:14 +0000)]
Normalize on digest and digest_len rather than dgst dlen dgstlen, etc.

16 months agoRework ecdsa_prepare_digest()
tb [Tue, 4 Jul 2023 10:06:36 +0000 (10:06 +0000)]
Rework ecdsa_prepare_digest()

Make it take an EC_KEY instead of a group order in preparation for further
cleanup. Rename m into e to match the standard better. Also buy some vowels
for jsing.

ok beck jsing

16 months agoRemove mbuf low watermark vars. Unused since uipc_mbuf.c rev 1.244.
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@

16 months agoAdd some extra parenthesis for consistency.
kettenis [Tue, 4 Jul 2023 09:00:24 +0000 (09:00 +0000)]
Add some extra parenthesis for consistency.

stolen from jsing@

16 months agoPlug leak in the ssltest
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

16 months agoFactor the computation of ECDSA s into a function
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

16 months agodocument the recent addition of "Building from scratch" and what it means.
espie [Tue, 4 Jul 2023 07:04:11 +0000 (07:04 +0000)]
document the recent addition of "Building from scratch" and what it means.

16 months agoadd support for unix domain sockets to ssh -W
dlg [Tue, 4 Jul 2023 03:59:21 +0000 (03:59 +0000)]
add support for unix domain sockets to ssh -W

ok djm@ dtucker@

16 months agom_reclaim() was removed in uipc_mbuf.c rev 1.195
jsg [Tue, 4 Jul 2023 03:56:07 +0000 (03:56 +0000)]
m_reclaim() was removed in uipc_mbuf.c rev 1.195

16 months agoa little knf, no functional change
dlg [Tue, 4 Jul 2023 02:56:11 +0000 (02:56 +0000)]
a little knf, no functional change

16 months agoremove unused global var
jsg [Tue, 4 Jul 2023 02:01:55 +0000 (02:01 +0000)]
remove unused global var
ok sashan@

16 months agorecord when pkg_add is actually doing something.
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)

16 months agofavor REGRESS_EXPECTED_FAILURES
anton [Mon, 3 Jul 2023 17:55:51 +0000 (17:55 +0000)]
favor REGRESS_EXPECTED_FAILURES

16 months agoalso make things 5.36 if not used
espie [Mon, 3 Jul 2023 17:01:59 +0000 (17:01 +0000)]
also make things 5.36 if not used

16 months agoAdd support for marking lines with a shell prompt based on the OSC 133
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.

16 months agoEnable mouse.tp.mtbuttons for apldcms
tobhe [Mon, 3 Jul 2023 15:54:07 +0000 (15:54 +0000)]
Enable mouse.tp.mtbuttons for apldcms

ok bru@

16 months agouse consistent queue(9) example for LIST removal; OK bluhm mvs
kn [Mon, 3 Jul 2023 15:52:51 +0000 (15:52 +0000)]
use consistent queue(9) example for LIST removal;  OK bluhm mvs

16 months agoAn empty string indicates there is no NXTNUM().
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 ":".

16 months agosign_sig: drop ckinv
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

16 months agoRework the logic in ECDSA sign_sig()
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

16 months agoadd regress tests for the remainder of the function provided by our uuid.h
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

16 months agoadd a few tests related to --cflags and --libs in combination with Requires.private.
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@

16 months agoUse new ibuf API. Use ibuf_data() and ibuf_size() instead of direct
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@

16 months agoDelete some more references to dead policy code.
tobhe [Mon, 3 Jul 2023 11:43:15 +0000 (11:43 +0000)]
Delete some more references to dead policy code.
Fixes -DNAMESPACE

ok tb@

16 months agosign_sig: test on assignment
tb [Mon, 3 Jul 2023 11:10:28 +0000 (11:10 +0000)]
sign_sig: test on assignment

16 months agosign_setup: split another check into two
tb [Mon, 3 Jul 2023 11:06:28 +0000 (11:06 +0000)]
sign_setup: split another check into two

16 months agotypo
tobhe [Mon, 3 Jul 2023 10:59:16 +0000 (10:59 +0000)]
typo

16 months agoDo not risk writing over the end of the buffer when it ends in #
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.

16 months agoUse ibuf_data() and ibuf_size() instead of accessing struct ibuf.
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@

16 months agoUse ibuf_data() and ibuf_size() instead of accessing struct ibuf.
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@

16 months agoSplit range checks for ECDSA r and ECDSA s
tb [Mon, 3 Jul 2023 10:21:25 +0000 (10:21 +0000)]
Split range checks for ECDSA r and ECDSA s

requested by jsing

16 months agoSwitch a couple of test from ucmp to cmp
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

16 months agoossl_ecdsa_verify_sig(): simplify range checks
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

16 months agoList variables in a somewhat more sensible order
tb [Mon, 3 Jul 2023 10:10:58 +0000 (10:10 +0000)]
List variables in a somewhat more sensible order

16 months agoIn ossl_ecdsa_verify_sig() use BN_CTX more idiomatically
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

16 months agoSplit a bunch of unrelated checks
tb [Mon, 3 Jul 2023 10:06:00 +0000 (10:06 +0000)]
Split a bunch of unrelated checks

ok beck jsing

16 months agoMake ossl_ecdsa_verify_sig() single exit
tb [Mon, 3 Jul 2023 10:04:05 +0000 (10:04 +0000)]
Make ossl_ecdsa_verify_sig() single exit

ok beck jsing

16 months agoSwitch ossl_ecdsa_verify() to timingsafe_memcmp()
tb [Mon, 3 Jul 2023 09:59:20 +0000 (09:59 +0000)]
Switch ossl_ecdsa_verify() to timingsafe_memcmp()

Requested by jsing

16 months agoStreamline ossl_ecdsa_verify()
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

16 months agoUse ibuf_data() instead of direct access to ibuf->buf,
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@