openbsd
19 months agorpki-client: disallow AIA in self-signed certs
tb [Tue, 14 Mar 2023 07:09:11 +0000 (07:09 +0000)]
rpki-client: disallow AIA in self-signed certs

Per RFC 6487, 4.8.7, self-signed certificates must not have an Authority
Info Access extension. In normal operation this is ensured by ta_parse()
and cert_parse(), respectively. In filemode, only partial checks are
performed, so this is not guaranteed.

Issue flagged by and ok job

19 months agosync the boot options list, and some macro fixes;
jmc [Tue, 14 Mar 2023 06:55:31 +0000 (06:55 +0000)]
sync the boot options list, and some macro fixes;
ok miod

19 months agosync
deraadt [Tue, 14 Mar 2023 04:51:34 +0000 (04:51 +0000)]
sync

19 months agoTo avoid misunderstanding, keep variables for tcp keepalive in
yasuoka [Tue, 14 Mar 2023 00:24:05 +0000 (00:24 +0000)]
To avoid misunderstanding, keep variables for tcp keepalive in
milliseconds, which is the same unit of tcp_now().  However, keep the
unit of sysctl variables in seconds and convert their unit in
tcp_sysctl().  Additionally revert TCPTV_SRTTDFLT back to 3 seconds,
which was mistakenly changed to 1.5 seconds by tcp_timer.h 1.19.

ok claudio

19 months agoclockintr: add missing newline to ddb(4) printout
cheloha [Tue, 14 Mar 2023 00:11:58 +0000 (00:11 +0000)]
clockintr: add missing newline to ddb(4) printout

Let's also print the state (running, pending, or established) of each
clockintr.

19 months agoDon't lookup the signature path's expiry for trust anchor certs
job [Mon, 13 Mar 2023 21:01:06 +0000 (21:01 +0000)]
Don't lookup the signature path's expiry for trust anchor certs

19 months agoIn filemode, also print details for .cer certificates
job [Mon, 13 Mar 2023 20:55:14 +0000 (20:55 +0000)]
In filemode, also print details for .cer certificates

19 months agoPoint people to boot(8) rather than duplicating information.
miod [Mon, 13 Mar 2023 20:32:28 +0000 (20:32 +0000)]
Point people to boot(8) rather than duplicating information.

19 months agoSwitch alpha to new boot blocks.
miod [Mon, 13 Mar 2023 20:20:59 +0000 (20:20 +0000)]
Switch alpha to new boot blocks.

19 months agoAdd manual page.
miod [Mon, 13 Mar 2023 20:20:13 +0000 (20:20 +0000)]
Add manual page.

19 months ago"ask name" option letter is 'n' instead of 'a' on pmax and alpha for historical
miod [Mon, 13 Mar 2023 20:19:22 +0000 (20:19 +0000)]
"ask name" option letter is 'n' instead of 'a' on pmax and alpha for historical
(and firmware) reasons.

19 months agoCheck that the CMS signing-time is not after the MFT's nextUpdate
job [Mon, 13 Mar 2023 19:54:36 +0000 (19:54 +0000)]
Check that the CMS signing-time is not after the MFT's nextUpdate

Issuing manifests whose validity window is entirely in the past, as
observed from the purported CMS signing-time would be a form of backdating.

OK tb@

19 months agoIn filemode, display the moment the signature path will expire
job [Mon, 13 Mar 2023 19:51:49 +0000 (19:51 +0000)]
In filemode, display the moment the signature path will expire

Previously this was only shown for ROA+ASPA. Now also show for
GBR, Geofeed, Certs, RSC, and TAK.

OK tb@

19 months agoCheck that the CMS signing-time isn't after the X.509 notAfter
job [Mon, 13 Mar 2023 19:46:55 +0000 (19:46 +0000)]
Check that the CMS signing-time isn't after the X.509 notAfter

