openbsd
2 years agoconvert ssh, sshd mainloops from select() to poll();
djm [Thu, 6 Jan 2022 21:48:38 +0000 (21:48 +0000)]
convert ssh, sshd mainloops from select() to poll();
feedback & ok deraadt@ and markus@
has been in snaps for a few months

2 years agoAdd test for hostbased auth. It requires some external setup (see
dtucker [Thu, 6 Jan 2022 21:46:56 +0000 (21:46 +0000)]
Add test for hostbased auth.  It requires some external setup (see
comments at the top) and thus is disabled unless TEST_SSH_HOSTBASED_AUTH
and SUDO are set.

2 years agoprepare for conversion of ssh, sshd mainloop from select() to poll()
djm [Thu, 6 Jan 2022 21:46:23 +0000 (21:46 +0000)]
prepare for conversion of ssh, sshd mainloop from select() to poll()
by moving FD_SET construction out of channel handlers into separate
functions. ok markus

2 years agorepair usage
deraadt [Thu, 6 Jan 2022 20:15:54 +0000 (20:15 +0000)]
repair usage

2 years agoSwitch fw_update -D to instead -F
afresh1 [Thu, 6 Jan 2022 19:27:01 +0000 (19:27 +0000)]
Switch fw_update -D to instead -F

The perl version of fw_update used -D for something else and although
the mneumonic isn't as good, the conflict was worse.

Requested by deraadt@

2 years agorefer to longindex as an argument, not a field;
jmc [Thu, 6 Jan 2022 18:58:24 +0000 (18:58 +0000)]
refer to longindex as an argument, not a field;
from uwe@netbsd -r1.22

ok millert

2 years agoRevise for change to tls_key_share_peer_public()
jsing [Thu, 6 Jan 2022 18:27:31 +0000 (18:27 +0000)]
Revise for change to tls_key_share_peer_public()

2 years agoConvert legacy TLS client to tls_key_share.
jsing [Thu, 6 Jan 2022 18:23:56 +0000 (18:23 +0000)]
Convert legacy TLS client to tls_key_share.

This requires adding DHE support to tls_key_share. In doing so,
tls_key_share_peer_public() has to lose the group argument and gains
an invalid_key argument. The one place that actually needs the group
check is tlsext_keyshare_client_parse(), so add code to do this.

ok inoguchi@ tb@

2 years agoAllocate and free the EVP_AEAD_CTX struct in tls13_record_protection.
jsing [Thu, 6 Jan 2022 18:18:13 +0000 (18:18 +0000)]
Allocate and free the EVP_AEAD_CTX struct in tls13_record_protection.

This brings the code more in line with the tls12_record_layer and reduces
the effort needed to make EVP_AEAD_CTX opaque.

Prompted by and ok tb@

2 years agoCleanup mft file handling, especially the stale mft bits.
claudio [Thu, 6 Jan 2022 16:06:30 +0000 (16:06 +0000)]
Cleanup mft file handling, especially the stale mft bits.
Move staleness check up into mft_parse_econtent() to simplify code.
Remove the big FIXME bits since they are no longer needed. The parent
process will only process MFTs that are not stale.
Cleanup a few other bits mainly unneccessary else if cascades and
use valid_filename() to check if the filename embedded in the mft
fileandhash is sensible.
OK tb@

2 years agoUse a 64-bit integer for pcitag_t and define PCITAG_NODE and PCITAG_OFFSET
deraadt [Thu, 6 Jan 2022 15:41:53 +0000 (15:41 +0000)]
Use a 64-bit integer for pcitag_t and define PCITAG_NODE and PCITAG_OFFSET
macros to make kernel build again, same diff as armv7.
ok kettenis visa

2 years agoAdd regress tests for ASN1_BIT_STRING.
jsing [Thu, 6 Jan 2022 15:21:33 +0000 (15:21 +0000)]
Add regress tests for ASN1_BIT_STRING.

2 years agoAdd a comment that explains why build_addr_block_tests isn't const
tb [Thu, 6 Jan 2022 14:55:52 +0000 (14:55 +0000)]
Add a comment that explains why build_addr_block_tests isn't const

2 years agoConvert SCT verification to CBB.
jsing [Thu, 6 Jan 2022 14:34:40 +0000 (14:34 +0000)]
Convert SCT verification to CBB.

ok inoguchi@ tb@

2 years agoSync from libssl.
jsing [Thu, 6 Jan 2022 14:32:55 +0000 (14:32 +0000)]
Sync from libssl.

2 years agoTest CBB_add_u64()
jsing [Thu, 6 Jan 2022 14:31:03 +0000 (14:31 +0000)]
Test CBB_add_u64()

2 years agoProvide CBB_add_u64()
jsing [Thu, 6 Jan 2022 14:30:30 +0000 (14:30 +0000)]
Provide CBB_add_u64()

Prompted by and ok tb@

2 years agominor tweaks, no code change
tb [Thu, 6 Jan 2022 14:08:15 +0000 (14:08 +0000)]
minor tweaks, no code change

Adjust a comment to reality, zap a stray empty line and fix whitespace
before comment after #endif

2 years agoWith openssl-ruby-tests 20220105, test_post_connection_check_wildcard_san
tb [Thu, 6 Jan 2022 13:36:56 +0000 (13:36 +0000)]
With openssl-ruby-tests 20220105, test_post_connection_check_wildcard_san
is now an unexpected pass, so remove it from the expected failures.

2 years agoMake it possible to compile the patterns utility with the source tree
anton [Thu, 6 Jan 2022 13:18:36 +0000 (13:18 +0000)]
Make it possible to compile the patterns utility with the source tree
checked out anywhere.

While here, tidy up the Makefile a bit.

ok deraadt@

2 years agoFree memory before assign to avoid leak
inoguchi [Thu, 6 Jan 2022 12:54:51 +0000 (12:54 +0000)]
Free memory before assign to avoid leak

CID 313263 313301 313322

2 years agoFree memory if error occurred
inoguchi [Thu, 6 Jan 2022 11:46:05 +0000 (11:46 +0000)]
Free memory if error occurred

2 years agoRemove NULL check before free
inoguchi [Thu, 6 Jan 2022 11:37:29 +0000 (11:37 +0000)]
Remove NULL check before free

2 years agoFix a copy-paste error that led to an out-of-bounds access.
tb [Thu, 6 Jan 2022 09:46:05 +0000 (09:46 +0000)]
Fix a copy-paste error that led to an out-of-bounds access.

Found via a crash on bluhm's i386 regress test box

2 years agoUse a 64-bit integer for pcitag_t and define PCITAG_NODE and PCITAG_OFFSET
kettenis [Thu, 6 Jan 2022 08:46:50 +0000 (08:46 +0000)]
Use a 64-bit integer for pcitag_t and define PCITAG_NODE and PCITAG_OFFSET
macros to make armv7 build again.

ok deraadt@

2 years agoIgnore windows without a size set (may be used for pane only), from
nicm [Thu, 6 Jan 2022 08:20:00 +0000 (08:20 +0000)]
Ignore windows without a size set (may be used for pane only), from
Anindya Mukherjee.

2 years agoregen
jsg [Thu, 6 Jan 2022 06:19:41 +0000 (06:19 +0000)]
regen

2 years agoati 0x15e7 confirmed to be barcelo, 2022 ryzen 5000 apus
jsg [Thu, 6 Jan 2022 06:19:11 +0000 (06:19 +0000)]
ati 0x15e7 confirmed to be barcelo, 2022 ryzen 5000 apus
uses the same green sardine firmware as cezanne

2 years agoAdd test coverage for SCT validation.
jsing [Thu, 6 Jan 2022 04:42:00 +0000 (04:42 +0000)]
Add test coverage for SCT validation.

Of note, the public APIs for this mean that the only way you can add a
CTLOG is by reading a configuration file from disk - there is no
programmatic way to do this.

2 years agot_syscall was a test for the gcc 1.x off_t syscall padding,
guenther [Thu, 6 Jan 2022 03:30:15 +0000 (03:30 +0000)]
t_syscall was a test for the gcc 1.x off_t syscall padding,
which was an implementation detail and has been deleted, so
delete the test

2 years agodrm/amdgpu: add support for IP discovery gc_info table v2
jsg [Thu, 6 Jan 2022 01:40:19 +0000 (01:40 +0000)]
drm/amdgpu: add support for IP discovery gc_info table v2

From Alex Deucher
b8553330a07749e488d143b5704adf1042fd7c0a in linux 5.10.y/5.10.90
5e713c6afa34c0fd6f113bf7bb1c2847172d7b20 in mainline linux

2 years agodrm/amdgpu: When the VCN(1.0) block is suspended, powergating is explicitly enabled
jsg [Thu, 6 Jan 2022 01:37:46 +0000 (01:37 +0000)]
drm/amdgpu: When the VCN(1.0) block is suspended, powergating is explicitly enabled

From chen gong
28863ffe21ff711d5109e3c208676258bdec3a1f in linux 5.10.y/5.10.90
b7865173cf6ae59942e2c69326a06e1c1df5ecf6 in mainline linux

2 years agounstub amdgpu_gem_force_release()
jsg [Thu, 6 Jan 2022 01:14:15 +0000 (01:14 +0000)]
unstub amdgpu_gem_force_release()

2 years agoadd a comment so I don't make this mistake again
djm [Wed, 5 Jan 2022 21:54:37 +0000 (21:54 +0000)]
add a comment so I don't make this mistake again

2 years agofix cut-and-pasto in error message
djm [Wed, 5 Jan 2022 21:50:00 +0000 (21:50 +0000)]
fix cut-and-pasto in error message

2 years agono longer needed
deraadt [Wed, 5 Jan 2022 21:45:27 +0000 (21:45 +0000)]
no longer needed

2 years agofunopen(): change seekfn argument to use off_t, not fpos_t
millert [Wed, 5 Jan 2022 20:57:27 +0000 (20:57 +0000)]
funopen(): change seekfn argument to use off_t, not fpos_t
On BSD, fpos_t is typedef'd to off_t but some systems use a struct.
This means fpos_t is not a portable function argument or return value.
Both FreeBSD and the Linux libbsd funopen() have switched to off_t
for this--we should too.  From Joe Nelson.  OK deraadt@

2 years agoPrepare to provide DSA_bits()
tb [Wed, 5 Jan 2022 20:52:14 +0000 (20:52 +0000)]
Prepare to provide DSA_bits()

Used by Qt5 and Qt6 and slightly reduces the patching in there.

ok inoguchi jsing

2 years agoPrepare to provide BIO_set_retry_reason()
tb [Wed, 5 Jan 2022 20:48:44 +0000 (20:48 +0000)]
Prepare to provide BIO_set_retry_reason()

Needed by freerdp.

ok inoguchi jsing

2 years agoPrepare to provide a number of RSA accessors
tb [Wed, 5 Jan 2022 20:44:12 +0000 (20:44 +0000)]
Prepare to provide a number of RSA accessors

This adds RSA_get0_{n,e,d,p,q,dmp1,dmq1,iqmp,pss_params}() which will
be exposed in the upcoming bump.

ok inoguchi jsing

2 years agoPrepare to provide ECDSA_SIG_get0_{r,s}()
tb [Wed, 5 Jan 2022 20:39:04 +0000 (20:39 +0000)]
Prepare to provide ECDSA_SIG_get0_{r,s}()

ok inoguchi jsing

2 years agoPrepare to provide DH_get_length()
tb [Wed, 5 Jan 2022 20:36:29 +0000 (20:36 +0000)]
Prepare to provide DH_get_length()

Will be needed by openssl(1) dhparam.

ok inoguchi jsing

2 years agoPrepare to provide DSA_get0_{p,q,g,{priv,pub}_key}()
tb [Wed, 5 Jan 2022 20:33:49 +0000 (20:33 +0000)]
Prepare to provide DSA_get0_{p,q,g,{priv,pub}_key}()

ok inoguchi jsing

2 years agoPrepare to provide DH_get0_{p,q,g,{priv,pub}_key}()
tb [Wed, 5 Jan 2022 20:30:16 +0000 (20:30 +0000)]
Prepare to provide DH_get0_{p,q,g,{priv,pub}_key}()

These are accessors that allow getting one specific DH member. They are
less error prone than the current getters DH_get0_{pqg,key}(). They
are used by many ports and will also be used in base for this reason.

Who can remember whether the pub_key or the priv_key goes first in
DH_get0_key()?

ok inoguchi jsing

2 years agoPrepare to provide BIO_set_next().
tb [Wed, 5 Jan 2022 20:22:26 +0000 (20:22 +0000)]
Prepare to provide BIO_set_next().

This will be needed in libssl and freerdp after the next bump.

ok inoguchi jsing

2 years agoPrepare to provide X509_{set,get}_verify() and X509_STORE_get_verify_cb()
tb [Wed, 5 Jan 2022 20:18:19 +0000 (20:18 +0000)]
Prepare to provide X509_{set,get}_verify() and X509_STORE_get_verify_cb()
as well as the X509_STORE_CTX_verify_cb and X509_STORE_CTX_verify_fn types

This will fix the X509_STORE_set_verify_func macro which is currently
broken, as pointed out by schwarze.

ok inoguchi jsing

2 years agoUse "bus-range" property to initialize the bus number configuration of
kettenis [Wed, 5 Jan 2022 18:54:20 +0000 (18:54 +0000)]
Use "bus-range" property to initialize the bus number configuration of
the bridge when present on FDT platforms.  Needed on platforms like the
Apple M1 to make sure the PCI bus numbers match the IOMMU setup required
by the device tree.

ok patrick@

2 years agoincrease lifetime of wtmp, since it is annoyingly short
deraadt [Wed, 5 Jan 2022 18:34:23 +0000 (18:34 +0000)]
increase lifetime of wtmp, since it is annoyingly short
discussed with millert

2 years agoUnindent a few lines of code and avoid shadowed variables.
tb [Wed, 5 Jan 2022 18:01:27 +0000 (18:01 +0000)]
Unindent a few lines of code and avoid shadowed variables.

2 years agoRename {c,p}_{min,max} into {child,parent}_{min,max}
tb [Wed, 5 Jan 2022 17:55:33 +0000 (17:55 +0000)]
Rename {c,p}_{min,max} into {child,parent}_{min,max}

2 years agoRemove kbind(2)'s restriction that a target buffer not cross page
guenther [Wed, 5 Jan 2022 17:53:44 +0000 (17:53 +0000)]
Remove kbind(2)'s restriction that a target buffer not cross page
boundaries: hppa has 8-byte PLT entries that sometimes do that.

ok kettenis@

2 years agoTwo minor KNF tweaks
tb [Wed, 5 Jan 2022 17:53:42 +0000 (17:53 +0000)]
Two minor KNF tweaks

2 years agoUse child_aor and parent_aor instead of aorc and aorp
tb [Wed, 5 Jan 2022 17:52:28 +0000 (17:52 +0000)]
Use child_aor and parent_aor instead of aorc and aorp

suggested by jsing

2 years agoRename fp and fc into parent_af and child_af for readability.
tb [Wed, 5 Jan 2022 17:51:30 +0000 (17:51 +0000)]
Rename fp and fc into parent_af and child_af for readability.

suggested by jsing

2 years agoGlobally rename all IPAddressFamily *f into af since this is slightly
tb [Wed, 5 Jan 2022 17:49:39 +0000 (17:49 +0000)]
Globally rename all IPAddressFamily *f into af since this is slightly
more readable.

Repeated complaints by jsing

2 years agoAdd a helper function to turn unchecked (but sound) use of
tb [Wed, 5 Jan 2022 17:46:44 +0000 (17:46 +0000)]
Add a helper function to turn unchecked (but sound) use of
sk_find + sk_value into something easier to follow and swallow.

ok inoguchi jsing

2 years agoHoist IPAddressFamily_cmp() to the other IPAddressFamily functions.
tb [Wed, 5 Jan 2022 17:44:30 +0000 (17:44 +0000)]
Hoist IPAddressFamily_cmp() to the other IPAddressFamily functions.

ok inoguchi jsing

2 years agoCall x a cert for readability.
tb [Wed, 5 Jan 2022 17:43:04 +0000 (17:43 +0000)]
Call x a cert for readability.

2 years agoNow that i is free, rename j to i for use as loop variable in
tb [Wed, 5 Jan 2022 17:41:41 +0000 (17:41 +0000)]
Now that i is free, rename j to i for use as loop variable in
various loops in addr_validate_path_internal().

2 years agoadjust Xr for fw_update to section 8;
jmc [Wed, 5 Jan 2022 17:39:24 +0000 (17:39 +0000)]
adjust Xr for fw_update to section 8;
ok afresh sthen deraadt

2 years agoIn addr_validate_path_internal() rename i to depth because that's
tb [Wed, 5 Jan 2022 17:38:14 +0000 (17:38 +0000)]
In addr_validate_path_internal() rename i to depth because that's
what it is.

2 years agoTurn the validation_err() macro into a function
tb [Wed, 5 Jan 2022 17:36:32 +0000 (17:36 +0000)]
Turn the validation_err() macro into a function

validation_err() is an ugly macro with side effects and a goto in it.
At the cost of a few lines of code we can turn this into a function
where the side effects are explicit and ret is now explicitly set in
the main body of addr_validate_path_internal().

We get to a point where it is halfway possible to reason about the
convoluted control flow in this function.

ok inoguchi jsing

2 years agoMove variable declarations in X509v3_addr_canonize() to the top of
tb [Wed, 5 Jan 2022 17:27:40 +0000 (17:27 +0000)]
Move variable declarations in X509v3_addr_canonize() to the top of
the function and unindent some code.

ok inoguchi jsing

2 years agoRevise for tls13_key_share rename.
jsing [Wed, 5 Jan 2022 17:10:59 +0000 (17:10 +0000)]
Revise for tls13_key_share rename.

2 years agoRename tls13_key_share to tls_key_share.
jsing [Wed, 5 Jan 2022 17:10:02 +0000 (17:10 +0000)]
Rename tls13_key_share to tls_key_share.

In preparation to use the key share code in both the TLSv1.3 and legacy
stacks, rename tls13_key_share to tls_key_share, moving it into the shared
handshake struct. Further changes will then allow the legacy stack to make
use of the same code for ephemeral key exchange.

ok inoguchi@ tb@

2 years agoRemove unused function arguments in iwm/iwx interrupt handlers.
stsp [Wed, 5 Jan 2022 17:06:20 +0000 (17:06 +0000)]
Remove unused function arguments in iwm/iwx interrupt handlers.

pointed out by + ok millert@

2 years agoSwitch snmpd(8) to using EVP_Digest{Init,Final}_ex() and drop a no
tb [Wed, 5 Jan 2022 17:01:06 +0000 (17:01 +0000)]
Switch snmpd(8) to using EVP_Digest{Init,Final}_ex() and drop a no
longer needed EVP_MD_CTX_reset().

ok martijn

2 years agosync
deraadt [Wed, 5 Jan 2022 16:46:55 +0000 (16:46 +0000)]
sync

2 years agoCompensate for i386 pcitag_t union
deraadt [Wed, 5 Jan 2022 16:46:11 +0000 (16:46 +0000)]
Compensate for i386 pcitag_t union
ok jsg kettenis

2 years agoAdd error checking for EVP_Digest* to snmpd(8).
tb [Wed, 5 Jan 2022 16:41:42 +0000 (16:41 +0000)]
Add error checking for EVP_Digest* to snmpd(8).

ok martijn

2 years agoAdd error checking for EVP_Digest*() to snmp(1).
tb [Wed, 5 Jan 2022 16:41:07 +0000 (16:41 +0000)]
Add error checking for EVP_Digest*() to snmp(1).

ok martijn

2 years agoUse new shell-based fw_update(8)
deraadt [Wed, 5 Jan 2022 16:35:33 +0000 (16:35 +0000)]
Use new shell-based fw_update(8)
with afresh1

2 years agoIn iwx(4), fix wrong pointer assignment in iwx_bar_frame_release().
stsp [Wed, 5 Jan 2022 16:33:42 +0000 (16:33 +0000)]
In iwx(4), fix wrong pointer assignment in iwx_bar_frame_release().

This bug caused the driver to read block ack request information sent
by firmware from the wrong offset. The driver flushes buffered frames
and moves its Rx block ack window based on this information. Possible
consequences of this bug are packet loss or even stalled traffic if
the Rx BA window gets out of sync between driver and firmware. Though
this effect might get cancelled out when the driver re-syncs the BA
window in its regular Rx code path.

Spotted by Christian Ehrhardt.

2 years agoCommit the correct version of fw_update
afresh1 [Wed, 5 Jan 2022 16:32:46 +0000 (16:32 +0000)]
Commit the correct version of fw_update

Sigh.

2 years agoAdd the shell based fw_update and updated man page
afresh1 [Wed, 5 Jan 2022 16:28:19 +0000 (16:28 +0000)]
Add the shell based fw_update and updated man page

This allows installing firmware from the installer without having
to wait to boot into a live system.

commit deraadt@

2 years agoWe are moving back to a shell-script based fw_update, written in such a
deraadt [Wed, 5 Jan 2022 16:24:29 +0000 (16:24 +0000)]
We are moving back to a shell-script based fw_update, written in such a
way that the install script can also run it. This allows earlier retrieval
of downloaded firmwares, based upon patterns found in dmesg.
many iterations of this in snaps for about a month.

2 years agoformatting nit, noticed by jmc@, thx!
espie [Wed, 5 Jan 2022 14:50:03 +0000 (14:50 +0000)]
formatting nit, noticed by jmc@, thx!

2 years agoWrap long lines and add some braces
inoguchi [Wed, 5 Jan 2022 13:41:12 +0000 (13:41 +0000)]
Wrap long lines and add some braces

2 years agoUse LC_CTYPE instead of LC_ALL.
martijn [Wed, 5 Jan 2022 13:27:04 +0000 (13:27 +0000)]
Use LC_CTYPE instead of LC_ALL.
Makes regress pass when LC_CTYPE is set.

Found by and OK tb@

2 years agoCheck function return value
inoguchi [Wed, 5 Jan 2022 12:51:49 +0000 (12:51 +0000)]
Check function return value

2 years agoChecking pointer variable with NULL
inoguchi [Wed, 5 Jan 2022 11:38:19 +0000 (11:38 +0000)]
Checking pointer variable with NULL

2 years agoSwitch proc_parser_root_cert() to not pass the entity but instead the
claudio [Wed, 5 Jan 2022 11:07:35 +0000 (11:07 +0000)]
Switch proc_parser_root_cert() to not pass the entity but instead the
file, pkey and tal id. This is the last proc_parser function that needed
to be converted.
OK job@

2 years agodhcpd: straightforward conversion to HMAC_CTX on the heap, similar
tb [Wed, 5 Jan 2022 11:01:59 +0000 (11:01 +0000)]
dhcpd: straightforward conversion to HMAC_CTX on the heap, similar
to what was done in spamd a while back.

ok florian

2 years agosnmpd: Straightforward conversion to EVP_* on the heap.
tb [Wed, 5 Jan 2022 11:00:49 +0000 (11:00 +0000)]
snmpd: Straightforward conversion to EVP_* on the heap.
It would be nice if someone added error checking for the EVP_Digest*
calls.

tested by & ok martijn

2 years agoStraightforward conversion to EVP_* on the heap.
tb [Wed, 5 Jan 2022 10:59:21 +0000 (10:59 +0000)]
Straightforward conversion to EVP_* on the heap.

ok martijn

2 years agoUse calloc instead of malloc
inoguchi [Wed, 5 Jan 2022 10:33:36 +0000 (10:33 +0000)]
Use calloc instead of malloc

suggested by tb@

2 years agoCheck NULL first and unindent the rest of the code
inoguchi [Wed, 5 Jan 2022 10:29:08 +0000 (10:29 +0000)]
Check NULL first and unindent the rest of the code

suggested by tb@

2 years agoConvert openssl(1) cms option handling
inoguchi [Wed, 5 Jan 2022 10:01:39 +0000 (10:01 +0000)]
Convert openssl(1) cms option handling

Just applying new option handling and no functional changes.
Referred to verify.c and using 'verify_shared_options'.

ok and comments from jsing@ and tb@

2 years agoProvide regress for SSL public APIs.
jsing [Wed, 5 Jan 2022 09:59:39 +0000 (09:59 +0000)]
Provide regress for SSL public APIs.

This will largely test curly and inconsistent APIs that are not covered by
other regress tests. Currently, this tests the wonder that is
SSL_get_peer_cert_chain().

2 years agodocument -m
espie [Wed, 5 Jan 2022 09:19:15 +0000 (09:19 +0000)]
document -m

2 years agoselect all RSA hostkey algorithms for UpdateHostkeys tests, not just
djm [Wed, 5 Jan 2022 08:25:05 +0000 (08:25 +0000)]
select all RSA hostkey algorithms for UpdateHostkeys tests, not just
RSA-SHA1

2 years agoRemove bandaid to work around expected range_should_be_prefix() problem.
tb [Wed, 5 Jan 2022 07:50:40 +0000 (07:50 +0000)]
Remove bandaid to work around expected range_should_be_prefix() problem.

2 years agoRemove a bogus memcmp in range_should_be_prefix()
tb [Wed, 5 Jan 2022 07:47:15 +0000 (07:47 +0000)]
Remove a bogus memcmp in range_should_be_prefix()

range_should_be_prefix() currently always fails. The reason for this
is that OpenSSL commit 42d7d7dd incorrectly moved a memcmp() out of
an assertion.  As a consequence, the library emits and accepts
incorrectly encoded ipAddrBlock extensions since it will never detect
ranges that MUST be encoded as a prefix according to RFC 3779, 2.2.3.7.

The return -1 from this memcmp() indicates to the callers that the
range should be expressed as a range, so callers must check beforehand
that min <= max to be able to fail. Thus, remove this memcmp() and
add a check to make_addressRange(), the only caller that didn't already
ensure that min <= max.

This fixes the noisy output in regress/lib/libcrypto/x509/rfc3779.

ok inoguchi jsing

2 years agoPolish X509v3_addr_subset() a bit
tb [Wed, 5 Jan 2022 07:37:01 +0000 (07:37 +0000)]
Polish X509v3_addr_subset() a bit

Use child and parent instead of a and b. Split unrelated checks. Use
accessors and assign to local variables to avoid ugly line wrapping.
Declare vriables up front instead of mixing declarations with
assignments from function returns.

ok inoguchi jsing

2 years agoReadability tweaks in addr_contains()
tb [Wed, 5 Jan 2022 07:29:47 +0000 (07:29 +0000)]
Readability tweaks in addr_contains()

Assign to local variables to avoid ugly line wrapping.

ok inoguchi jsing

2 years agoFix a bug in addr_contains() introduced in OpenSSL commit be71c372
tb [Wed, 5 Jan 2022 07:28:41 +0000 (07:28 +0000)]
Fix a bug in addr_contains() introduced in OpenSSL commit be71c372
by returning 0 instead of -1 on extract_min_max() failure. Callers
would interpret -1 as success of addr_contains().

ok inoguchi jsing

2 years agoadd a basic printer for EAPOL packets.
dlg [Wed, 5 Jan 2022 05:53:03 +0000 (05:53 +0000)]
add a basic printer for EAPOL packets.

EAPOL turns out to be a little container for a bunch of other types
of packets, including EAP for use with vanilla 802.1X, a kind of
capability announcement thing, and MACsec Key Agreement.

it's not worth adding a separately file for such a small chunk of
functionality, and it seems specific to ethernet. parsers/printers
for the sub protocols can come later if needed.

ok deraadt@ visa@

2 years agoethertypes.h has now added the missing ethertypes we're looking at here.
dlg [Wed, 5 Jan 2022 05:47:53 +0000 (05:47 +0000)]
ethertypes.h has now added the missing ethertypes we're looking at here.

2 years agofix some more -Wunused-but-set-variable
dlg [Wed, 5 Jan 2022 05:46:18 +0000 (05:46 +0000)]
fix some more -Wunused-but-set-variable

2 years agofix another -Wunused-but-set-variable
dlg [Wed, 5 Jan 2022 05:41:25 +0000 (05:41 +0000)]
fix another -Wunused-but-set-variable