summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* AES CTR-DRGB: add test for 32-bit counter overflowPatrick Steuer2020-03-114-2/+289
| | | | | | | Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10457)
* Fix handling of CMP msg senderKID and improve doc of related CTX functionsDr. David von Oheimb2020-03-102-12/+36
| | | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/11142)
* Chunk 8 of CMP contribution to OpenSSL: CMP server and cmp_mock_srv.c for ↵Dr. David von Oheimb2020-03-109-21/+215
| | | | | | | | | | | | | testing 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> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/11142)
* Add -section option to 'req' commandRich Salz2020-03-072-22/+43
| | | | | | | | | This removes "req" as the hardwired section for the req command. Doing this will let us merge some test configs. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/11249)
* Change DH_get_nid() to set the value of q if it is not already setShane Lontis2020-03-071-0/+71
| | | | | | | | | | | | | Fixes #11108. It only sets q if a valid named group is found. The function signature was recently changed to pass a non const DH pointer in order to allow the nid to be cached internally. As an extension of this the value of q can now also be set as q is always known for named groups. The length field is also set if q is set. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11114)
* Use .cnf for config files, not .confRich Salz2020-03-0692-108/+92
| | | | | | | | | | | | | The default is openssl.cnf The project seems to prefer xxx.conf these days, but we should use the default convention. Rename all foo.conf (except for Configurations) to foo.cnf Fixes #11174 Reviewed-by: Paul Yang <kaishen.yy@antfin.com> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11176)
* Remove unused filesRich Salz2020-03-065-114/+0
| | | | | | Reviewed-by: Paul Yang <kaishen.yy@antfin.com> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11176)
* Add DH key validation to default providerShane Lontis2020-03-051-2/+11
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10911)
* Add Serializers for ECShane Lontis2020-03-049-15/+111
| | | | | | | | | | | | | | | | | | | | | | | Provide EC serializers for text, pem and der. EC parameters use ANS1 'CHOICE' - which means they are more embedded than other parameters used by other KEY types (which normally have a SEQUENCE at the top level). For this reason the ANS1_STRING type that was being passed around has been changed to a void so that the code can still be shared with EC. The EC serializer only supports named curves currently. NOTE the serializer code assumes PKCS8 format - if the older encode methods are needed they will need to be added in another PR. (Probably when deserialization is considered). EVP_PKEY_key_fromdata_init was changed from using a keypair selection to all bits of a key. A side effect of this was that the very restrictive checks in the ecx code needed to be relaxed as it was assuming all selection flags were non optional. As this is not the case for any other key the code has been modified. Fixed a bug in legacy_ctrl_str_to_params() - "ecdh_cofactor_mode" was being incorrectly converted to the wrong keyname. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11107)
* EVP: Add evp_pkey_upgrade_to_provider(), for EVP_PKEY upgradesRichard Levitte2020-02-291-1/+2
| | | | | | | | This function "upgrades" a key from a legacy key container to a provider side key container. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11148)
* Implement the ECX SerializersMatt Caswell2020-02-2826-35/+414
| | | | | | | | | | | | Provide serializers for X25519 and X448 for text, pem and der. There are no parameter serializers because there are no parameters for these algorithms. Add some documentation about the various import/export types available Add additional testing for the serializers Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11095)
* Replace util/shlib_wrap.sh with util/wrap.pl in diverse docsRichard Levitte2020-02-271-1/+1
| | | | | Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/11110)
* Refactor evp_pkey_make_provided() to do legacy to provider exportRichard Levitte2020-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | Previously, evp-keymgmt_util_export_to_provider() took care of all kinds of exports of EVP_PKEYs to provider side keys, be it from its legacy key or from another provider side key. This works most of the times, but there may be cases where the caller wants to be a bit more in control of what sort of export happens when. Also, when it's time to remove all legacy stuff, that job will be much easier if we have a better separation between legacy support and support of provided stuff, as far as we can take it. This changes moves the support of legacy key to provider side key export from evp-keymgmt_util_export_to_provider() to evp_pkey_make_provided(), and makes sure the latter is called from all EVP_PKEY functions that handle legacy stuff. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11074)
* test/recipes/30-test_evp_data/evppkey.txtRichard Levitte2020-02-221-1/+1
| | | | | | | | | | Tests that go through provider cannot recognise PKEY_CTRL_INVALID from PKEY_CTRL_ERROR any more, because provided implementations' param setting functions return 0 or 1. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10557)
* test/evp_extra_test.c: adapt for RSA signature testsRichard Levitte2020-02-221-41/+89
| | | | | | Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10557)
* Don't exclude quite so much in a no-sock buildDr. David von Oheimb2020-02-211-40/+8
| | | | | | | | | | | | We were excluding more code than we needed to in the OCSP/HTTP code in the event of no-sock. We should also not assume that a BIO passed to our API is socket based. This fixes the no-sock build Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/11134)
* Introduce the provider propertyMatt Caswell2020-02-212-25/+45
| | | | | | | | | | | | | | Replace the properties default, fips and legacy with a single property called "provider". So, for example, instead of writing "default=yes" to get algorithms from the default provider you would instead write "provider=default". We also have a new "fips" property to indicate that an algorithm is compatible with FIPS mode. This applies to all the algorithms in the FIPS provider, as well as any non-cryptographic algorithms (currently only serializers). Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11097)
* Add DRBG self testsShane Lontis2020-02-211-1/+8
| | | | | Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/11010)
* Params: add argument to the _from_text calls to indicate if the param exists.Pauli2020-02-211-2/+2
| | | | | | | The extra argument is a integer pointer and is optional. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11049)
* Deprecate the low level Diffie-Hellman functions.Pauli2020-02-203-11/+23
| | | | | | | | Use of the low level DH functions has been informally discouraged for a long time. We now formally deprecate them. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11024)
* Deprecate the low level RSA functions.Pauli2020-02-206-64/+124
| | | | | | | | Use of the low level RSA functions has been informally discouraged for a long time. We now formally deprecate them. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11063)
* [CMS] Test decryption of a ciphertext encrypted from 1.1.1Nicola Tuveri2020-02-182-1/+39
| | | | | | | | | | | | | | Current CMS en/decryption tests only validate that our current decyption and encryption algorithms are compatible, but they say nothing about correctness of the output for the given set of parameters. As a partial fix in absence of proper KAT tests, we decrypt ciphertexts generated with OpenSSL 1.1.1. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/10631)
* Deprecate EC command line apps.Pauli2020-02-183-18/+54
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11106)
* TEST: Optionally silence OpenSSL::Test::setup()Richard Levitte2020-02-181-1/+1
| | | | | | | | | | test/generate_ssl_tests.pl uses OpenSSL::Test to get to some of its practical location functions. A recent note in the setup() code made its result not quite match the original (we do check that), so there's a need to silence setup(), which we do with a simple optional argument. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11080)
* TEST: Modify test/recipes/tconversion.pl to leave artifacts behindRichard Levitte2020-02-181-3/+0
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11080)
* TEST: Modify test/recipes/80-test_ssl_old.t to leave artifacts behindRichard Levitte2020-02-181-38/+0
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11080)
* TEST: Modify test/recipes/80-test_ssl_new.t to leave artifacts behindRichard Levitte2020-02-181-8/+5
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11080)
* TEST: Modify test/recipes/80-test_ocsp.t to leave artifacts behindRichard Levitte2020-02-181-3/+4
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11080)
* TEST: Modify test/recipes/80-test_cms.t to leave artifacts behindRichard Levitte2020-02-181-340/+391
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11080)
* TEST: Modify test/recipes/80-test_ca.t to leave artifacts behindRichard Levitte2020-02-181-4/+0
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11080)
* TEST: Modify test/recipes/20-test_pkeyutl.t to leave artifacts behindRichard Levitte2020-02-181-11/+8
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11080)
* TEST: Modify test/recipes/20-test_enc_more.t to leave artifacts behindRichard Levitte2020-02-181-3/+0
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11080)
* TEST: Modify test/recipes/25-test_x509.t to leave artifacts behindRichard Levitte2020-02-181-8/+6
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11080)
* TEST: Modify test/recipes/25-test_req.t to leave artifacts behindRichard Levitte2020-02-181-16/+14
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11080)
* TEST: Modify test/recipes/25-test_crl.t to leave artifacts behindRichard Levitte2020-02-181-1/+0
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11080)
* TEST: Modify test/recipes/20-test_enc.t to leave artifacts behindRichard Levitte2020-02-181-3/+0
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11080)
* TEST: Modify test/recipes/20-test_dgst.t to leave artifacts behindRichard Levitte2020-02-181-6/+6
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11080)
* TEST: Modify test/recipes/15-test_rsapss.t to leave artifacts behindRichard Levitte2020-02-181-1/+0
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11080)
* TEST: Modify test/recipes/15-test_mp_rsa.t to leave artifacts behindRichard Levitte2020-02-181-24/+29
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11080)
* Coverity 1458438: fix uninitialised memory access.Pauli2020-02-171-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11101)
* chunk 7 of CMP contribution to OpenSSLDr. David von Oheimb2020-02-1723-5/+879
| | | | | | | | | | | | | add CMP message validation and related tests; while doing so: * add ERR_add_error_mem_bio() to crypto/err/err_prn.c * move ossl_cmp_add_error_txt() as ERR_add_error_txt() to crypto/err/err_prn.c * add X509_STORE_CTX_print_verify_cb() to crypto/x509/t_x509.c, adding internally x509_print_ex_brief(), print_certs(), and print_store_certs() * move {ossl_cmp_,}X509_STORE_get1_certs() to crypto/x509/x509_lu.c Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/10620)
* fix various formatting nits in CMP contribution chunks 1-6 found by the new ↵Dr. David von Oheimb2020-02-174-90/+95
| | | | | | | | | | | util/check-format.pl in addition: correct wording in doc, comments, and parameter names: self-signed -> self-issued where appropriate Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/10620)
* improve CMP logging according to comments on CMP chunk 7 previewDr. David von Oheimb2020-02-171-23/+16
| | | | | | | | | | | | | in particular: consolidate documentation of CMP logging and error reporting functions fix compilation problem with clang on some platforms rename OSSL_CMP_log etc. to ossl_cmp_log etc. since these macros are CMP-internal move chopping of trailing separator to ossl_cmp_add_error_txt(), also fix handling of leading separator internalize X509_print_ex_brief() as x509_print_ex_brief() Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/10620)
* Add FFC param/key validationShane Lontis2020-02-163-1/+667
| | | | | | | Embed libctx in dsa and dh objects and cleanup internal methods to not pass libctx (This makes it consistent with the rsa changes) Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10910)
* Make secure-memory be a config optionRich Salz2020-02-141-2/+2
| | | | | | | | | | | Adding support for "no-secure-memory" was simple, a one-liner. Fixing all the "ifdef OPENSSL_SECURE_MEMORY" to be "ifndef NO_xxx" was a bit more work. My original goof, for not following the OpenSSL pattern "ifndef NO_" used everywhere else. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/11023)
* dsatest: fix the non-deprecated version of the test run.Pauli2020-02-141-6/+3
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11081)
* Add Asymmetric RSA cipher tests in FIPS providerMatt Caswell2020-02-132-2/+765
| | | | | | | | We also add some DSA tests for code that is already in the FIPS provider. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/10881)
* Remove unused ossl_param_bld_to_param_ex() function.Pauli2020-02-121-119/+0
| | | | | | | | The recently introduced ossl_param_bld_to_param_ex() function is only called by the unit tests. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11053)
* test/recipes/80-test_ssl_old.t: Replace 'openssl gendsa'Richard Levitte2020-02-121-3/+3
| | | | | | | | Use 'openssl genpkey' instead. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/10977)
* test_dsa: fix deprecation logicPauli2020-02-121-2/+1
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10977)