The CMS signing-time is the purported 'now' from the perspective of the
issuer. It doesn't make sense for an issuer to sign objects that have a
validity window that falls entirely in the past (from the perspective of
the signer). Although CMS signing-time is not a trusted timestamp, it
should never be after X.509 notAfter.

OK tb@

19 months agotypo fix; ok claudio
jmc [Mon, 13 Mar 2023 18:31:54 +0000 (18:31 +0000)]
typo fix; ok claudio

19 months agovmd(8): backout ns8250 changes.
dv [Mon, 13 Mar 2023 18:09:41 +0000 (18:09 +0000)]
vmd(8): backout ns8250 changes.

This backs out commit h1IJwTVsYWfnRKWy which intended to fix interrupt
issues on slower host hardware. Unfortunately, this causes a race
condition on much faster host hardware. It still requires investigation.

With an "I told you so" about touching ns8250 from mlarkin@

19 months agoIn filemode for ROAs/ASPAs display when the Signature path will expire
job [Mon, 13 Mar 2023 18:02:58 +0000 (18:02 +0000)]
In filemode for ROAs/ASPAs display when the Signature path will expire

Also rename 'certification path' to 'signature path' for alignment

OK tb@

19 months agoExtend bgplgd to handle leaked and invalid options to show rib.
claudio [Mon, 13 Mar 2023 17:31:28 +0000 (17:31 +0000)]
Extend bgplgd to handle leaked and invalid options to show rib.
OK tb@

19 months agoExtend bgpctl show rib with two new options:
claudio [Mon, 13 Mar 2023 16:59:22 +0000 (16:59 +0000)]
Extend bgpctl show rib with two new options:
 - invalid: show only routes that are not valid
 - leaked: show only routes where a route leak was detected
OK tb@

19 months agoAdd F_CTL_LEAKED and F_CTL_INELIGIBLE flags for bgpctl to show leaked
claudio [Mon, 13 Mar 2023 16:52:41 +0000 (16:52 +0000)]
Add F_CTL_LEAKED and F_CTL_INELIGIBLE flags for bgpctl to show leaked
and ineligible paths.
While there rename F_PREF_OTC_LOOP to F_PREF_OTC_LEAK since this indicates
that a route leak was detected.
OK tb@

19 months agoTry to explain that the neighor role is required to enable both
claudio [Mon, 13 Mar 2023 16:39:29 +0000 (16:39 +0000)]
Try to explain that the neighor role is required to enable both
ASPA validation and RFC9234 OTC leak detection and role capability.
The role on iBGP peers is forced to 'none' since it makes no sense there.
After input from benno@

19 months agoMerge calling print_certification_path() into adjacent else branch
job [Mon, 13 Mar 2023 15:50:40 +0000 (15:50 +0000)]
Merge calling print_certification_path() into adjacent else branch

OK tb@

19 months agoFix potential underflow when printing STP data.
mbuhl [Mon, 13 Mar 2023 14:58:01 +0000 (14:58 +0000)]
Fix potential underflow when printing STP data.
Reported by Peter J. Philipp
ok claudio

19 months agoRefactor whats printed when in filemode
job [Mon, 13 Mar 2023 13:42:01 +0000 (13:42 +0000)]
Refactor whats printed when in filemode

OK tb@

19 months agoFix usbpcap handler to properly detect overflows using TCHECK macros.
claudio [Mon, 13 Mar 2023 13:36:56 +0000 (13:36 +0000)]
Fix usbpcap handler to properly detect overflows using TCHECK macros.
OK mpi@ mbuhl@

19 months agoAdd "machine poweroff" command on luna88k bootloader.
aoyama [Mon, 13 Mar 2023 11:59:39 +0000 (11:59 +0000)]
Add "machine poweroff" command on luna88k bootloader.

ok miod@

19 months agoRevert accidental change from explicit to implicit tagging in r1.86.
tb [Mon, 13 Mar 2023 10:39:03 +0000 (10:39 +0000)]
Revert accidental change from explicit to implicit tagging in r1.86.

