jsing [Sat, 11 Mar 2023 14:13:11 +0000 (14:13 +0000)]
Correct sign handling in BN_add_word().
A sign handling bug was introduced to BN_add_word() in bn_word.c r1.18.
When handling addition to a negative bignum, the BN_sub_word() call can
result in the sign being flipped, which we need to account for. Use the
same code in BN_sub_word() - while not technically needed here it keeps
the code consistent.
Issue discovered by tb@
ok tb@
jsing [Sat, 11 Mar 2023 14:05:02 +0000 (14:05 +0000)]
Remove a pesky space.
jsing [Sat, 11 Mar 2023 14:04:21 +0000 (14:04 +0000)]
Add regress coverage for BN_{add,sub,mul,div,mod}_word().
This also provides some indirect coverage for BN_hex2bn(), BN_bn2hex() and
BN_get_word().
Two of these tests are currently failing and will be fixed shortly.
jsing [Sat, 11 Mar 2023 14:02:26 +0000 (14:02 +0000)]
Mark test table as static const.
aoyama [Sat, 11 Mar 2023 10:33:27 +0000 (10:33 +0000)]
Add missing $OpenBSD$ tag.
claudio [Sat, 11 Mar 2023 10:06:17 +0000 (10:06 +0000)]
Bump version to 7.8
claudio [Sat, 11 Mar 2023 10:04:59 +0000 (10:04 +0000)]
Factor out the cache reset logic into rtr_reset_cache() and use it
consitently in all places where the cache should be reset.
Additionally adjust the FSM to handle a connection close event in the
protocol negotiation phase as a protocol mismatch. Some caches fail
to send an error PDU and this allows them to work. A drawback is that
if the connection is closed because of a different reason the system
will fall back to a lower then necessary version. The RFC and draft
mandates this behaviour.
OK tb@
bluhm [Fri, 10 Mar 2023 23:02:30 +0000 (23:02 +0000)]
btrace(8) retrieves the types of the arguments of each tracepoint
from the kernel. Add them to a cache when needed, and print them
with btrace -l. If the argument is of type int, print the value
as %d signed integer. This gives pretty output for refcnt changes.
All other types still use %ul.
The probe and argument number can be used as array index. Remove
the qsort and search for probe number to simplify the code. Use
array index for both probes and argument types.
OK mpi@
bluhm [Fri, 10 Mar 2023 22:14:32 +0000 (22:14 +0000)]
Add new dt(4) ioctl DTIOCGARGS to get the types of probe arguments.
They are already tracked as strings in the kernel. Export them to
userland using one ioctl(2) for all arguments of each probe.
OK mpi@
krw [Fri, 10 Mar 2023 20:16:53 +0000 (20:16 +0000)]
Remove unused make variables FSTYPE (=install360) and FSDISKTYPE
(=mini34). Preparatory to removing some obsolete/unused disktab
entries.
tobhe [Fri, 10 Mar 2023 19:26:06 +0000 (19:26 +0000)]
Fix possible leak of spibuf and flowbuf in error case.
ok patrick@ bluhm@
tb [Fri, 10 Mar 2023 16:47:36 +0000 (16:47 +0000)]
sync
tb [Fri, 10 Mar 2023 16:45:50 +0000 (16:45 +0000)]
Crankl libcrypto/libssl/libtls minors after symbol addition
tb [Fri, 10 Mar 2023 16:44:43 +0000 (16:44 +0000)]
Update Symbols.list
tb [Fri, 10 Mar 2023 16:44:07 +0000 (16:44 +0000)]
Expose various X509_STORE_*check_issued()
tb [Fri, 10 Mar 2023 16:43:02 +0000 (16:43 +0000)]
Expose X509_CRL_get0_sigalg() and X509_get0_uids
tb [Fri, 10 Mar 2023 16:41:32 +0000 (16:41 +0000)]
Expose UI_null()
tb [Fri, 10 Mar 2023 16:41:07 +0000 (16:41 +0000)]
Expose the EVP_CIPHER_meth_* API (setter only) in evp.h
job [Fri, 10 Mar 2023 12:44:56 +0000 (12:44 +0000)]
mechanical change, rename struct members to match the original X509 names
OK tb@
job [Fri, 10 Mar 2023 12:02:11 +0000 (12:02 +0000)]
Show the X.509 notBefore in filemode
OK tb@
tb [Fri, 10 Mar 2023 11:55:38 +0000 (11:55 +0000)]
ASN.1 BIO: properly wire up prefix_free and suffix_free
If something goes wrong before the ASN.1 BIO state machine has passed
both flushing states, asn1_bio_free() forgets to free the ndef_aux
and the ex_arg since the prefix_free() and suffix_free callbacks are
not called.
This can lead to leaks, notably in streaming bios.
Part of https://github.com/openssl/openssl/pull/15999
I have a regress covering this but it is not yet ready to land.
ok beck jsing
claudio [Fri, 10 Mar 2023 11:04:26 +0000 (11:04 +0000)]
Add the necessary stack offsets for macppc so dt(4).
Tested on a G5 and G4 macppc.
OK miod@
claudio [Fri, 10 Mar 2023 11:01:52 +0000 (11:01 +0000)]
Update the stack offset for the profile probe to account for the clockintr
API functions. Fixes flamegraphs on archs I could test.
OK bluhm@ miod@
kettenis [Fri, 10 Mar 2023 10:54:29 +0000 (10:54 +0000)]
Implement setting the parent clock for RK356x. This includes code for
setting external parent clocks, which is needed to switch to the clock
provided by the Ethernet PHY.
ok patrick@
kn [Fri, 10 Mar 2023 10:33:40 +0000 (10:33 +0000)]
Fix error on installer abort/exit
^C during questiong yields
/install: /tmp/cppid: cannot open $(<) input
The trap handler must first test existence, then read the PID file.
Quote like other PID file constructs in install.sub do.
Use newlines to make the trap function readable.
OK miod
kettenis [Fri, 10 Mar 2023 10:22:55 +0000 (10:22 +0000)]
Take controller out of reset; makes it work on rk356x.
ok patrick@, mlarkin@
tb [Fri, 10 Mar 2023 09:56:09 +0000 (09:56 +0000)]
Return the correct type for ASN.1 BOOLEANs
ASN.1 BOOLEANs and ASN.1 NULL are handled specially in the ASN.1 sausage
factory and they are special in that they don't have a->value.ptr set.
Both need to be special cased here since they fail the a->type.ptr != NULL
check.
Apart from fixing an obvious bug in ASN1_TYPE_get(), this fixes another
crash in openssl(1) asn1parse. There is more to do in the vicinity, but
that is more complex and will have to wait for OpenBSD 7.3-current.
with/ok jsing
tb [Fri, 10 Mar 2023 09:44:54 +0000 (09:44 +0000)]
openssl(1) asn1parse: avoid crash with ASN.1 BOOLEANS
When pointing openssl asn1parse -strparse at DER octets 01 01, it crashes:
$ printf '<\x01\x01>' | openssl asn1parse -inform der -strparse 1
Refuse to parse BOOLEAN types instead, which avoids a crash in hensonian
/* hmm... this is a little evil, but it works */ code.
Found while poking at CMS timestamps to understand one of job's diffs.
with/ok jsing
claudio [Fri, 10 Mar 2023 07:57:15 +0000 (07:57 +0000)]
Compile the output filter rules into per peer filter rules.
especially on route-servers the output filters are in the hot path so
reducing the number of rules to check has a big impact. I have seen a
25% to 30% speedup in my big IXP testbench.
The output ruleset is applied and copied for each peer during config reload
and when a peer is initially added.
OK tb@
dtucker [Fri, 10 Mar 2023 07:17:08 +0000 (07:17 +0000)]
Explicitly ignore return from fcntl(... FD_CLOEXEC) here too.
Coverity CID 291853.
dtucker [Fri, 10 Mar 2023 04:06:21 +0000 (04:06 +0000)]
Plug mem leak on error path. Coverity CID 405026, ok djm@.
dtucker [Fri, 10 Mar 2023 03:01:51 +0000 (03:01 +0000)]
Expliticly ignore return code from fcntl(.. FD_CLOEXEC) since there's
not much we can do anyway. From Coverity CID 291857, ok djm@
djm [Fri, 10 Mar 2023 02:32:04 +0000 (02:32 +0000)]
Like sshd_config, some ssh_config options are not first-match-wins.
sshd_config.5 was fixed in r1.348, this is the same for this file
dtucker [Fri, 10 Mar 2023 02:24:56 +0000 (02:24 +0000)]
Remove no-op (int) > INT_MAX checks since they can never be true.
From Coverity CID 405031, ok djm@
jcs [Thu, 9 Mar 2023 21:06:24 +0000 (21:06 +0000)]
modify parentheses in conditionals to make it clearer what is being
assigned and what is being checked
ok djm dtucker
naddy [Thu, 9 Mar 2023 19:49:57 +0000 (19:49 +0000)]
remove obsolete libLLVM.so.[0-6].0 during upgrade
ok kn@ deraadt@
kettenis [Thu, 9 Mar 2023 19:48:42 +0000 (19:48 +0000)]
Check that a PCIe port isn't disabled in the device tree.
ok patrick@
tb [Thu, 9 Mar 2023 18:53:24 +0000 (18:53 +0000)]
Unwrap a few lines and zap a tab
tb [Thu, 9 Mar 2023 18:20:10 +0000 (18:20 +0000)]
Add missing error checking in PKCS7
Check the return value of BIO_set_md(). Prompted by OpenSSL's fix for
CVE-2023-0401 (the crash in that bug is an OpenSSL 3-only problem due
to provider design).
ok beck jsing
claudio [Thu, 9 Mar 2023 17:21:21 +0000 (17:21 +0000)]
Implement ASPA support in RTR by following draft-ietf-sidrops-8210bis-10.
In rtr.c renamed rtr_aspa_merge_set() to rtr_aspa_insert() and move it
close to rtr_roa_insert().
In rtr_proto.c most complexity comes from the version negotiation. The
ASPA parser is reasonably streight forward. The version negotiation is
fragile but that is mostly because of the protocol specification and the
fact that RTR cache daemons sometimes fail to send errors.
OK tb@
job [Thu, 9 Mar 2023 15:48:51 +0000 (15:48 +0000)]
Fix segfault in filemode for TAK objects
job [Thu, 9 Mar 2023 15:40:41 +0000 (15:40 +0000)]
Fix segfault in filemode for RSC objects
jsg [Thu, 9 Mar 2023 13:17:28 +0000 (13:17 +0000)]
workaround Intel Braswell/Cherry Trail mwait hang
dlg has a Dell Wyse 3040 with
cpu0: Intel(R) Atom(TM) x5-Z8350 CPU @ 1.44GHz, 480.02 MHz, 06-4c-04
cpu0: mwait min=64, max=64, C-substates=0.2.0.0.0.0.3.3, IBE
which hangs soon after the login prompt with MP kernels
This is a hardware bug described in:
Intel Atom Z8000 Processor Series Specification Update
Document Number: 332067-012
"CHT45 Processor May Not Wake From C6 or Deeper Sleep State"
tested by dlg@, ok guenther@
claudio [Thu, 9 Mar 2023 13:13:14 +0000 (13:13 +0000)]
Add role output to bgpctl, also adjust the capability output.
Note, this changes the JSON output of neighbors a bit.
Part of the large RFC9234 rework in bgpd.
OK tb@
claudio [Thu, 9 Mar 2023 13:12:19 +0000 (13:12 +0000)]
Major rework of RFC9234 support. My initial interpretation of the RFC was
too conservative. Fixes and changes include:
- add role output to bgpctl, also adjust the capability output.
Note, this changes the JSON output of neighbors a bit.
- adjust the config parser to enable the RFC9234 role capability when
there is a role set. iBGP and sessions with no role will not announce
the role capability.
- adjust the role capability announcement to be only on sessions that
use either AFI IPv4 or IPv6 and SAFI 1 (AID_INET, AID_INET6).
- if there is an OPEN notification indicating that the role capability
is bad only disable the capability if it is not enforced.
- Adjust capability negotiation, store remote_role on the peer since
the neighbors role is no longer needed by the RDE.
- inject the OTC attribute on ingress only for AID_INET and AID_INET6.
For other AIDs clear the F_ATTR_OTC_LOOP flag.
- Adjust the role logic in the RDE and use the peer->role (local role of
the system) for all checks. Also remove the check if the role capability
was negotiated between peers.
- In prefix_eligible() check also if the F_ATTR_OTC_LOOP flag is set.
The RFC requires that prefixes must be considered ineligible (and not
treat as withdraw as done before)
- When generating an UPDATE include the OTC attribute unless the AID is
neither AID_INET or AID_INET6.
Fixes https://github.com/openbgpd-portable/openbgpd-portable/issues/51
Reported by Pier Carlo Chiodi
OK tb@
job [Thu, 9 Mar 2023 12:54:28 +0000 (12:54 +0000)]
In filmode also show 'Not After' for GBR records
OK tb@
claudio [Thu, 9 Mar 2023 10:29:04 +0000 (10:29 +0000)]
Improve vnet(4) to work better in busy conditions.
No longer limit the ifq size to a low number, increase the slots on the
DMA Ring a bit and abstract the VNET buffer size into a define.
Enqueue packets on the ring but mark the initial packet ready at the end.
This way the other ldom is not able to rush ahead and overconsume packets.
The dring indexes are passed between ldoms and can get out of sync with
causes the TX ring to stall.
Tested by myself and jan@
OK kettenis@ jan@ kn@
job [Thu, 9 Mar 2023 09:46:21 +0000 (09:46 +0000)]
Show CMS signing-time signed attribute in filemode
OK tb@
dtucker [Thu, 9 Mar 2023 07:11:05 +0000 (07:11 +0000)]
Re-split the merge of the reorder-hostkeys test.
In the kex_proposal_populate_entries change I merged the the check for
reordering hostkeys with the actual reordering, but kex_assemble_names
mutates options.hostkeyalgorithms which renders the check ineffective.
Put the check back where it was. Spotted and tested by jsg@, ok djm@
djm [Thu, 9 Mar 2023 06:58:26 +0000 (06:58 +0000)]
include destination constraints for smartcard keys too.
Spotted by Luci Stanescu; ok deraadt@ markus@
anton [Thu, 9 Mar 2023 06:22:40 +0000 (06:22 +0000)]
Cope with recent changes to alignment of command column.
dlg [Thu, 9 Mar 2023 06:01:40 +0000 (06:01 +0000)]
document BIOC[SGD]WTIMEOUT
dlg [Thu, 9 Mar 2023 05:56:58 +0000 (05:56 +0000)]
add a timeout between capturing a packet and making the buffer readable.
before this, there were three reasons that a bpf read will finish.
the first is the obvious one: the bpf packet buffer in the kernel
fills up. by default this is about 32k, so if you're only capturing
a small packet packet every few seconds, it can take a long time
for the buffer to fill up before you can read them.
the second is if bpf has been configured to enable immediate mode with
ioctl(BIOCIMMEDIATE). this means that when any packet is written into
the bpf buffer, the buffer is immediately readable. this is fine
if the packet rate is low, but if the packet rate is high you don't
get the benefit of buffering many packets that bpf is supposed to
provide.
the third mechanism is if bpf has been configured with the BIOCSRTIMEOUT
ioctl, which sets a maximum wait time on a bpf read. BIOCSRTIMEOUT
means than a clock starts ticking down when a program (eg pflogd)
reads from bpf. when the clock reaches zero then the read returns
with whatever is in the bpf packet buffer. however, there could be
nothing in the buffer, and the read will still complete.
deraadt@ noticed this behaviour with pflogd. it wants packets logged
by pf to end up on disk in a timely fashion, but it's fine with
tolerating a bit of delay so it can take advantatage of buffering
to amortise the cost of the reads per packet. it currently does
this with BIOCSRTIMEOUT set to half a second, which means it's
always waking up every half second even if there's nothing to log.
this diff adds BIOCSWTIMEOUT, which specifies a timeout from when
bpf first puts a packet in the capture buffer, and when the buffer
becomes readable.
by default this wait timeout is infinite, meaning the buffer has
to be filled before it becomes readable. BIOCSWTIMEOUT can be set
to enable the new functionality. BIOCIMMEDIATE is turned into a
variation of BIOCSWTIMEOUT with the wait time set to 0, ie, wait 0
seconds between when a packet is written to the buffer and when the
buffer becomes readable. combining BIOCSWTIMEOUT and
BIOCIMMEDIATE simplifies the code a lot.
for pflogd, this means if there are no packets to capture, pflogd
won't wake up every half second to do nothing. however, when a
packet is logged by pf, bpf will wait another half second to see
if any more packets arrive (or the buffer fills up) before the read
fires.
discussed a lot with deraadt@ and sashan@
ok sashan@
cheloha [Thu, 9 Mar 2023 03:50:38 +0000 (03:50 +0000)]
clockintr: add a priority queue
- Add cq_pend to struct clockintr_queue. cq_pend is the list of clock
interrupts pending to run, sorted in ascending order by cl_expiration
(earliest deadline first; EDF). If the cl_expiration of two
clockintrs is equal, the first clock interrupt scheduled has priority
(FIFO).
We may need to switch to an RB tree or a min-heap in the future.
For now, there are only three clock interrupts, so a linked list
is fine.
- Add cl_flags to struct clockintr. We have one flag, CLST_PENDING.
It indicates whether the given clockintr is enqueued on cq_pend.
- Rewrite clockintr_dispatch() to operate on cq_pend. Clock
interrupts are run in EDF order until the most imminent clockintr
expires in the future.
- Add code to clockintr_establish(), clockintr_advance() and
clockintr_schedule() to enqueue/dequeue the given clockintr
on cq_est and cq_pend as needed.
- Add cq_est to struct clockintr_queue. cq_est is the list of all
clockintrs established on a clockintr_queue.
- Add a new counter, cs_spurious, to clockintr_stat. A dispatch is
"spurious" if no clockintrs are on cq_pend when we call
clockintr_dispatch().
With input from aisha@. Heavily tested by mlarkin@. Shared with
hackers@.
ok aisha@ mlarkin@
chris [Thu, 9 Mar 2023 00:13:47 +0000 (00:13 +0000)]
Fix comment to reflect the disabled status of Energy Efficient Ethernet.
Intel just disabled EEE for 1Gbps and 2.5Gbps modes on both i225 and i226
chips due to bugs. We already had it this way.
ok patrick@ kevlo@
bluhm [Wed, 8 Mar 2023 23:17:02 +0000 (23:17 +0000)]
An invalid source routing IP option could overwrite kernel memory
by using a bad option length. This bug is only reachable if both
pf IP option check is disabled and IP source routing is enabled.
reported by @fuzzingrf Erg Noor
OK claudio@ deraadt@
stsp [Wed, 8 Mar 2023 22:25:52 +0000 (22:25 +0000)]
update the list of firmware files in the iwx(4) man page
cheloha [Wed, 8 Mar 2023 18:05:05 +0000 (18:05 +0000)]
amd64: lapic_timer_rearm: don't reset mode, mask, divisor
The apic timer mode, mask, and divisor are set during lapic_timer_trigger().
We don't need to reset them when rearming the timer. On physical hardware
the difference is too small to measure, but skipping two apic writes may be
a bit faster when we're running in a VM.
Bochs also likes to log when the apic divisor is changed:
38569516308i[APIC0 ] set timer divide factor to 1
38569517335i[APIC0 ] set timer divide factor to 1
38569518042i[APIC0 ] set timer divide factor to 1
[...]
With this change, Bochs is a lot less noisy.
Idea from mlarkin@.
ok mlarkin@
tb [Wed, 8 Mar 2023 16:51:42 +0000 (16:51 +0000)]
Use BN_free() instead of BN_clear_free()
tobhe [Wed, 8 Mar 2023 14:47:02 +0000 (14:47 +0000)]
Fix alignment of command column. print_comm_name() returns an updated
length value, not the length difference.
ok deraadt@ millert@ guenther@
kn [Wed, 8 Mar 2023 11:52:20 +0000 (11:52 +0000)]
Treat WEP like WPA: only offer if supported
WEP does not work with our bwfm(4) and it shows:
Which network interface do you wish to configure? (or 'done') [bse0] bwfm0
ifconfig: SIOCS80211NWKEY: Operation not supported by device
Access point? (ESSID, 'any', list# or '?') [any] 2
Security protocol? (O)pen, (W)EP, WPA-(P)SK [O]
Handle the error and disable (W)EP unless the driver has it.
No objections from anyone.
jsing [Wed, 8 Mar 2023 07:15:42 +0000 (07:15 +0000)]
Fix a EC_GROUP_clear_free() that snuck through.
Thanks to Mark Patruck for reporting.
jmc [Wed, 8 Mar 2023 07:02:09 +0000 (07:02 +0000)]
this morning's fortune was missing an apostrophe;
jsing [Wed, 8 Mar 2023 06:47:30 +0000 (06:47 +0000)]
Fix previous.
tb [Wed, 8 Mar 2023 06:44:45 +0000 (06:44 +0000)]
reduce number of tests in bn_rand_interval.
This is only testing basic functionality anyway, so 10000 tests are more
than enough.
tb [Wed, 8 Mar 2023 06:28:08 +0000 (06:28 +0000)]
bn_isqrt: reduce number of tests to 100.
The runtime is roughly quadratic in N_TESTS. While it only takes 1-2s on
modern machines, this test takes a long time on slow machines. A reduction
of runtime by a factor of ~16 is significant.
dtucker [Wed, 8 Mar 2023 06:21:32 +0000 (06:21 +0000)]
Plug mem leak. Coverity CID 405196, ok djm@
jsing [Wed, 8 Mar 2023 06:12:52 +0000 (06:12 +0000)]
Process up to four test vector files concurrently.
This avoids having a slow down when processing test vector files that only
have a single group. Note that the processing of test vector files is in
turn going to be rate limited by the number of concurrent test groups,
which means we do not need variable limits for vectors.
Reduces a Wycheproof regress run down to ~8 seconds on an Apple M1.
jsing [Wed, 8 Mar 2023 05:45:31 +0000 (05:45 +0000)]
Always clear EC groups and points on free.
Rather than sometimes clearing, turn the free functions into ones that
always clear (as we've done elsewhere). Turn the EC_GROUP_clear_free() and
EC_POINT_clear_free() functions into wrappers that call the *_free()
version. Do similar for the EC_METHOD implementations, removing the
group_clear_finish() and point_clear_finish() hooks in the process.
ok tb@
jsing [Wed, 8 Mar 2023 05:41:08 +0000 (05:41 +0000)]
Run test groups concurrently.
Add a basic test coordinator, that allows for Wycheproof test groups to be
run concurrently. This can be further improved (especially for vectors that
have limited test groups), however it already reduces the regress duration
by about half on an Apple M1.
tb [Wed, 8 Mar 2023 05:36:45 +0000 (05:36 +0000)]
zap more audit remnants
jsing [Wed, 8 Mar 2023 05:35:51 +0000 (05:35 +0000)]
Stop trying to use EC_GFp_nist_method().
Currently, if compiled without OPENSSL_BN_ASM_MONT,
EC_GROUP_new_curve_GFp() tries to use EC_GFp_nist_method(), falling back to
EC_GFp_mont_method() if it is not a NIST curve (if OPENSSL_BN_ASM_MONT is
defined we use EC_GFp_mont_method() unconditionally).
Now that we have a reasonable non-assembly Montgomery implementation, the
performance of EC_GFp_nist_method() is either similar or slower than
EC_GFp_mont_method() (the exception being P-521, however if you're using
that you're not doing it for performance reasons anyway).
The EC_GFp_nist_method() uses rather scary BN NIST code (which would
probably already be removed, if not for the BN and EC public APIs), it uses
code paths that are currently less constant time, and there is additional
overhead in checking to see if the curve is actually supported.
Stop trying to use EC_GFp_nist_method() and unconditionally use
EC_GFp_mont_method() in all cases. While here, factor out the common
setup code and call it from both EC_GROUP_new_curve_GFp() and
EC_GROUP_new_curve_GF2m().
ok beck@ tb@
tb [Wed, 8 Mar 2023 05:33:53 +0000 (05:33 +0000)]
ssh-pkcs11: synchronize error messages with errors
A handful of error messages contained incorrect function names or
otherwise inaccurate descriptions. Fix them to match reality.
input/ok djm
jsing [Wed, 8 Mar 2023 05:17:33 +0000 (05:17 +0000)]
Remove acceptable audit.
This code would need changes to be safe to use concurrently - remove it
since it is somewhat incomplete and needs reworking.
Requested by tb@
jsing [Wed, 8 Mar 2023 04:50:27 +0000 (04:50 +0000)]
Remove EC_FLAGS_DEFAULT_OCT.
The EC code has an amazing array of function pointer hooks, such that a
method can hook into almost any operation... and then there is the
EC_FLAGS_DEFAULT_OCT flag, which adds a bunch of complex code and #ifdef
so you can avoid setting three of those function pointers!
Remove EC_FLAGS_DEFAULT_OCT, the now unused flags field from EC_METHOD,
along with the various code that was wrapped in EC_FLAGS_DEFAULT_OCT,
setting the three function pointers that need to be set in each of the
EC_METHODs.
ok beck@ tb@
guenther [Wed, 8 Mar 2023 04:43:04 +0000 (04:43 +0000)]
Delete obsolete /* ARGSUSED */ lint comments.
ok miod@ millert@
djm [Wed, 8 Mar 2023 00:05:58 +0000 (00:05 +0000)]
use RSA/SHA256 when testing usability of private key in agent;
with/ok dtucker
djm [Wed, 8 Mar 2023 00:05:37 +0000 (00:05 +0000)]
use RSA/SHA256 when testing usability of private key;
based on fix in bz3546 by Dmitry Belyavskiy; with/ok dtucker
djm [Tue, 7 Mar 2023 21:47:42 +0000 (21:47 +0000)]
refactor to be more readable top to bottom. Prompted by Coverity CID
405048 which was a false-positive fd leak; ok dtucker@
jan [Tue, 7 Mar 2023 20:09:47 +0000 (20:09 +0000)]
Avoid enabling TSO on interfaces which are already attached to a bridge.
with tweaks from claudio and deraadt
ok claudio, bluhm
guenther [Tue, 7 Mar 2023 17:43:59 +0000 (17:43 +0000)]
Delete obsolete /* ARGSUSED1 */ lint comments.
ok claudio@ cheloha@ krw@ deraadt@ miod@ millert@
kn [Tue, 7 Mar 2023 17:37:26 +0000 (17:37 +0000)]
Use "installboot -p"; tested by/OK miod
kn [Tue, 7 Mar 2023 17:29:42 +0000 (17:29 +0000)]
Initial support for guided disk encryption
One new question to cover the most common use case, such that manual setup
in (S)hell or '!' prior to install is no longer required:
Encrypt the root disk? (disk, 'no' or '?' for details) [no] ?
Create a passphrase protected CRYPTO softraid volume to be used as root disk.
Available disks are: sd0.
Encrypt the root disk? (disk, 'no' or '?' for details) [no]
Use of keydisk or different disciplines are not covered.
Only asked in interactive installations; no autoinstall(8) or upgrades.
Only reachable on i386, amd64, sparc64 and riscv64 for now (arm64 WIP).
Tested by cheloha naddy and a few users
Feedback from cheloha deraadt claudio
OK cheloha
"get it in now" deraadt
krw [Tue, 7 Mar 2023 16:41:08 +0000 (16:41 +0000)]
Nuke pointless 'pb#N:ob#0:' lines from floppy
types.
ok miod@
job [Tue, 7 Mar 2023 14:49:32 +0000 (14:49 +0000)]
Improve decoded content printing in filemode
Looks reasonable claudio@
kn [Tue, 7 Mar 2023 10:58:39 +0000 (10:58 +0000)]
restore tags for commands lost in r1.112 restructuring; OK jmc
claudio [Tue, 7 Mar 2023 10:30:38 +0000 (10:30 +0000)]
Remove pre-c99 gcc workaround which is no longer needed.
kettenis [Tue, 7 Mar 2023 10:24:11 +0000 (10:24 +0000)]
Add some minimal initialization code for rk356x such that the kernel
doesn't hang.
ok millert@, dlg@
jsing [Tue, 7 Mar 2023 09:42:09 +0000 (09:42 +0000)]
Improve bn_montgomery_multiply_words().
Rather than calling bn_mul_add_words() twice - once to multiply and once
to reduce - perform the multiplication and reduction in a single pass using
bn_mulw_addw_addw() directly. Also simplify the addition of the resulting
carries, which in turn allows us to avoid zeroing the top half of the
temporary words.
This provides a ~20-25% performance improvement for RSA operations on
aarch64.
ok tb@
jsing [Tue, 7 Mar 2023 09:35:55 +0000 (09:35 +0000)]
Slightly rework bn_mulw_addtw().
Call bn_mulw_addw() rather than doing bn_mulw() follow by bn_addw(). This
simplifies the code slightly, plus on some platforms bn_mulw_addw() can
be optimised (and bn_mulw_addtw() will then benefit from such an
optimisation).
ok tb@
jsing [Tue, 7 Mar 2023 09:27:10 +0000 (09:27 +0000)]
Call BN_free() instead of BN_clear_free().
BN_clear_free() is a wrapper that calls BN_free() - call BN_free() directly
instead.
ok tb@
jmc [Tue, 7 Mar 2023 07:54:59 +0000 (07:54 +0000)]
mpls gateway clarification; from claudio
tb [Tue, 7 Mar 2023 07:01:35 +0000 (07:01 +0000)]
Fix another return value check for CMS_SharedInfo_encode()
This should have been included in a previous diff/commit...
jsing [Tue, 7 Mar 2023 06:28:36 +0000 (06:28 +0000)]
Limit bn_mul_mont() usage to sizes less than or equal to 8192 bits.
The assembly bn_mul_mont() implementations effectively use alloca() to
allocate space for computation (at up to 8x the input size), without
any limitation. This means that sufficiently large inputs lead to the
stack being blown. Prevent this by using the C based implementation
instead.
Thanks to Jiayi Lin <jlin139 at asu dot edu> for reporting this to us.
ok beck@ tb@
jsing [Tue, 7 Mar 2023 06:19:44 +0000 (06:19 +0000)]
Implement bn_montgomery_multiply()
Provide a constant-time-style Montgomery multiplication implementation.
Use this in place of the assembly bn_mul_mont() on platforms that either
do not have an assembly implementation or have not compiled it in.
Also use this as the fallback version for bn_mul_mont(), rather than
falling back to a non-constant time implementation.
ok beck@ tb@
jsing [Tue, 7 Mar 2023 06:15:09 +0000 (06:15 +0000)]
Refactor BN_mod_mul_montgomery().
Pull out the simplistic implementation (using BN_mul() or BN_sqr()) into a
bn_mod_mul_montgomery_simple() function. Provide bn_mod_mul_montgomery()
with an implementation that changes depending on if the assembly
bn_mul_mont() is available or not. Turn BN_mod_mul_montgomery() and
BN_to_montgomery() into callers of bn_mod_mul_montgomery().
ok beck@ tb@
tb [Tue, 7 Mar 2023 06:15:07 +0000 (06:15 +0000)]
Make order of pub_key and priv_key the same everywhere
tb [Tue, 7 Mar 2023 06:12:27 +0000 (06:12 +0000)]
Fix OpenSSL version in HISTORY section
dtucker [Tue, 7 Mar 2023 06:09:14 +0000 (06:09 +0000)]
Fix mem leak in environment setup. From jjelen at redhat.com via
bz#2687, ok djm@
jsing [Tue, 7 Mar 2023 06:05:06 +0000 (06:05 +0000)]
Delete unused and unsafe bn_mul_mont() example code.
This came from bn_asm.c and did not even compile until recently.
ok beck@ tb@