1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-09 22:38:01 -08:00
Commit Graph

8008 Commits

Author SHA1 Message Date
job
e0b59cc71b Add json.c to linker instructions 2023-05-30 15:56:47 +00:00
krw
45a3c7e1ab sparc64 disklabel(8) must be compiled with SUN_CYLCHECK and SUN_AAT0.
sparc64 auto allocation during install does not use fdisk(8).

Add *.sparc64.ok files that reflect sparc64 reality.

Should fix disklabel(8) regression on sparc64.

Requested by & ok bluhm@
2023-05-30 15:10:39 +00:00
claudio
0876134d17 Revert commitid ANSBO0rBvIUtTi45:
Make rpki-client choose the verification time of the time it is invoked
   rather than always getting the current system time for every certificate
   verification. This will result in output that is not variable on run-time.

Using the time of invocation does not work well with fast publishing CAs. It
can take a few minutes to reach a repo and that CA may have issued certificates
that are not yet valid if that startup time of rpki-client is used to validate.

This still keeps the -P option to specify a fixed validation time.
OK beck@ job@ tb@
2023-05-30 12:14:48 +00:00
beck
5898fc2b25 Correct test that was pasto'ed incorrectly
This now tests what the comment says it does
2023-05-29 15:52:46 +00:00
beck
f5d1ae505e Make X509_NAME_get_text_by[NID|OBJ] safer.
This is an un-revert with nits of the previously landed change
to do this which broke libtls. libtls has now been changed to
not use this function.

This change ensures that if something is returned it is "text"
(UTF-8) and a C string not containing a NUL byte. Historically
callers to this function assume the result is text and a C string
however the OpenSSL version simply hands them the bytes from an
ASN1_STRING and expects them to know bad things can happen which
they almost universally do not check for. Partly inspired by
goings on in boringssl.

ok jsing@ tb@
2023-05-29 11:54:50 +00:00
beck
f23ec8ef09 Refactor tls_check_common_name to use lower level API.
X509_NAME_get_text_by_NID is kind of a bad interface that
we wish to make safer, and does not give us the visibility
we really want here to detect hostile things.

Instead call the lower level functions to do some better
checking that should be done by X509_NAME_get_text_by_NID,
but is not in the OpenSSL version. Specifically we will treat
the input as hostile and fail if:

1) The certificate contains more than one CN in the subject.
2) The CN does not decode as UTF-8
3) The CN is of invalid length (must be between 1 and 64 bytes)
4) The CN contains a 0 byte

4) matches the existing logic, 1 and 2, and 3 are new checks.

ok tb@
2023-05-28 09:02:01 +00:00
jsing
8a60fc3bc8 Add coverage for calling BN_{dec,hex}2bn() with NULL inputs. 2023-05-27 15:50:56 +00:00
bluhm
ce018c3c11 Skip tests if p5-BSD-Socket-Splice is not installed. 2023-05-24 20:31:49 +00:00
bluhm
d662361922 Default pf rule "block return; pass" interferes with test.
Use "block; pass" instead.
2023-05-24 11:52:30 +00:00
tb
5c7ffd3288 Copy the verify param hostflags independently of the host list
Without this, hostflags set on the SSL_CTX would not propagate to newly
created SSL. This is surprising behavior that was changed in OpenSSL 1.1
by Christian Heimes after the issue was flagged by Quentin Pradet:
https://bugs.python.org/issue43522
This is a version of the fix that landed in OpenSSL.

There used to be a workaround in place in urllib3, but that was removed at
some point. We haven't fixed this earlier since it wasn't reported. It only
showed up after recent fallout of extraordinarily strict library checking
in urllib3 coming from their own interpretation of the implications of
PEP 644.

