summaryrefslogtreecommitdiffstats
path: root/test
AgeCommit message (Collapse)Author
2020-12-08Add a test for encoding/decoding using an invalid ASN.1 TemplateMatt Caswell
If you have a CHOICE type that it must use explicit tagging - otherwise the template is invalid. We add tests for this. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
2020-12-08Add a test for GENERAL_NAME_cmpMatt Caswell
Based on a boringssl test contributed by David Benjamin Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
2020-12-07Change OPENSSL_hexstr2buf_ex() & OPENSSL_buf2hexstr_ex() to pass the separatorShane Lontis
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13294)
2020-12-04test/certs/setup.sh: Fix two glitchesDr. David von Oheimb
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13606)
2020-12-04evp_pkey_dparams_test.c: Fix build error on OPENSSL_NO_{DH,DSA,EC}Dr. David von Oheimb
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13110)
2020-12-04endecode_test.c: Fix build errors on OPENSSL_NO_{DH,DSA,EC,EC2M}Dr. David von Oheimb
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13110)
2020-12-04Fix no-dsaMatt Caswell
Skip tests that require DSA to be available. While we're doing this we also remove an OPENSSL_NO_DSA guard in the dhparam app that is no longer necessary (even though DSA may not be present in our own providers it could be available via a third party provider). Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13599)
2020-12-04Fix ecdsa digest setting code to match dsa.Shane Lontis
Fixes #13422 ecdsa_set_ctx_params() was not setting the digest correctly. The side effect noted was that the check for sha1 when signing was not being done in fips mode. Also fixed the dupctx() so that propq is deep copied. The usage of the variable 'flag_allow_md' was also copied from the dsa code. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13520)
2020-12-03x509_vfy.c: Restore rejection of expired trusted (root) certificateDr. David von Oheimb
The certificate path validation procedure specified in RFC 5280 does not include checking the validity period of the trusted (root) certificate. Still it is common good practice to perform this check. Also OpenSSL did this until commit 0e7b1383e, which accidentally killed it. The current commit restores the previous behavior. It also removes the cause of that bug, namely counter-intuitive design of the internal function check_issued(), which was complicated by checks that actually belong to some other internal function, namely find_issuer(). Moreover, this commit adds a regression check and proper documentation of the root cert validity period check feature, which had been missing so far. Fixes #13427 Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13590)
2020-12-02Add test to demonstrate the app's new engine key loadingRichard Levitte
This adds a bit of functionality in ossltest, so it can now be used to load PEM files. It takes the file name as key ID, but just to make sure faults aren't ignored, it requires all file names to be prefixed with 'ot:'. Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/13570)
2020-12-02Fix no-dtlsMatt Caswell
Ensure we correctly detect if DTLS has been disabled in the client auth test_ssl_new tests. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13587)
2020-12-02openssl dgst: add option to specify output length for XOFDaiki Ueno
This adds the -xoflen option to control the output length of the XOF algorithms, such as SHAKE128 and SHAKE256. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13245)
2020-12-02Adapt everything else to the updated OSSL_ENCODER_CTX_new_by_EVP_PKEY()Richard Levitte
Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13545)
2020-12-02Add EVP_KDF-X942 to the fips moduleShane Lontis
The X942 KDF had been modified so that it supports all optional fields - not just the fields used by CMS. As there are 2 types of KDF for X942 - this has been made a bit clearer by adding an X942KDF-ASN1 alias. X942KDF-CONCAT has also been added as an alias of X963KDF. This work was instigated as a result of the ACVP tests optionally being able to use keybits for the supp_pubinfo field. Setting the parameter OSSL_KDF_PARAM_X942_USE_KEYBITS to 0 allows this to be disabled. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13418)
2020-12-02Print random seed on test failure.Pauli
Tests randomisation wasn't reliably printing the seed used on failure in the CIs. Fixes: #13572 Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13573)
2020-12-02Fix simpledynamic.c - a typo and missed a headerKelvin Lee
CLA: trivial Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13584)
2020-12-01TEST: Add a simple module loader, and test the FIPS module with itRichard Levitte
This very simple module loader is only linked with the standard C library, so cannot and should not provide any other symbol to the module it tries to load. It can thereby be used to verify that the module it tries to load doesn't have any surprising dependencies when it's supposed to be self contained. A test recipe is added to verify the FIPS module with this loader. Fixes #11020 Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13507)
2020-12-01TEST: Break out the local dynamic loading code from shlibloadtest.cRichard Levitte
The result is "simpledynamic.c", or "sd" for short. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13507)
2020-12-01endecode_test.c: Add warning that 512-bit DH key size is for testing onlyDr. David von Oheimb
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13568)
2020-12-01test cleanup: move helper .c and .h files to test/helpers/Dr. David von Oheimb
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13568)
2020-12-01remove obsolete test/drbg_cavs_data.hDr. David von Oheimb
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13568)
2020-12-01remove obsolete test/drbg_extra_test.hDr. David von Oheimb
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13568)
2020-11-30Fix builds that specify both no-dh and no-ecMatt Caswell
Various sections of code assumed that at least one of dh or ec would be available. We also now also need to handle cases where a provider has a key exchange algorithm and TLS-GROUP that we don't know about. Fixes #13536 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13549)
2020-11-30Fix instances of pointer addition with the NULL pointerMatt Caswell
Addition using the NULL pointer (even when adding 0) is undefined behaviour. Recent versions of ubsan are now complaining about this, so we fix various instances. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13513)
2020-11-29endecode_test.c: Significant speedup in generating DH and DHX keysDr. David von Oheimb
Fixes #13495 Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13552)
2020-11-28TEST: Fix path length in test/ossl_store_test.cRichard Levitte
The URI length was set to 80 chars, but the URI being built up may need more space, all depending on the paths used to get to the files that are to be loaded. If the result needs more than 80 chars, the test will fail. Fixed by using PATH_MAX. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13546)
2020-11-27X509_dup: fix copying of libctx and propq using new ASN1_OP_DUP_POST cb ↵Dr. David von Oheimb
operation Fixes #12680 Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/12687)
2020-11-27Deprecate more DH functionsMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13138)
2020-11-27Don't test a deprecated function in a no-deprecated buildMatt Caswell
EVP_PKEY_set1_DH is deprecated so there is no need to test it in a no-deprecated build. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13138)
2020-11-27Deprecate the DHparams and DHxparams PEM routinesMatt Caswell
The functions return a DH object and therefore need to be deprecated. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13138)
2020-11-27TEST: Adapt test/errtest for the 'no-err' configurationRichard Levitte
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13510)
2020-11-27Fix no-deprecated configurationShane Lontis
pem_read_depr_test needed to be setup in build info so that it only exists inside an IF[{- !$disabled{'deprecated-3.0'} -}] block. 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/13543)
2020-11-26Add test for no reset after DigestFinal_ex and DigestFinalXOFTomas Mraz
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13402)
2020-11-26Update copyright yearMatt Caswell
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13533)
2020-11-25Fix no-rc2Matt Caswell
Skip a test that relies on RC2 being present in a no-rc2 build. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13496)
2020-11-25re-encrypt 81-test_cmp_cli_data/Mock/signer.p12 with AES-256-CBC (avoiding DES)Dr. David von Oheimb
Fixes #13494 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13497)
2020-11-25Re-enable testing of ciphersuitesMatt Caswell
Commit be9d82bb3 inadvertently disabled ciphersuite testing. This masked some issues. Therefore we fix this testing. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13378)
2020-11-25Test that OSSL_STORE can load various types of paramsMatt Caswell
There have been instances where OSSL_STORE got confused between DSA and DH params (e.g. see issue #13046) due the DER encoding of DH and DSA params looking identical. Therefore we test that we get the types that we expect. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13329)
2020-11-25Test various deprecated PEM_read_bio_* APIsMatt Caswell
Add tests for various deprecated PEM_read_bio_*() functions to ensure they can still read the various files. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13329)
2020-11-24TEST: Make our test data binaryRichard Levitte
Our test data (test/data.txt and test/data2.txt) are text files, but declaring them binary means that there will be no line ending transformation done on them. This is necessary for testing on non-Unix platforms, where certain tests could otherwise give results that don't match expected results. Fixes #13474 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13477)
2020-11-23Add a test for the dhparam CLI applicationMatt Caswell
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13231)
2020-11-20Fix crash in genpkey app when -pkeyopt digest:name is used for DH or DSA.Shane Lontis
By the time the keygen is called the references to strings inside the gen ctx are floating pointers. A strdup solves this problem. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13432)
2020-11-20test RNG: set state to uninitialised as part of uninstantiate call.Pauli
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/13226)
2020-11-20test: changes resulting from moving the entropy source out of the FIPS providerPauli
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/13226)
2020-11-19Add a test for setting, popping and clearing error marksMatt Caswell
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13335)
2020-11-19apps/pkcs12: Retain test output filesDavid von Oheimb
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/4930)
2020-11-18Deprecate RSA harderRichard Levitte
This deprecates all functions that deal with the types RSA and RSA_METHOD Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13096)
2020-11-18Swap to FIPS186-2 DSA generation outside of the FIPS moduleMatt Caswell
Inside the FIPS module we continue to use FIPS186-4. We prefer FIPS186-2 in the default provider for backwards compatibility reasons. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13228)
2020-11-18Adapt ssltest_old to not use deprecated DH APIsMatt Caswell
There are non-deprecated replacements so we should use those instead. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13368)
2020-11-18Extend the auto DH testing to check DH sizesMatt Caswell
Check that the size of the DH parameters we select changes according to the size of the certificate key or symmetric cipher (if no certificate). Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13368)