ok job

19 months agoRename some data fields to closer match their provenance
job [Mon, 13 Mar 2023 09:24:37 +0000 (09:24 +0000)]
Rename some data fields to closer match their provenance

OK tb@

19 months agoStop confusing out and asn_bio in BIO_new_NDEF()
tb [Mon, 13 Mar 2023 07:31:09 +0000 (07:31 +0000)]
Stop confusing out and asn_bio in BIO_new_NDEF()

BIO_new_NDEF() sets up an ASN.1 BIO to the output chain and then adds even
more BIOs. Since BIO_push(bio, new_tail) returns bio on success, after the
if ((out = BIO_push(asn_bio, out)) != NULL) the 'out' BIO and the 'asn_bio'
are the same. The code then goes on and uses one or the other. This is very
confusing. Simply stop using out once it's appended to asn_bio.

ok jsing

19 months agoregen
kettenis [Mon, 13 Mar 2023 07:30:44 +0000 (07:30 +0000)]
regen

19 months agoAdd Kingston NV2 NVMe drive.
kettenis [Mon, 13 Mar 2023 07:30:11 +0000 (07:30 +0000)]
Add Kingston NV2 NVMe drive.

19 months agosync
deraadt [Mon, 13 Mar 2023 04:15:44 +0000 (04:15 +0000)]
sync

19 months agosh, landisk: set HZ=64 again
cheloha [Sun, 12 Mar 2023 22:18:58 +0000 (22:18 +0000)]
sh, landisk: set HZ=64 again

The addition of HZ to sys/kernel.h in v1.26 overrides the default
definition of HZ in sh/clock.c, changing landisk from HZ=64 to HZ=100.

Explicitly set HZ=64 in the GENERIC and RAMDISK config(8) files to can
change it from 100 back to 64.

Not sure if this is the best thing, but it does fix the problem.

Problem confirmed by, and fix tested by, miod@.

ok miod@

19 months agocorrect macro request (.nm -> .Nm);
jmc [Sun, 12 Mar 2023 20:14:41 +0000 (20:14 +0000)]
correct macro request (.nm -> .Nm);

19 months agorkcomphy(4)
kettenis [Sun, 12 Mar 2023 19:02:34 +0000 (19:02 +0000)]
rkcomphy(4)

19 months agopk7_cb() and cms_cb()
tb [Sun, 12 Mar 2023 17:29:02 +0000 (17:29 +0000)]
pk7_cb() and cms_cb()

Add and fix FALLTHROUGH statement. I was confused for way too long since
I hadn't noticed that this case fell through to the next. Also add and
move some empty lines in the cms_cb() to make this resemble KNF more.

19 months agoAdd rkcomphy(3), a driver for the "naneng" combo PHY found on the RK356x
kettenis [Sun, 12 Mar 2023 14:29:50 +0000 (14:29 +0000)]
Add rkcomphy(3), a driver for the "naneng" combo PHY found on the RK356x
(and RK3588).  This is a PIPE PHY with support for PCIe, SATA, USB3, SGMII
and QSGMII.  For now only PCIe, SATA and USB3 support are implemented.
SATA support has not been tested.

Also add the refernce clocks needed by the PHYs to rkclock(4).

ok mlarkin@

19 months agozap a tab
tb [Sun, 12 Mar 2023 13:31:39 +0000 (13:31 +0000)]
zap a tab

19 months agoAlphabetically sort various bits and pieces - mechanical change
job [Sun, 12 Mar 2023 12:11:45 +0000 (12:11 +0000)]
Alphabetically sort various bits and pieces - mechanical change

Might make later refactors easier to follow

OK tb@

19 months agoAdd crl.c in various places to gain access to the new helper
job [Sun, 12 Mar 2023 11:55:34 +0000 (11:55 +0000)]
Add crl.c in various places to gain access to the new helper