ok jsing
2023-05-24 09:15:14 +00:00
tb
90fab13908 Add a test to verify that an SSL inherits the hostflags from the SSL_CTX
This is currently an expected failure that will be fixed shortly.
2023-05-24 08:54:59 +00:00
tb
0cc069c764 Provide CRYPTO_INT for statically linking libcrypto for libssl regress
This will be needed for the ssl_verify_param test
2023-05-24 08:49:06 +00:00
tb
cf62a661e0 Add empty line for consistency 2023-05-23 11:06:52 +00:00
tb
6183aea1d1 Add regress coverage for obj_dat.c r1.52 2023-05-23 11:05:09 +00:00
claudio
fc405d53b7 Don't use ibuf_open(0) as test. 0 lenght ibufs make little sense and
result in a malloc(0) call which is no bueno. Use ibuf_open(1) instead.
OK miod@
2023-05-23 09:32:37 +00:00
tb
e8736803f1 Bye, bye, horrible reacharounds into libcrypto
Now that rpki-client no longer uses LibreSSL-specific ASN1_time_* API,
we can get rid of some of the gross hacks needed for testing against
OpenSSL in regress. This simplifies things greatly.

Unfortunately, the unistd.h hack needs to stay until someone unearths
their STACK_OF compat diffs.
2023-05-22 15:20:16 +00:00
tb
2369b3d44d ecdhtest: Fix indent 2023-05-20 16:00:22 +00:00
tb
6a9ebb2fe8 Add a slow regress target that runs openssl speed with proper alignment
and with an unaligned offset. Let's see if all ciphers on our strict
alignment arches can deal with this.
2023-05-20 12:07:21 +00:00
djm
b349d29252 add LTESTS_FROM variable to allow skipping of tests up to a specific
point. e.g. "make LTESTS_FROM=t-sftp" will only run the sftp.sh test
and subsequent ones. ok dtucker@
2023-05-17 05:52:01 +00:00
tb
062268a7fa ecdhtest: check malloc() return values
From Ilya Chipitsine
2023-05-16 18:41:18 +00:00
dv
3c817da7c9 vmm(4)/vmd(8): switch to anonymous shared mappings.
While splitting out emulated virtio network and block devices into
separate processes, I originally used named mappings via shm_mkstemp(3).
While this functionally achieved the desired result, it had two
unintended consequences:

1) tearing down a vm process and its child processes required
excessive locking as the guest memory was tied into the VFS layer.

2) it was observed by mlarkin@ that actions in other parts of the
VFS layer could cause some of the guest memory to flush to storage,
possibly filling /tmp.

This commit adds a new vmm(4) ioctl dedicated to allowing a process
request the kernel share a mapping of guest memory into its own vm
space. This requires an open fd to /dev/vmm (requiring root) and
both the "vmm" and "proc" pledge(2) promises. In addition, the caller
must know enough about the original memory ranges to reconstruct them
to make the vm's ranges.

Tested with help from Mischa Peters.

ok mlarkin@
2023-05-13 23:15:28 +00:00
tb
9b0855c6d8 Assert that test->want != NULL at this point
Should make coverity happier
2023-05-13 07:17:32 +00:00
tb
193c648312 asn1oct: add a couple more tests 2023-05-12 10:43:28 +00:00
tb
52bf25b24e asn1oct: minor tweak in error message 2023-05-12 08:56:05 +00:00
tb
51de66fb3a Add regress coverage for {s2i,i2s}_ASN1_OCTET_STRING 2023-05-12 08:28:05 +00:00
djm
bfb0999009 test ChrootDirectory in Match block 2023-05-12 06:37:42 +00:00
djm
86d79ac85d better error messages 2023-05-12 06:36:27 +00:00
guenther
e9dcde5677 Teach dump_tables about PKs and display non-readable pages as such 2023-05-11 22:28:38 +00:00
otto
6ca44032e7 Make malloc tests that set flags more robust against the user also
having flags set.
2023-05-09 19:07:37 +00:00
tb
b584737232 Add regress coverage for -1 modulus as well. 2023-05-09 05:39:24 +00:00
otto
81678eb090 Enable malloc_errs test 2023-05-08 11:13:30 +00:00
otto
83821b1ea0 Add a regress test to test various malloc API and heap mismanagement
errors which should cause abort. A few are not enabled yet, they
will be once the corresponding diffs in malloc are committed.
2023-05-08 11:12:44 +00:00
tb
e253a7cc21 symbols.awk: Remove cfb dance
With e_old.c gone, we no longer need this.
2023-05-04 20:15:27 +00:00
tb
e20de6bd7c sigh. typo 2023-05-04 13:50:14 +00:00
tb
48185ea66a Let ecdsatest exercise ECParameters_dup() a bit
This currently leaks, which will fixed in a follow-on commit.
2023-05-04 13:49:29 +00:00
tb
5fcb6f2258 Remove x9_62_test_internal()
This test depends on RAND_set_rand_method() allowing stupid things like
making ECDSA signatures deterministic. This was gutted a long time ago
and the function should have followed its wrappers into the attic.
2023-05-04 13:41:20 +00:00
beck
c883d2fc30 Revert utf-8 fix for X509_NAME_get_index_by_NID to avoid libtls
regress for the moment.  this will come back after we rethink
the failure versus not there case.

