summaryrefslogtreecommitdiffstats
path: root/test
AgeCommit message (Collapse)Author
2023-10-04test: evp_extra: fix indentation errorMatthias St. Pierre
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22185) (cherry picked from commit b49cafd86b295aa5e177d6c1368b06a1202ec2b3)
2023-09-21Fix test_cms if DSA is not supportedSteffen Klee
CLA: trivial Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22150) (cherry picked from commit dee2129802d9694d72e8745aec2d8bd4577ee4ee)
2023-09-19Copyright year updatesRichard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org> Release: yes
2023-09-15Fix PKCS#12 creation error when certificate contains auxiliary dataOlga Batyshkina
Prefer friendly name passed by the caller and calculated local key id to ones found in certificate auxiliary data when creating PKCS#12. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21675) (cherry picked from commit 388a8e731445d190a46ec27b2ff5b4bf334d526b)
2023-09-13Fix memory leaks in ssl_old_test.cBernd Edlinger
This fixes a few memory leaks reported in #22049. If SSL_CTX_set0_tmp_dh_pkey rejects the temp dh key due to security restrictions (even when @SECLEVEL=0 is used!) then the caller has to delete the PKEY object. That is different to how the deprecated SSL_CTX_set_tmp_dh_pkey was designed to work. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22060) (cherry picked from commit 21f0b80cd4b32ba80843b812b01a6056daf14093)
2023-09-11Fix a possible memleak in rsa_pub_encodeBernd Edlinger
That seems to be only an issue for RSA-PSS with parameters. Spotted by code review, so it looks like there is no test coverage for this. Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22032) (cherry picked from commit 285eb1688f05ad477fefc681bf05d0afedc46d40)
2023-09-09Fix typographical error in 80-test_cms.t (missing ;)Randall S. Becker
Fixes: #22045 Signed-off-by: Randall S. Becker <randall.becker@nexbridge.ca> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/22046)
2023-09-09Fix output corruption in req commandBernd Edlinger
when used in conjunction with -out and -modulus options. Fixes #21403 Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22026) (cherry picked from commit d2873946dfaff5537ea3d1adf3890e33a3f276ff)
2023-09-08Add test case for #21986Pauli
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/21988) (cherry picked from commit c870a465864259f0bdec0953ad085da31941bc27)
2023-09-07test/chacha: replace CPUID_OBJ with OPENSSL_CPUID_OBJMin Zhou
Fixes #21977 Signed-off-by: Min Zhou <zhoumin@loongson.cn> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21978) (cherry picked from commit e6b6b18af3e85a6b5f0d8ea1070f7070557d6357)
2023-09-01Update X509 fuzzer to verify a chainKurt Roeckx
It add supports for verifying that it's been signed by a CA, and checks the CRL and OCSP status Can find CVE-2022-4203 and CVE-2023-0286 Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20243) (cherry picked from commit 399c2da08ab9c6a382f8e9950742a022e847fec0) (cherry picked from commit 869d95b00e22b68897a541abf3bcee3589d2d519)
2023-08-24ctrl_params_translate: Allow RSA controls also for RSA-PSSIngo Franzki
Controls 'rsa_keygen_pubexp' and 'rsa_keygen_primes' should also be allowed for RSA-PSS keys. Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21818) (cherry picked from commit e2c2cca4b2fd1ad946d93507e9ca4f9ea910a114)
2023-08-15Fix no-dsa in combination with no-errMatt Caswell
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21722) (cherry picked from commit 4efd84fdd648279367683b280c9d9feb2ba54e9e)
2023-08-15Fix no-dtls and no-tls in combinationMatt Caswell
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21722) (cherry picked from commit fb32f6ea42e6916ff88cc44cf5de6e63ba596aca)
2023-08-10Do not raise CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA error in CMS_ContentInfo_freeOlga Batyshkina
This happens if this function is called for signed content. Added ossl_cms_env_enc_content_free() for cleaning enveloped content. Fixed indentation in ossl_cms_env_enc_content_free Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21676) (cherry picked from commit 13342efbb9e16ec8f97b1ac5ab4aa2b3b3490596)
2023-08-04endecode_test.c: Add tests for decoding with 0 selectionTomas Mraz
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Todd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/21519) (cherry picked from commit 4c50610bdadbcf7aa6bbd968df67b8874234677b) (cherry picked from commit 42f32b460646d8d4ef1e8927ec976716f02a093a)
2023-08-04test: skip FIPS config auto loading based tests if feature is disabledPauli
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/21621) (cherry picked from commit 9a255aa2bda07286d5516a77b269178fc03779b4)
2023-08-04provider test: don't run configuration based tests if configuration isn't loadedPauli
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/21621) (cherry picked from commit a9dde749504065e6e66b63cc12c25381465ec721)
2023-08-04PBE test: load providers if auto config load is turned offPauli
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/21621) (cherry picked from commit 52ea255d9d560513f69c3f7f3f21513a693c865c)
2023-08-04testutil: allow a failure return from setup_tests that doesn't print helpPauli
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/21621) (cherry picked from commit badf3c162d2b67635beee3fc948db32f13d274af)
2023-08-03crypto/cmp: fix clash of OSSL_CMP_CERTREQID_NONE with error result of ↵Dr. David von Oheimb
ossl_cmp_asn1_get_int() Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/21579) (cherry picked from commit 2c8d9f19e351a84d4329fbe2f68a4a8a49cad3ef)
2023-08-01Add a test for PEM_read_bio_Parameters()Matt Caswell
We must not ask for a password when attempting to read parameters. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21603) (cherry picked from commit df3d609030bdb0868d1ccca14227bb6829ad954c)
2023-08-01Copyright year updatesMatt Caswell
Reviewed-by: Tomas Mraz <tomas@openssl.org> Release: yes
2023-07-27dhtest.c: Add test of DH_check() with q = p + 1Tomas Mraz
This must fail with DH_CHECK_INVALID_Q_VALUE and with DH_CHECK_Q_NOT_PRIME unset. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Todd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/21550) (cherry picked from commit ad5d35572695d7b5748b2bd4fb1afaa189b29e28) (cherry picked from commit 1478ffad3f123550ec1014642d5c880dfbe270ef)
2023-07-24Fix error handling in pipelining testBernd Edlinger
When an early error happens in the test_pipelining function and idx == 5 the error handling would try to call OPENSSL_free(msg), but msg is at that time just a string constant in read-only memory, so a crash would be the result. Fixed that by using fragsize as an indication when to free msg. Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21512) (cherry picked from commit 06a0d40322e96dbba816b35f82226871f635ec5a)
2023-07-19Add a test for CVE-2023-3446Matt Caswell
Confirm that the only errors DH_check() finds with DH parameters with an excessively long modulus is that the modulus is too large. We should not be performing time consuming checks using that modulus. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21451) (cherry picked from commit ede782b4c8868d1f09c9cd237f82b6f35b7dba8b)
2023-07-17Remove duplicated valuesljuzwiuk
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Todd Short <todd.short@me.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21401) (cherry picked from commit f1b7243cda208d8bd74f75c95990f8205e977ae4)
2023-07-17Add a test for a retry during the handshakeMatt Caswell
Test various scenarios for a write retry occuring during a handshake. Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21435) (cherry picked from commit d6179e6d35af663ca41de615f35a1200a35f85e8)
2023-07-14Add testcases for empty associated data entries with AES-SIVTomas Mraz
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21384) (cherry picked from commit 3993bb0c0c87e3ed0ab4274e4688aa814e164cfc)
2023-06-29Add some test_ssl_new tests for the ffdhe groupsMatt Caswell
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Viktor Dukhovni <viktor@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21295) (cherry picked from commit 5cd269461ac7a7920299232b1c1b9857c1e1908f)
2023-06-26Add a test for pkeyutl encrypt/decrypt using SM2Matt Caswell
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21272) (cherry picked from commit 810f7dc1c7cc5441097b398f753e33652848a4cc)
2023-06-26Add a test case for the password prompt on garbage PKCS#12 fileRichard Levitte
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21197) (cherry picked from commit 1a27cc3626bd15f8fd9a26a2dbc59a681d505321)
2023-06-23Add a test for an invalid group in the HRRMatt Caswell
Test that if the client sends a key share for a group in the server's supported_group list but is otherwise invalid, that we don't select it in the HRR. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Todd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/21163) (cherry picked from commit adf33f9e268b17ec1b4739707abb40b03b21ea6a)
2023-06-15fips: update DSA security check to fix legacy verify strengthsPauli
Refer SP 800-131Ar2 table 2: https://csrc.nist.gov/publications/detail/sp/800-131a/rev-2/final Fixes #21185 Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21186) (cherry picked from commit 71cf587ea21c1422640847e358019a51806d2811)
2023-06-09Cast the argument to unsigned char when calling isspace()Michael Baentsch
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21151) (cherry picked from commit 8a2e74d0536c91585fbe789e0ab7b06cab0289c2)
2023-06-06Cast the argument to unsigned char when calling isdigit()Michael Baentsch
Fixes #21123 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21127) (cherry picked from commit 8229874476cc2955e6947cf6d3fee09e13b8c160)
2023-05-30Update copyright yearTomas Mraz
Reviewed-by: Richard Levitte <levitte@openssl.org> Release: yes
2023-05-17Fix stack corruption in ui_readBernd Edlinger
This is an alternative to #20893 Additionally this fixes also a possible issue in UI_UTIL_read_pw: When UI_new returns NULL, the result code would still be zero as if UI_UTIL_read_pw succeeded, but the password buffer is left uninitialized, with subsequent possible stack corruption or worse. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20957) (cherry picked from commit a64c48cff88e032cf9513578493c4536df725a22)
2023-05-12CMP client: fix checking new cert enrolled with oldcert and without private keyDr. David von Oheimb
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Todd Short <todd.short@me.com> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/20832) (cherry picked from commit e0f1ec3b2ec1b137695abc3199a62def5965351f)
2023-05-12CMP client: fix error response on -csr without private key, also in docsDr. David von Oheimb
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Todd Short <todd.short@me.com> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/20832) (cherry picked from commit 2d6585986f3b754750b25e7a296a08e7129a5320)
2023-05-12provider: return error if buf too small when getting ec pubkey paramYi Li
Fixes #20889 There was an incorrect value passed to EC_POINT_point2oct() for the buffer size of the param passed-in. Added testcases. Signed-off-by: Yi Li <yi1.li@intel.com> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20890) (cherry picked from commit 91070877adb905f51eb4b19b730d42fc257bae13)
2023-05-12Clear ownership when duplicating sessionsWatson Ladd
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Todd Short <todd.short@me.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20848) (cherry picked from commit 9fdf9a44bbe3827fe653165a07281ccae8ab0947)
2023-04-28fix aes-xts bug on aarch64 big-endian env.Liu-ErMeng
Signed-off-by: Liu-ErMeng <liuermeng2@huawei.com> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20797) (cherry picked from commit 4df13d1054e143f1cbf13fa347491807289f87b7)
2023-04-28APPS/cmp: prevent HTTP client failure on -rspin option with too few filenamesDr. David von Oheimb
The logic for handling inconsistent use of -rspin etc., -port, -server, and -use_mock_srv options proved faulty. This is fixed here, updating and correcting also the documentation and diagnostics of the involved options. In particular, the case that -rspin (or -rspout. reqin, -reqout) does not provide enough message file names was not properly described and handled. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/20295) (cherry picked from commit 1f757df1f3de0c18cc22a4992d66e9a7b113f61d)
2023-04-18cmp_client_test.c: add tests for errors reported by server on subsequent ↵Dr. David von Oheimb
requests in a transaction Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/20257)
2023-04-18test_get_libctx(): prevent crash when called with NULL provider argDr. David von Oheimb
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/20257)
2023-04-18crypto/cmp: fix CertReqId to use in p10cr transactions acc. to RFC 4210Dr. David von Oheimb
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/20298) (cherry picked from commit 25b18e629d5cab40f88b33fd9ecf0d69e08c7707)
2023-04-16adding provider_unload functions for cmp_ testsDanny Carpenter
CLA: trivial Reviewed-by: Todd Short <todd.short@me.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20731) (cherry picked from commit 8835940db58229fc467cdea1eebf3f064352a086)
2023-04-13Fix the LCM computation in the RSA multiprime key checkTomas Mraz
Fixes #20693 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> (Merged from https://github.com/openssl/openssl/pull/20708) (cherry picked from commit efbff4de3e259cee71a4e1bbd86b30ebd86bbdae)
2023-03-31Make DSA_sign() test for negative p,q,g values.slontis
Related to #20268 DSA_sign() assumes that the signature passed in is related to DSA_size(). If q is negative then DSA_size() actually fails and returns 0. A test that tries to allocate the signature buffer using DSA_size() and then pass it to DSA_sign() will then either. (1) Have a signature buffer of NULL. In this case it was leaking data returned via i2d_DSA_SIG. (2) Cause a seg fault because we created a buffer that was not large enough to hold the signature. As it already checked zero we also now check for negative values also. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Todd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/20553) (cherry picked from commit 9559ad0e8d433a2a212b63cc848fa2ac82a9b048) (cherry picked from commit ce90b5ed8b0849a77336b8ea81ba7983d11e8700)