19 months agoRefactor expiration calculation
job [Sun, 12 Mar 2023 11:54:56 +0000 (11:54 +0000)]
Refactor expiration calculation

Unify common code paths which find the exact expiry moment into a new
helper function. Additionally, the new helper offers more accuracy by
checking more applicable CRLs whether their 'nextupdate' is 'sooner'.

tb@ noted: The helper adds a multiplier of log(#crls), but that's
certainly acceptable as it is still very cheap.

OK tb@

19 months agoAvoid an 1 byte out-of-bounds read in ASN1_PRINTABLE_type()
tb [Sun, 12 Mar 2023 11:49:02 +0000 (11:49 +0000)]
Avoid an 1 byte out-of-bounds read in ASN1_PRINTABLE_type()

In case the input is not NUL terminated, the reversed check for length
and terminating NUL results in a one-byte overread. The documentation
says that the input should be a string, but in ASN.1 land you never
know...

Reported by Guido Vranken a while back

ok beck

19 months agoInitialize the local signtime variable in the individual *_parse()
tb [Sun, 12 Mar 2023 11:46:35 +0000 (11:46 +0000)]
Initialize the local signtime variable in the individual *_parse()
functions

ok job

19 months agoInvalidate the signtime output parameter in cms_parse_validate_internal()
tb [Sun, 12 Mar 2023 11:45:52 +0000 (11:45 +0000)]
Invalidate the signtime output parameter in cms_parse_validate_internal()
and in cms_get_signtime().

ok job

19 months agoEnable mvtemp(4)
jmatthew [Sun, 12 Mar 2023 10:50:06 +0000 (10:50 +0000)]
Enable mvtemp(4)

19 months agoUpdate supported hardware list and fix spelling of Marvell while I'm here
jmatthew [Sun, 12 Mar 2023 10:49:05 +0000 (10:49 +0000)]
Update supported hardware list and fix spelling of Marvell while I'm here

19 months agoMatch on the Armada 380 temperature sensor, which works the same as the
jmatthew [Sun, 12 Mar 2023 10:46:27 +0000 (10:46 +0000)]
Match on the Armada 380 temperature sensor, which works the same as the
CP110 sensor.

ok kettenis@

19 months agoPut upper bound on number of entries in SSH2_MSG_EXT_INFO request.
dtucker [Sun, 12 Mar 2023 10:40:39 +0000 (10:40 +0000)]
Put upper bound on number of entries in SSH2_MSG_EXT_INFO request.
This is already constrained by the maximum SSH packet size but this
makes it explicit.  Prompted by Coverity CID 291868, ok djm@ markus@

19 months agocalloc can return NULL but xcalloc cannot. From Coverity CID 291881,
dtucker [Sun, 12 Mar 2023 09:41:18 +0000 (09:41 +0000)]
calloc can return NULL but xcalloc cannot.  From Coverity CID 291881,
ok djm@

19 months agoRemove a few extra spaces
tb [Sat, 11 Mar 2023 21:14:26 +0000 (21:14 +0000)]
Remove a few extra spaces

19 months agoNew alpha secondary boot blocks using the MI code base. Not linked to the
miod [Sat, 11 Mar 2023 20:56:01 +0000 (20:56 +0000)]
New alpha secondary boot blocks using the MI code base. Not linked to the
build yet.

19 months agoRemove long dead "tool".
miod [Sat, 11 Mar 2023 20:52:02 +0000 (20:52 +0000)]
Remove long dead "tool".

19 months agoAllow strip and objcopy to be overrridden, for easier cross-buildability. NFC
miod [Sat, 11 Mar 2023 20:49:33 +0000 (20:49 +0000)]
Allow strip and objcopy to be overrridden, for easier cross-buildability. NFC

19 months agoSwitch an early return into goto err
tb [Sat, 11 Mar 2023 16:29:48 +0000 (16:29 +0000)]
Switch an early return into goto err

19 months agoTiny cleanup for readability
tb [Sat, 11 Mar 2023 16:02:06 +0000 (16:02 +0000)]
Tiny cleanup for readability

Turn a malloc() into calloc() and check two function calls directly
forever instead of a combined check afterward.

19 months agoUse "if (ptr == NULL)" instead of "if (!ptr)"
tb [Sat, 11 Mar 2023 15:56:03 +0000 (15:56 +0000)]
Use "if (ptr == NULL)" instead of "if (!ptr)"

Requested by jsing

19 months agoFix double free after BIO_new_NDEF()
tb [Sat, 11 Mar 2023 15:50:13 +0000 (15:50 +0000)]
Fix double free after BIO_new_NDEF()

Once the asn_bio is prepended to the out chain, and before the asn1_cb()
has done its thing, asn_bio needs to be popped off again on error. Failing
to do this can cause write after frees or double frees when the out BIO
is used after the function returned.

Based on a very complicated diff by Matt Caswell and Viktor Dukhovni.
This was part of the fixes in OpenSSL 1.1.1t.

ok jsing

19 months agoFix an off-by-one in dsa_check_key()
tb [Sat, 11 Mar 2023 15:29:03 +0000 (15:29 +0000)]
Fix an off-by-one in dsa_check_key()

The private key is a random number in [1, q-1], so 1 must be allowed.
Since q is at least an 160-bit prime and 2^159 + 1 is not prime (159
is not a power of 2), the probability that this is hit is < 2^-159,
but a tiny little bit wrong is still wrong.

Found while investigating a report by bluhm
ok jsing

19 months agoCall CRYPTO_cleanup_all_ex_data() from OPENSSL_cleanup().
jsing [Sat, 11 Mar 2023 14:29:02 +0000 (14:29 +0000)]
Call CRYPTO_cleanup_all_ex_data() from OPENSSL_cleanup().

Issue reported by Graham Percival (@gperciva)

ok tb@

19 months agoAdd OPENSSL_cleanup() calls to some regress.
jsing [Sat, 11 Mar 2023 14:27:37 +0000 (14:27 +0000)]
Add OPENSSL_cleanup() calls to some regress.

This gets us some minimal test coverage.

19 months agoAvoid -0 in BN_div_word().
jsing [Sat, 11 Mar 2023 14:14:54 +0000 (14:14 +0000)]
Avoid -0 in BN_div_word().

Currently, the use of BN_div_word() can result in -0 - avoid this by
setting negative again, at the end of the computation.

Should fix oss-fuzz 56667.

ok tb@

19 months agoCorrect sign handling in BN_add_word().
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@

19 months agoRemove a pesky space.
jsing [Sat, 11 Mar 2023 14:05:02 +0000 (14:05 +0000)]
Remove a pesky space.

19 months agoAdd regress coverage for BN_{add,sub,mul,div,mod}_word().
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.

19 months agoMark test table as static const.
jsing [Sat, 11 Mar 2023 14:02:26 +0000 (14:02 +0000)]
Mark test table as static const.

19 months agoAdd missing $OpenBSD$ tag.
aoyama [Sat, 11 Mar 2023 10:33:27 +0000 (10:33 +0000)]
Add missing $OpenBSD$ tag.

19 months agoBump version to 7.8
claudio [Sat, 11 Mar 2023 10:06:17 +0000 (10:06 +0000)]
Bump version to 7.8

19 months agoFactor out the cache reset logic into rtr_reset_cache() and use it
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@

19 months agobtrace(8) retrieves the types of the arguments of each tracepoint
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@

19 months agoAdd new dt(4) ioctl DTIOCGARGS to get the types of probe arguments.
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@

19 months agoRemove unused make variables FSTYPE (=install360) and FSDISKTYPE
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.

19 months agoFix possible leak of spibuf and flowbuf in error case.
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@

19 months agosync
tb [Fri, 10 Mar 2023 16:47:36 +0000 (16:47 +0000)]
sync

19 months agoCrankl libcrypto/libssl/libtls minors after symbol addition
tb [Fri, 10 Mar 2023 16:45:50 +0000 (16:45 +0000)]
Crankl libcrypto/libssl/libtls minors after symbol addition

19 months agoUpdate Symbols.list
tb [Fri, 10 Mar 2023 16:44:43 +0000 (16:44 +0000)]
Update Symbols.list

19 months agoExpose various X509_STORE_*check_issued()
tb [Fri, 10 Mar 2023 16:44:07 +0000 (16:44 +0000)]
Expose various X509_STORE_*check_issued()

19 months agoExpose X509_CRL_get0_sigalg() and X509_get0_uids
tb [Fri, 10 Mar 2023 16:43:02 +0000 (16:43 +0000)]
Expose X509_CRL_get0_sigalg() and X509_get0_uids

19 months agoExpose UI_null()
tb [Fri, 10 Mar 2023 16:41:32 +0000 (16:41 +0000)]
Expose UI_null()

19 months agoExpose the EVP_CIPHER_meth_* API (setter only) in evp.h
tb [Fri, 10 Mar 2023 16:41:07 +0000 (16:41 +0000)]
Expose the EVP_CIPHER_meth_* API (setter only) in evp.h

19 months agomechanical change, rename struct members to match the original X509 names
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@

19 months agoShow the X.509 notBefore in filemode
job [Fri, 10 Mar 2023 12:02:11 +0000 (12:02 +0000)]
Show the X.509 notBefore in filemode

OK tb@

19 months agoASN.1 BIO: properly wire up prefix_free and suffix_free
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

19 months agoAdd the necessary stack offsets for macppc so dt(4).
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@

19 months agoUpdate the stack offset for the profile probe to account for the clockintr
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@

19 months agoImplement setting the parent clock for RK356x. This includes code for
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@

19 months agoFix error on installer abort/exit
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

19 months agoTake controller out of reset; makes it work on rk356x.
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@

19 months agoReturn the correct type for ASN.1 BOOLEANs
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

19 months agoopenssl(1) asn1parse: avoid crash with ASN.1 BOOLEANS
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

19 months agoCompile the output filter rules into per peer filter rules.
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@

19 months agoExplicitly ignore return from fcntl(... FD_CLOEXEC) here too.
dtucker [Fri, 10 Mar 2023 07:17:08 +0000 (07:17 +0000)]
Explicitly ignore return from fcntl(... FD_CLOEXEC) here too.
Coverity CID 291853.

19 months agoPlug mem leak on error path. Coverity CID 405026, ok djm@.
dtucker [Fri, 10 Mar 2023 04:06:21 +0000 (04:06 +0000)]
Plug mem leak on error path.  Coverity CID 405026, ok djm@.

19 months agoExpliticly ignore return code from fcntl(.. FD_CLOEXEC) since there's
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@

19 months agoLike sshd_config, some ssh_config options are not first-match-wins.
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

19 months agoRemove no-op (int) > INT_MAX checks since they can never be true.
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@

19 months agomodify parentheses in conditionals to make it clearer what is being
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

19 months agoremove obsolete libLLVM.so.[0-6].0 during upgrade
naddy [Thu, 9 Mar 2023 19:49:57 +0000 (19:49 +0000)]
remove obsolete libLLVM.so.[0-6].0 during upgrade

ok kn@ deraadt@

19 months agoCheck that a PCIe port isn't disabled in the device tree.
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@

19 months agoUnwrap a few lines and zap a tab
tb [Thu, 9 Mar 2023 18:53:24 +0000 (18:53 +0000)]
Unwrap a few lines and zap a tab

19 months agoAdd missing error checking in PKCS7
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