ok tb@ jsing@
2023-05-03 08:10:23 +00:00
beck
de9b195a9c Change X509_NAME_get_index_by[NID|OBJ] to be safer.
Currently these functions return raw ASN1_STRING bytes as
a C string and ignore the encoding in a "hold my beer I am
a toolkit not a functioning API surely it's just for testing
and you'd never send nasty bytes" kind of way.

Sadly some callers seem to use them to fetch things liks
subject name components for comparisons, and often just
use the result as a C string.

Instead, encode the resulting bytes as UTF-8 so it is
something like "text",

Add a failure case if the length provided is inadequate
or if the resulting text would contain an nul byte.

based on boringssl.

nits by dlg@
ok tb@
2023-05-02 14:13:05 +00:00
schwarze
e982dbc862 Mark the BIO_F_* function codes as intentionally undocumented
and for now, skip the the BIO_R_* reason codes.
It looks like all public symbols in the BIO library
are now documented or marked as intentionally undocumented.
2023-05-02 13:15:05 +00:00
tb
845c6a7399 Simplify slightly and use i2d_PKCS7_bio_stream()
This is a wrapper of i2d_ASN1_bio_stream() that doesn't require us to
pass in PKCS7_it.
2023-05-02 09:30:37 +00:00
job
3dbd52dfc1 Make warnings more precise 2023-05-01 11:02:23 +00:00
tb
5369d03540 x509_asn1: make this test pass again after reinstating DER preservation 2023-04-30 21:31:16 +00:00
tb
30e9f0bb03 check_complete.pl: update for recent changes in bn 2023-04-30 20:33:31 +00:00
tb
eb7a1b1add Sort alphabetically 2023-04-30 05:02:59 +00:00
tb
d08f134996 Remove unnecessary target 2023-04-30 04:59:20 +00:00
tb
3b5acced0d policy test: simplify Makefile 2023-04-30 04:55:30 +00:00
bluhm
d372de4fdb Run open rsync and ports rsync programs against each other using
the --rsync-path option.  So we can see whether the tests pass in
all interoperability combinations.
Suggested by claudio@
2023-04-29 00:20:46 +00:00
schwarze
18be3cce30 adjust after man_validate.c rev. 1.128 improved the error messages 2023-04-28 20:34:26 +00:00
bluhm
e6a9832747 Execute each test as make target. Remove the shell wrapper. Mark
failing test so that claudio@ can fix them.
2023-04-28 19:41:07 +00:00
job
b0c625892f Free all libcrypto global state memory before returning
Found with the help of Otto's malloc memory leak detector!
2023-04-28 18:32:40 +00:00
job
cea08c0a7a Return a non-zero error exit code on any DER cache discrepancies 2023-04-28 18:31:34 +00:00
tb
e17ab34e70 Fix leaks reported by ASAN
debugged with job
2023-04-28 18:27:49 +00:00
schwarze
2188fc5dbd Mark the obsolete PROXY_PARAM and SOCKS BIO_ctrl(3) command constants
as intentionally undocumented.  Do that here because no related
manual pages exist.
2023-04-28 16:59:03 +00:00
beck
7d883af911 Enable policy checking by default now that we are DAG implementation based.
This ensures that we will no longer silently ignore a certificate with
a critical policy extention by default.

