summaryrefslogtreecommitdiffstats
path: root/test (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add a test to make sure ASYNC aware code gets the right default libctxMatt Caswell2020-06-281-1/+109
| | | | | | | | Even if a fibre changes the default libctx - or the main application code changes it, the "current" default libctx should remain consistent. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12228)
* TEST: Add test to exercise OPENSSL_CTX_set0_default()Richard Levitte2020-06-281-7/+45
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12228)
* Reduce the security bits for MD5 and SHA1 based signatures in TLSKurt Roeckx2020-06-2718-1822/+1888
| | | | | | | | | | This has as effect that SHA1 and MD5+SHA1 are no longer supported at security level 1, and that TLS < 1.2 is no longer supported at the default security level of 1, and that you need to set the security level to 0 to use TLS < 1.2. Reviewed-by: Tim Hudson <tjh@openssl.org> GH: #10787
* Fix syntax of cipher stringKurt Roeckx2020-06-271-6/+6
| | | | | Reviewed-by: Tim Hudson <tjh@openssl.org> GH: #10787
* TEST: Add TODO segments in test/recipes/15-test_genec.tRichard Levitte2020-06-261-17/+47
| | | | | | | | | | | | | There currently do not support 'ec_param_enc:explicit' with provider side key generation. Reflect that by encoding the expected failure with a Test::More TODO section for those particular tests. Because the tests in this recipe are data driven, we implement this mechanism with two functions, one for stuff that's supported and one for stuff that isn't. Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/12080)
* Test genpkey app for EC keygen with various argsNicola Tuveri2020-06-261-0/+179
| | | | | | | | | | | | | | | | This commit adds a new recipe to test EC key generation with the `genpkey` CLI app. For each built-in curve, it tests key generation with text output, in PEM and in DER format, using `explicit` and `named_curve` for parameters encoding. The list of built-in curves is static at the moment, as this allows to differentiate between prime curves and binary curves to avoid failing when ec2m is disabled. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12080)
* Update copyright yearMatt Caswell2020-06-2513-13/+13
| | | | | Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/12273)
* Make the naming scheme for dispatched functions more consistentDr. Matthias St. Pierre2020-06-243-30/+30
| | | | | | | | | | | | | | | | | | | | | | | | | The new naming scheme consistently usese the `OSSL_FUNC_` prefix for all functions which are dispatched between the core and providers. This change includes in particular all up- and downcalls, i.e., the dispatched functions passed from core to provider and vice versa. - OSSL_core_ -> OSSL_FUNC_core_ - OSSL_provider_ -> OSSL_FUNC_core_ For operations and their function dispatch tables, the following convention is used: Type | Name (evp_generic_fetch(3)) | ---------------------|-----------------------------------| operation | OSSL_OP_FOO | function id | OSSL_FUNC_FOO_FUNCTION_NAME | function "name" | OSSL_FUNC_foo_function_name | function typedef | OSSL_FUNC_foo_function_name_fn | function ptr getter | OSSL_FUNC_foo_function_name | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12222)
* Rename <openssl/core_numbers.h> -> <openssl/core_dispatch.h>Dr. Matthias St. Pierre2020-06-244-4/+4
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12222)
* test: add test for generation of random data in chunks.Pauli2020-06-241-0/+33
| | | | | | | | | THe EVP_RAND wrapper works with the underlying RNG to produce the amount of random data requested even if it is larger than the largest single generation the source allows. This test verified that this works. Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/11682)
* test: update EVP tests to include DRBG testingPauli2020-06-243-2/+289
| | | | | | | [extended tests] Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/11682)
* NIST DRBG set dataPauli2020-06-241-0/+79522
| | | | | Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/11682)
* update drbgtest to the provider modelPauli2020-06-241-339/+199
| | | | | Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/11682)
* params: add OSSL_PARAM helpers for time_t.Pauli2020-06-242-0/+37
| | | | | | | | POSIX mandates that time_t is a signed integer but it doesn't specify the lenght. Having wrappers lets uses ignore this. Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/11682)
* Add an SSL_dup testMatt Caswell2020-06-231-0/+72
| | | | | Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/12180)
* property: Move global default properties to the library context.Pauli2020-06-231-0/+30
| | | | | | | | | Fixes a problem where global properties don't work with a NULL query. Specifying an algorithm with a NULL query ignores the default properties. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12123)
* TEST: Pass -no-CAstore in 80-test_ocsp.tSebastian Andrzej Siewior2020-06-231-1/+1
| | | | | | | | | | | | | | Without passing -no-CAstore the default CAstore will be used and the testsuite will fail the system has certificates installed. Fixes: #11645 Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12171)
* test/run_tests.pl: Improve indentation parsing workaround for VFO and VFP modeDr. David von Oheimb2020-06-221-3/+8
| | | | | Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/12175)
* test/run_tests.pl: Improve newline output for VFO and VFP modeDr. David von Oheimb2020-06-221-4/+4
| | | | | Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/12175)
* Speed-up for tests in 81-test_cmp_cli_data/test_connection.csvDr. David von Oheimb2020-06-221-7/+4
| | | | | Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/12175)
* Disable tests in cmp_vfy_test.c that make no sense if ↵Dr. David von Oheimb2020-06-221-1/+20
| | | | | | | FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/12175)
* 81-test_cmp_cli.t: Disable CLI-based tests in case fuzzing is enabledDr. David von Oheimb2020-06-221-2/+4
| | | | | Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/12175)
* 81-test_cmp_cli.t: Do connections to 127.0.0.1 (e.g., Mock server) without proxyDr. David von Oheimb2020-06-221-4/+14
| | | | | | | Fixes #12156 Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/12175)
* Fix CMP -days option range checking and test failing with enable-ubsanDr. David von Oheimb2020-06-221-1/+1
| | | | | Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/12175)
* namemap: change ossl_namemap_empty() to do what the documentation says.Pauli2020-06-211-4/+23
| | | | | | | | | | | | | The function is documented as returning 1 when passed a NULL argument. Instead it core dumps. Added a unit test for this. Additionally, a performance improvement is incorporated. The namemap max_number field is only ever compared against zero and incremented. The zero comparison grabs a lock specifically for this check. This change uses TSAN operations instead if they are available. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12181)
* Add a test for d2i_AutoPrivateKey_ex with a non-default libctxMatt Caswell2020-06-193-3/+247
| | | | | | | | | Really this test should go in evp_extra_test. However that doesn't currently support a non-default libctx (with the "null" provider in the default libctx). So (for now) we create evp_extra_test2.c Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12159)
* Write a test provider to test the TLS-GROUPS capabilityMatt Caswell2020-06-193-1/+523
| | | | | Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11914)
* Make EVP_PKEY_CTX_[get|set]_group_name work for DH tooMatt Caswell2020-06-193-8/+8
| | | | | | | | | The previous commit added the EVP_PKEY_CTX_[get|set]_group_name functions to work with EC groups. We now extend that to also work for DH. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11914)
* Make EVP_PKEY_CTX_[get|set]_ec_paramgen_curve_name more genericMatt Caswell2020-06-192-8/+6
| | | | | | | | | We rename these function to EVP_PKEY_CTX_get_group_name and EVP_PKEY_CTX_set_group_name so that they can be used for other algorithms other than EC. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11914)
* Modify libssl to discover supported groups based on available providersMatt Caswell2020-06-194-4/+11
| | | | | | | | | Now that we have added the TLS-GROUP capability to the default provider we can use that to discover the supported group list based on the loaded providers. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11914)
* Fix segfault in openssl app called with no args.Shane Lontis2020-06-181-0/+25
| | | | | | | | This is a result of removal of interactive mode. Redirected it to now use 'openssl help'. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12164)
* Add ACVP fips module testsShane Lontis2020-06-176-206/+3470
| | | | | | | | | | | | | | | | | | | | | | | | For FIPS validation purposes - Automated Cryptographic Validation Protocol (ACVP) tests need to be performed. (See https://github.com/usnistgov/ACVP). These tests are very similiar to the old CAVS tests. This PR uses a hardwired subset of these test vectors to perform similiar operations, to show the usage and prove that the API's are able to perform the required operations. It may also help with communication with the lab (i.e- The lab could add a test here to show a unworking use case - which we can then address). The EVP layer performs these tests instead of calling lower level API's as was done in the old FOM. Some of these tests require access to internals that are not normally allowed/required. The config option 'acvp_tests' (enabled by default) has been added so that this access may be removed. The mechanism has been implemented as additional OSSL_PARAM values that can be set and get. A callback mechanism did not seem to add any additional benefit. These params will not be added to the gettables lists. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11572)
* Chunk 12 of CMP contribution to OpenSSL: CLI-based high-level testsDr. David von Oheimb2020-06-1328-0/+7359
| | | | | | | | | | Certificate Management Protocol (CMP, RFC 4210) extension to OpenSSL Also includes CRMF (RFC 4211) and HTTP transfer (RFC 6712). Adds the CMP and CRMF API to libcrypto and the "cmp" app to the CLI. Adds extensive documentation and tests. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11998)
* Move part of OSSL_CMP_validate_msg() to ossl_cmp_msg_check_update()Dr. David von Oheimb2020-06-131-1/+2
| | | | | | | | as checking expected_sender and adding caPubs is not part of msg validation. Also constify a couple of internal and public functions related to cmp_vfy.c Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11998)
* Improve ossl_cmp_msg_check_received() and rename to ossl_cmp_msg_check_update()Dr. David von Oheimb2020-06-132-42/+40
| | | | | | | | Bugfix: allow using extraCerts contained in msg already while checking signature Improve function name, simplify its return value, and update its documentation Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11998)
* Fix two additional instances of the old EVP_MAC_CTX_ functions being used.Pauli2020-06-131-1/+1
| | | | | | | [extended tests] Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/12121)
* The EVP_MAC functions have been renamed for consistency. The EVP_MAC_CTX_*Pauli2020-06-113-7/+7
| | | | | | | | | | | | | functions are now EVP_MAC functions, usually with ctx in their names. Before 3.0 is released, the names are mutable and this prevents more inconsistencies being introduced. There are no functional or code changes. Just the renaming and a little reformatting. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11997)
* kdf: make function naming consistent.Pauli2020-06-112-37/+38
| | | | | | | | The EVP_KDF_CTX_* functions have been relocated to the EVP_KDF_* namespace for consistency. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11996)
* Add a CMAC testMatt Caswell2020-06-103-0/+237
| | | | | | | | We did not have a test of the low level CMAC APIs so we add one. This is heavily based on the HMAC test. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11972)
* run_tests.pl: Add options for focussing output on failed (sub-)testsDr. David von Oheimb2020-06-101-11/+48
| | | | | | | | | VERBOSE_FAILURES_ONLY (VFO): verbose output only of failed (sub-)tests VERBOSE_FAILURES_PROGRESS (VFP): in addition summary for passed tests This adds a workaroud for TAP::Parser not coping well with indentation. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12088)
* Silence gcc false positive warning on refdatalen in test/tls13encryptiontest.cDr. David von Oheimb2020-06-101-1/+1
| | | | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/12042)
* Silence gcc false positive warning on alpn_protos_len in test/handshake_helper.cDr. David von Oheimb2020-06-101-1/+2
| | | | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/12042)
* Update RSA keygen to use sp800-56b by defaultShane Lontis2020-06-101-4/+19
| | | | | | | | | | | | | Fixes #11742 Fixes #11764 The newer RSA sp800-56b algorithm is being used for the normal case of a non multiprime key of at least length 2048. Insecure key lengths and mutltiprime RSA will use the old method. Bad public exponents are no longer allowed (i.e values less than 65537 or even). Values such as 2 that would cause a infinite loop now result in an error. The value of 3 has been marked as deprecated but is still allowed for legacy purposes. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11765)
* Add a test for renegotiation with EXTMS droppedTomas Mraz2020-06-095-3/+66
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12045)
* test: TLS1.3 and new ciphers for kTLSVadim Fedorenko2020-06-082-104/+400
| | | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11589)
* Fix 90-test_store.t for latest config, limits, providers, and disabled algosDr. David von Oheimb2020-06-085-104/+99
| | | | | | | | | Also make sure that the test do not 'pass' if their initialization fails. Leave out the expensive parts of DSA key gen and RSA keygen for efficiency. Fix use of the new CA configuration file test/ca-and-certs.cnf. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11733)
* Add chain to PKCS#12 test file generation in 90-test_store.tDr. David von Oheimb2020-06-081-0/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11733)
* TEST: Adjust test/bioprinttest.c to behave like the testutil routinesRichard Levitte2020-06-061-2/+32
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12057)
* TESTUTIL: Adjust the rest of testutilRichard Levitte2020-06-062-20/+18
| | | | | | | Fixes #12054 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12057)
* TESTUTIL: Separate TAP output and other output by BIO filterRichard Levitte2020-06-065-163/+87
| | | | | | | | | | | | | | | | | | | Output that's supposed to be understood by a TAP parser gets its own BIOs (|tap_out| and |tap_err|), and is only used internally within testutils. |bio_out| and |bio_err| is now only used for output that shouldn't be parsed by the TAP parser, and all output written to those BIOs are therefore always made to look like comments (it gets prefixed with "# "). Indentation and prefixing with "# " is reworked to use BIO_f_prefix(), which allows us to throw away the internal BIO_f_tap(). The indentation level is now adjusted via a special function. Fixes #12054 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12057)