summaryrefslogtreecommitdiffstats
path: root/test
AgeCommit message (Collapse)Author
2021-08-04Add config_diagnostics to our configuration files.Pauli
The change to a more configuration based approach to enable FIPS mode operation highlights a shortcoming in the default should do something approach we've taken for bad configuration files. Currently, a bad configuration file will be automatically loaded and once the badness is detected, it will silently stop processing the configuration and continue normal operations. This is good for remote servers, allowing changes to be made without bricking things. It's bad when a user thinks they've configured what they want but got something wrong and it still appears to work. Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/16171)
2021-07-29Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16176)
2021-07-28test: add a comment indication that a bad MAC is intentionalPauli
This permits negative testing of FIPS module load failure. Also changed the MAC to all zeros to make it even clearer. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16168)
2021-07-28Add some testing for the case where the FIPS provider fails to loadMatt Caswell
Ensure we get correct behaviour in the event that an attempt is made to load the fips provider but it fails to load. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16168)
2021-07-28test: handle not a number (NaN) values in the param conversion test.Pauli
Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16144)
2021-07-28Add a test case for EVP_MD_meth_dup() and EVP_CIPHER_meth_dup()Matt Caswell
Check that EVP_MD_meth_free() and EVP_CIPHER_meth_free() does actually free the data. Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16159)
2021-07-27Mark the EVP_PKEY_METHOD arg as const on some EVP_PKEY_meth_get_*() funcsMatt Caswell
Most EVP_PKEY_meth_get_*() functions mark the EVP_PKEY_METHOD argument as const. But 3 did not. We fix those to be consistent. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16128)
2021-07-23ci: reinstate the passwd tests for the no-cached-fetch run.Pauli
By selectively skipping the high round test cases, the out of memory problem can be avoided. partially fixes #16127 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16132)
2021-07-22Add a test for custom EVP_PKEY_METHODsMatt Caswell
Adds a test for using custom EVP_PKEY_METHODs without an ENGINE. As part of this we also test having a custom EVP_PKEY_METHOD that wraps a built-in EVP_PKEY_METHOD. We do this for both legacy and provided keys. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16118)
2021-07-21Add testcases for SSL_key_update() corner case callsyangyangtiantianlonglong
Test that SSL_key_update() is not allowed if there are writes pending. Test that there is no reset of the packet pointer in ssl3_setup_read_buffer(). Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16085)
2021-07-20test: include all DRBG tests in FIPS modePauli
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/16096)
2021-07-19test: fix use after scope problem in ACVP testPauli
Repeat after me: thou shall not use an auto scope variable as a parameter that is used out of scope. Fixes GitHub CI #6305 Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/16103)
2021-07-17Fix signed/unsigned comparison warnings in sslapitestMatt Caswell
Fixes build failures if using enable-ktls in conjunction with --strict-warnings Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16090)
2021-07-16evp_test: Add tests for rsa_padding_mode:noneTomas Mraz
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/16068)
2021-07-16acvp_test: Fix incorrect parenthesisTomas Mraz
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16076)
2021-07-14test: add single byte IV AES GCM testsPauli
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16064)
2021-07-13Remove executable mode attributes of non-executable filesTianjia Zhang
Remove the executable attributes of some C code files and key files, change the file mode from 0755 to 0644. Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16045)
2021-07-12test: make build descriptions more consistentPauli
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16022)
2021-07-12test: add a shim function for the apps's opt_legacy_okay() functionPauli
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16022)
2021-07-12test: rename apps_mem.c to be apps_shims.c in anticipation of additonal ↵Pauli
functions Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16022)
2021-07-10test_cmp_ctx: Avoid using empty X509 with i2dTomas Mraz
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/16036)
2021-07-10Fix test/asn1_encode_test.c to handle encoding/decoding failureRichard Levitte
Make it only report (and fail on) encoding/decoding failures when success is expected. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16036)
2021-07-10Fix test/asn1_encode_test.c to not use ASN1_FBOOLEANRichard Levitte
ASN1_FBOOLEAN is designed to use as a default for optional ASN1 items. This test program used it for non-optional items, which doesn't encode well. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16036)
2021-07-10TEST: Check that i2d refuses to encode non-optional items with no contentRichard Levitte
The test case creates an RSA public key and tries to pass it through i2d_PrivateKey(). This SHOULD fail, since the private bits are missing. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16036)
2021-07-09Add a PKCS12 test to check with one input cert we get one output certMatt Caswell
Following on from the regression in issue #15983, add a test that with one input cert, we get one cert in the pkcs12 file, and that it has the expected friendlyName. Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16001)
2021-07-07Fix comment for test_negotiated_group() test orderBenjamin Kaduk
Because of how the 'client_multi' variable is set, we end up running the tests where the client configures multiple groups (and the server only configures one) before the ones where the server configures multiple groups (and the client only configures one). Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16007)
2021-07-07bn: procduce correct sign for result of BN_mod()Pauli
There is a problem that appears when calling BN_div(a, c, a, b) with negative b. In this case, the sign of the remainder c is incorrect. The problem only occurs if the dividend and the quotient are the same BIGNUM. Fixes #15982 Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/15991)
2021-07-06test: add some integral type size sanity checksPauli
With the recent problem on VMS of maxint_t being defined as a 32 bit integer despite OpenSSL mandating 64 bit integers being available, it seems prudent to add some sanity checks for out integral types. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15830)
2021-07-06Add HKDF negative testsShane Lontis
Fix memory leak if legacy test is skipped. Using EVP_KDF_CTX_get_params() to get OSSL_KDF_PARAM_SIZE will now return 0 if the returned size is 0. Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15977)
2021-07-06Add test for provider gettablesShane Lontis
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15970)
2021-07-03TEST: Add testing of PVK and MSBLOB files to test_storeRichard Levitte
The PVK and MSBLOB files were generated using openssl 1.1.1, using test/testrsa.pem as source: openssl rsa -in test/testrsa.pem \ -out test/recipes/90-test_store_data/testrsa.msb \ -outform msb openssl rsa -in test/testrsa.pem \ -out test/recipes/90-test_store_data/testrsa.pvk \ -outform pvk \ -passout pass:password Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15980)
2021-07-02Work around a 32-bit mingw failureMatt Caswell
Passing the return value from gmtime() directly to mktime() was producing incorrect results under windows (but not under wine) when built with mingw 32-bit (but not VC-WIN32). We implement a workaround for this. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15939)
2021-07-02Use TEST_time_t_* functions in cmp_hrd_test.cMatt Caswell
This gives better diagnostic output Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15939)
2021-07-02Avoid some MinGW test failuresMatt Caswell
There were 4 classes of failure: - line ending problems; - unicode problems; - file path munging problems; and - a "hang" in test_cmp_http. The unicode problems appear to be somewhere between wine or msys - they don't actually appear to be a problem with the built binaries. We just skip those tests for now. Fixes #13558 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15939)
2021-07-02Fix memory leak in i2d_ASN1_bio_streamOliver Mihatsch
When creating a signed S/MIME message using SMIME_write_CMS() if the reading from the bio fails, the state is therefore still ASN1_STATE_START when BIO_flush() is called by i2d_ASN1_bio_stream(). This results in calling asn1_bio_flush_ex cleanup but will only reset retry flags as the state is not ASN1_STATE_POST_COPY. Therefore 48 bytes (Linux x86_64) leaked since the ndef_prefix_free / ndef_suffix_free callbacks are not executed and the ndef_aux structure is not freed. By always calling free function callback in asn1_bio_free() the memory leak is fixed. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14844)
2021-07-02test_pem_reading: Test loading a key from a file with multiple PEM dataTomas Mraz
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15949)
2021-07-02load_pkey_pem: Check for spurious errors when loadingTomas Mraz
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15949)
2021-07-02Fix compile errors when building with --api=1.1.0 no-deprecated.Shane Lontis
Fixes #15963 INSTALL.md uses these exact options as an example so it should work. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15965)
2021-07-01afalg: add some memory initialisation calls to pacify memory sanitisation.Pauli
The engine is modifying memory without the sanitiser realising. By pre- initialising this memory, the sanitiser now thinks that read accesses are okay. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/15952)
2021-07-01Fix use of uninitialized memory in test_rsa_oaepDavid Benjamin
48f1739600f33c92387debce2002acec6e365f1d did not convert the RSA OAEP tests correctly. The corrupted ciphertext and truncation tests were really decrypting uninitialized memory, rather than the sample ciphertext. This results in an error in tools like MSan. The test is somewhat roundabout. In the original version, before the conversion, ctext_ex was an OAEP test vector from key1(), etc., functions. The test would: 1. Encrypt ptext_ex as ctext. 2. Decrypt ctext and check it gives ptext_ex. 3. Decrypt ctext_ex and check it gives ptext_ex. 4. Try corrupted and truncated versions of ctext. 48f1739600f33c92387debce2002acec6e365f1d then moved steps 1 and 2 into test_rsa_simple, which meant ctext is no longer available for step 4. It then mistakenly left the variable around, but uninitialized, so the test wasn't testing anything. (Confusingly, test_rsa_simple outputs ctext_ex to the caller, but doesn't do anything with it. The ctext_ex output is also only usable for OAEP, not PKCS#1 v1.5.) It doesn't really matter whether we use ctext or ctext_ex for step 4, so this PR fixes it by using ctext_ex instead. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15950)
2021-06-30cmp_mock_srv.c: Add missing OldCertID check for 'kur' cert update requestsDr. David von Oheimb
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15790)
2021-06-30CMP: Add missing getter functions to CRMF API and CMP APIDr. David von Oheimb
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15790)
2021-06-30test: fix test ordering in threads testPauli
Fixes #15953 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15954)
2021-06-30dh_test: fix coverity 1473239 Argument cannot be negative (NEGATIVE_RETURNS)Pauli
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15943)
2021-06-30test: fix coverity 1469427 Improper use of negative value (NEGATIVE_RETURNS)Pauli
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15943)
2021-06-29coverity #1486532: fix potential NULL dereference in test_mk_file_path()Tomas Mraz
Reviewed-by: Ben Kaduk <kaduk@mit.edu> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15942)
2021-06-27evp_test: use correct size in memory clearPauli
Fixes #15917 Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15920)
2021-06-26test/recipes/90-test_includes_data/vms-includes.cnf: correct the directoryRichard Levitte
... to mimic includes.cnf Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15823)
2021-06-26test/recipes/80-test_ca.t: Don't force quotes around the config file in $cnfRichard Levitte
However, when passing it through the OPENSSL_CONFIG environment variable, we still need the quotes, just to make sure. Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15823)
2021-06-26test/recipes/66-test_ossl_store.t: ensure native pathsRichard Levitte
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15823)