ok tb@
2023-04-28 16:50:16 +00:00
claudio
3a0ab0b7dc Import rsync regress provided by Martin Cracauer so that bluhm@ can work
improve it in tree.
2023-04-28 16:28:28 +00:00
tb
56597df0a4 The policy test is no longer expected to fail 2023-04-28 16:18:17 +00:00
job
5f3a4f441a Rearrange freeing of memory in the regress test 2023-04-28 15:12:51 +00:00
tb
630f168f1e make the policy test compile on sparc64 2023-04-28 14:45:51 +00:00
job
a4301a112d Add X509_REQ_add_extensions and to X509_REQ_add1_attr to DER cache test
These new tests won't bubble up a non-zero error exit code because
other libcrypto bits still need to land first.
2023-04-28 13:48:38 +00:00
beck
5d942c1352 Hook up the the x509 policy regression tests to x509 regress.
These were adapted from BoringSSL's regress tests for x509
policy. They are currently marked as expected to fail as
we have not enabled LIBRESSL_HAS_POLICY_DAG by default yet, and
the old tree based policy code from OpenSSL is special.

These tests pass when we build with LIBRESSL_HAS_POLICY_DAG.
2023-04-28 09:11:35 +00:00
beck
b4d45f74c4 Fix copyright, convert boringssl comments to C style 2023-04-28 09:02:04 +00:00
beck
e9f3370e63 KNF
ok knfmt
2023-04-28 08:53:20 +00:00
beck
dfcebad6cf remove unused code. 2023-04-28 08:50:08 +00:00
beck
e2fa1da15d remove debugging printf 2023-04-28 08:45:50 +00:00
beck
95cce6dbe5 This test should not have V_EXPLICIT_POLICY set. with this
corrected we pass
2023-04-28 08:43:18 +00:00
beck
87535099c5 Add the rest of the boringssl policy unit tests.
We currently still fail two of these, looks like one more bug in
extracting the depth for require policy from the certificate..
2023-04-28 08:15:11 +00:00
beck
58ea120d66 correct test cases to add expected errors. 2023-04-27 13:26:57 +00:00
beck
11e92b75c2 Start of an x509 policy regress test. test cases from BoringSSL.
Still a work in progress adapting tests from boringssl x509_test.cc
but dropping in here for tb to be able to look at and run as well
since the new stuff still has bugs.
2023-04-27 12:23:31 +00:00
tb
f313d342a2 tlsexttest: check additional logic in tlsext randomization
This verifies that we put PSK always last and that the Apache 2 special
does what it is supposed to do. There is also some weak validation of
the Fisher-Yates shuffle that will likely catch errors introduced in
tlsext_randomize_build_order()
2023-04-27 10:53:58 +00:00
beck
f0813572b9 Make rpki-client choose the verification time of the time it is invoked
rather than always getting the current system time for every certificate
verification. This will result in output that is not variable on run-time.

ok tb@ claudio@
2023-04-27 08:37:53 +00:00
claudio
d6d042a578 Unbreak regress after yesterdays churn.
Friendly reminder from anton@
2023-04-27 06:11:43 +00:00
anton
a6c219455f cope with recent vmm changes 2023-04-27 05:42:44 +00:00
job
4962ea4335 Add test for invalidation of DER cache for X509_CRL_* setter functions
The program won't exit with a non-zero exit code if X509_CRL_set_*
tests fail, as the relevant bits haven't been committed to libcrypto yet.
2023-04-26 22:05:36 +00:00
job
a876585f00 Clean up X509 memory before exit 2023-04-26 21:30:12 +00:00
job
f31624a4e6 Add lookup name+function pointer table for improved diagnostics
OK tb@
2023-04-26 19:05:37 +00:00
job
bbab4d9ef4 Parameter names are not needed 2023-04-26 11:06:32 +00:00
job
0aff555d26 Remove unneeded parentheses 2023-04-26 11:04:12 +00:00
job
60f9a6092d No need to pass around const pointer cpder2
Suggested by tb@
2023-04-26 11:00:49 +00:00
job
39ee18e065 Shrink signature as cpder is only needed as local variable
Suggested by tb@
2023-04-26 10:55:58 +00:00
job
926a83681f Replace macros with functions
Requested by tb@
2023-04-26 10:34:08 +00:00
dv
eb18c5c166 regress: remove vmd path length tests.
These add no value and we'd now that we don't artificially limit
path lengths just be updating them to check PATH_MAX.
2023-04-26 10:14:21 +00:00
tb
c9d1fabebf Some more EC2M cleanup 2023-04-26 09:31:12 +00:00
tb
a04ff7ee09 Garbage collect test using the nseq command
reminded by anton
2023-04-26 09:07:59 +00:00
job
6b967e81da Rename dercache regress test to x509_asn1
Requested by jsing@
2023-04-26 08:58:03 +00:00
job
041ea02dfc Add regress test for invalidation of DER cache in select X509 setter functions 2023-04-25 21:51:44 +00:00
tb
5f7d54af02 bio_asn1: adjust for more recent churn 2023-04-25 19:48:24 +00:00
tb
8f4cde5df3 Remove a couple of temporary hacks 2023-04-25 17:17:21 +00:00
tb
eea36a4067 Update Wycheproof.go to exercise truncated SHA-2 and SHA-3 2023-04-25 15:56:56 +00:00
tb
9870d2f633 bn_mod_exp: temporarily add a prototype for BN_mod_exp_recp() 2023-04-25 15:34:07 +00:00
tb
87562733b2 bn_test: temporarily add prototypes for reciprocal functions
This is a hack needed until bn_local.h is updated
2023-04-25 15:33:25 +00:00
tb
30ad135c9b bn_test: BN_one() will become void, so stop checking it 2023-04-25 15:32:33 +00:00
tb
472a54ea59 bn_primes: the NIST primes will go away, so remove their tests 2023-04-25 15:30:03 +00:00
tb
457f098cc4 The bio_asn1 test will need to be linked statically after the bump 2023-04-25 15:29:17 +00:00
tb
d5165814ca Remove CTS test 2023-04-25 15:19:28 +00:00
tb
cee49816a3 CTS support will go away, so unhook corresponding regress 2023-04-25 15:18:59 +00:00
tb
dc5a472f91 Fix the client test and the tlsext test to work with randomized
TLS extensions (this involves unrandomizing the extension order
for the tests that rely on golden numbers.
2023-04-23 18:59:41 +00:00
anton
be82246fa6 cope with more s/XCR0/XFEATURE renames 2023-04-23 18:38:55 +00:00
tb
242be85ce0 Link c2sp test to build 2023-04-23 13:47:35 +00:00
tb
a82bb09bce Import C2SP/CCTV test
This currently only covers Ed25519 using the c2sp-testvectors package
and checks that our Ed25519 implementation behaves as expected from a
"ref10" implementation.

This test has Go and c2sp-testvectors as a hard dependency. It will
optionally pick up any OpenSSL package installed on the system and
test that as well.

https://github.com/C2SP/CCTV
https://github.com/C2SP/CCTV/tree/main/ed25519
2023-04-23 13:43:46 +00:00
jsing
703277b6c7 Provide initial regress for BN_{asc,dec,hex}2bn()/BN_bn2{dec,hex}() 2023-04-22 14:03:03 +00:00