summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2023-11-06Make DH_check_pub_key() and DH_generate_key() safer yetRichard Levitte
We already check for an excessively large P in DH_generate_key(), but not in DH_check_pub_key(), and none of them check for an excessively large Q. This change adds all the missing excessive size checks of P and Q. It's to be noted that behaviours surrounding excessively sized P and Q differ. DH_check() raises an error on the excessively sized P, but only sets a flag for the excessively sized Q. This behaviour is mimicked in DH_check_pub_key(). Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22518)
2023-11-06Fix documentation regarding KMAC sizesMichael Hinz
As per recommendation by jfinkhaeuser, this documents the defaults for KMAC-128 as 32 and for KMAC-256 as 64. The code already accomodates for these values, so no changes are needed there. Fixes #22381 CLA: trivial Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22614) (cherry picked from commit 56d1ab3b6c7468ce0f534f09e305a539101f9c3d)
2023-11-02Fix a possible memory leak in load_builtin_compressionsBernd Edlinger
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22585) (cherry picked from commit daf26c2d7a4d29ec1040fc0d5d4215cfc2dcf4a7)
2023-11-01free oaep label-octet-string on errorJames Muir
When X509_ALGOR_set0() fails, ownership of the the ASN1 object "los" (label octet string) has not been passed on to the X509_ALGOR object "oaep->pSourceFunc", so we need to free "los" in that case. Check return value of X509_ALGOR_set0(), change the scope of "los" and ensure it is freed on failure (on success, set it to NULL so it is not freed inside the function). Fixes #22336 Testing: You can use the following script to test cms encryption with rsa-oaep: #!/bin/bash -x OSSLCMD="apps/openssl" # check we are calling the right openssl app LD_LIBRARY_PATH=. valgrind $OSSLCMD version echo "this is a confidential message." > msg.txt LD_LIBRARY_PATH=. valgrind $OSSLCMD cms -encrypt -in msg.txt \ -stream -out msg.txt.cms \ -recip test/smime-certs/smrsa1.pem \ -keyopt rsa_padding_mode:oaep \ -keyopt rsa_oaep_md:sha256 \ -keyopt rsa_oaep_label:deadbeef Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22556) (cherry picked from commit a9a1b3da876456e1eecffbba15fb6d1820e8f379)
2023-10-26x509_print_ex: Remove unused setting when XN_FLAG_COMPAT is setDamian Hobson-Garcia
Calling X509_NAME_print_ex with XN_FLAG_COMPAT falls back to calling X509_NAME_print(). The obase parameter to X509_NAME_print() is not used, so setting it to a different value has no effect. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Todd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/19963) (cherry picked from commit 2126ca3dba3907f49b232442c06db1cae8bee0c3)
2023-10-26Fix X509_REQ_print_ex bugDamian Hobson-Garcia
Similar to the bug fixed in 02db7354fe7 (Fix bug in X509_print_ex). The error return value from X509_NAME_print_ex() is different depending on whether the flags are XN_FLAG_COMPAT or not. Apply a similar fix to what was done for X509_print_ex here as well. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Todd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/19963) (cherry picked from commit 2b5e028a2f70de216458a5140bcf4ec3d9236eeb)
2023-10-26x509_print_ex:Use correct constant for nmflag comparisonDamian Hobson-Garcia
The X509_FLAG_COMPAT constant is defined as a value of the X509_print_ex() cflags argument, and so it should not be used to compare against values for use with X509_NAME_print flags. Use XN_FLAG_COMPAT, which has the same value, instead. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Todd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/19963) (cherry picked from commit da2dd3b51ddd69aae0fd840c0d23afa954c24ded)
2023-10-26Fix potential NULL deref in ssl_old_test.cTodd Short
Fix #22367 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22383) (cherry picked from commit 42772df59bef7422060fbe70551c72d804bc669a)
2023-10-26aes-gcm-avx512.pl: fix non-reproducibility issuetrigpolynom
Replace the random suffix with a counter, to make the build reproducible. Fixes #20954 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22415) (cherry picked from commit 0fbc50ef0cb8894973d4739af62e95be825b7ccf)
2023-10-26bn: Properly error out if aliasing return value with modulusTomas Mraz
Test case amended from code initially written by Bernd Edlinger. Fixes #21110 Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22421) (cherry picked from commit af0025fc40779cc98c06db7e29936f9d5de8cc9e)
2023-10-26Link libatomic on riscv32Khem Raj
GCC toolchains on linux are not able to build libcrypto without linking to libatomic as it does not have all needed atomics implemented as intrinsics Fixes errors like | ld: ./libcrypto.so: undefined reference to `__atomic_is_lock_free' CLA: trivial Signed-off-by: Khem Raj <raj.khem@gmail.com> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22460) (cherry picked from commit d2e03c60347e19509e18a33ecb7f74502feb42ef)
2023-10-26return 0 if an error occurredAlexey Fofanov
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22504) (cherry picked from commit f0d88b4d070426493749cfd6b657e42dc3c2f5dd)
2023-10-25Avoid using gets as an argument name in a prototypeTomas Mraz
This otherwise breaks compilation of applications using ssl.h on MingW. Fixes #22296 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22316) (cherry picked from commit 2e471a740b621481b3f3236f82fdd677414900a1)
2023-10-24Prepare for 3.1.5Matt Caswell
Reviewed-by: Tomas Mraz <tomas@openssl.org> Release: yes
2023-10-24Prepare for release of 3.1.4openssl-3.1.4Matt Caswell
Reviewed-by: Tomas Mraz <tomas@openssl.org> Release: yes
2023-10-24make updateMatt Caswell
Reviewed-by: Tomas Mraz <tomas@openssl.org> Release: yes
2023-10-24Copyright year updatesMatt Caswell
Reviewed-by: Tomas Mraz <tomas@openssl.org> Release: yes
2023-10-24test: add unit test for CVE-2023-5363Pauli
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2023-10-24changes and news entries for CVE-2023-5363Pauli
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2023-10-24evp: process key length and iv length early if presentPauli
evp_cipher_init_internal() takes a params array argument and this is processed late in the initialisation process for some ciphers (AEAD ones). This means that changing the IV length as a parameter will either truncate the IV (very bad if SP 800-38d section 8.2.1 is used) or grab extra uninitialised bytes. Truncation is very bad if SP 800-38d section 8.2.1 is being used to contruct a deterministic IV. This leads to an instant loss of confidentiality. Grabbing extra bytes isn't so serious, it will most likely result in a bad decryption. Problem reported by Tony Battersby of Cybernetics.com but earlier discovered and raised as issue #19822. Fixes CVE-2023-5363 Fixes #19822 Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2023-10-24Fix Coverity 1547856: memset() uses only the lowest byte of cTomas Mraz
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> (Merged from https://github.com/openssl/openssl/pull/22430) (cherry picked from commit 0bf18140f491024232beca4e139c8feecfe207e9)
2023-10-24rand: fix seeding from a weak entropy sourceMatthias St. Pierre
The 'rand_generate' method is not well suited for being used with weak entropy sources in the 'get_entropy' callback, because the caller needs to provide a preallocated buffer without knowing how much bytes are actually needed to collect the required entropy. Instead we use the 'rand_get_seed' and 'rand_clear_seed' methods which were exactly designed for this purpose: it's the callee who allocates and fills the buffer, and finally cleans it up again. The 'rand_get_seed' and 'rand_clear_seed' methods are currently optional for a provided random generator. We could fall back to using 'rand_generate' if those methods are not implemented. However, imo it would be better to simply make them an officially documented requirement for seed sources. Fixes #22332 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22394) (cherry picked from commit 7998e7dc07d8f1f516af32887f2490c03cd8c594)
2023-10-24rand: improve error message for rand pool overflowsRichard Levitte
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22394) (cherry picked from commit 0a8faac3c7cc2e88f46a8bdce5bd039dc22abdec)
2023-10-20Reference the non-"legacy" provider names directly from EVP_md5(3) &c.наб
Earlier today, it took me five manuals! to find what on earth the "Performance"/"EVP_MD_fetch(3)" crosslinks actually mean: EVP_sha1(3) crypto(7) EVP_MD_fetch(3) (but not there! don't read that!) OSSL_PROVIDER-default(7) EVP_MD-SHA1(7) If, instead, EVP_sha1(3) referenced EVP_MD-SHA1(7) at /all/, which it should do, since it's supposed to be what you're replacing it with, but it doesn't actually say that, maybe people would use it. I know I didn't because it's basically just deadass buried As found by git grep -l 'and should consider using' Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22420) (cherry picked from commit b6eb95fa4439ea6254a5330487dabb2a499fb6c8)
2023-10-20rand: add callbacks to cleanup the user entropy resp. nonceMatthias St. Pierre
The `get_user_{entropy,nonce}` callbacks were add recently to the dispatch table in commit 4cde7585ce8e. Instead of adding corresponding `cleanup_user_{entropy,nonce}` callbacks, the `cleanup_{entropy,nonce}` callbacks were reused. This can cause a problem in the case where the seed source is replaced by a provider: the buffer gets allocated by the provider but cleared by the core. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22423) (cherry picked from commit 5516d20226c496c2b22fa741698b4d48dad0428f)
2023-10-19load_key_certs_crls(): There is no quiet argumentTomas Mraz
This fixes broken cherry-pick from the master branch where there is a quiet argument. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22434)
2023-10-19cms_enc.c: Include crypto/asn1.h for struct asn1_object_stTomas Mraz
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22432) (cherry picked from commit fa9e6ad46860ea92aa2e1ba997b20c6dff76b42c)
2023-10-19apps: Print out a proper message when a store cannot be openedTomas Mraz
Fixes #22306 Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22318) (cherry picked from commit edc2b6e3b1950ab0fb71e2d7dca0836b43a9ec3b)
2023-10-18Add a test to confirm that legacy rsa keys workNeil Horman
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22334) (cherry picked from commit e62097f48c3d0b8b61ca6a061b8098b0086b3fbc)
2023-10-18Dont require CRT params on ossl_rsa_set0_all_paramsNeil Horman
Its not required that crt params be available in an RSA key, so don't perform an error check on them Fixes #29135 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22334) (cherry picked from commit 2647726bd3ca63dc5f07ae3f10e16dff35d95626)
2023-10-18remove sanity check from ossl_rsa_todataNeil Horman
Theres no reason we should gate ossl_rsa_todata on there being a minimum set of parameters. EVP_PKEY_todata makes no guarantees about the validity of a key, it only returns the parameters that are set in the requested key, whatever they may be. Remove the check. Fixes #21935 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22334) (cherry picked from commit 4ad3a44ba45a4026170336161228d435f6784564)
2023-10-18ossl_param_build_set_multi_key_bn(): Do not set NULL BIGNUMsTomas Mraz
This makes them zeroes otherwise where NULLs actually mean the values aren't present. Fixes #21935 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> (Merged from https://github.com/openssl/openssl/pull/22334) (cherry picked from commit 15a39e7025e0ed4e31664c499894006e41582068)
2023-10-18ensure that ossl_obj_nid_lock is allocated before useNeil Horman
external calls to OBJ_new_nid will fail on an attempt to lock the ossl_obj_nid_lock as it won't have been initalized yet. Bifurcate OBJ_new_nid into an external and internal variant, in which the former calls ossl_obj_write_lock (ensuring that the nid_lock is initalized), while OBJ_create (the sole internal caller) uses the latter to avoid having to drop and re-acquire the lock Fixes #22337 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22350) (cherry picked from commit cd920f8fa1bb603a620bea697027f5573fadc12e)
2023-10-18cms encrypt, better OBJ_nid2obj() return checkJames Muir
Fixes #22225 In OBJ_nid2obj(), if the NID does not have an OID, then a pointer to the special "undefined" ASN1_OBJECT is returned. Check for the undefined-ASN1_OBJECT and return an error. Also, add a test for this in 80-test_cms.t. Testing: #!/bin/bash -x shopt -s expand_aliases alias openssl="LD_LIBRARY_PATH=~/git/openssl ~/git/openssl/apps/openssl" echo "This is a confidential message. It should be encrypted." > msg.txt ## this should fail b/c there is no OID for aes-256-ctr openssl cms -encrypt -in msg.txt -aes-256-ctr -out msg.txt.cms -recip demos/cms/signer.pem echo $? Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22392) (cherry picked from commit bd160912dcc5e39bcdc925d9aa6538f20e37ad16)
2023-10-18fix: LINEAR search doesn't work properly (if CHARSET_EBCDIC is defined)Pavel Stetsuk
CLA: trivial Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22108) (cherry picked from commit a47fc4ed401da4e2d84e035cc4add566e85b03d0)
2023-10-18rsa: Accept NULL OAEP label for backward compatibilityDaiki Ueno
According to the manual page, EVP_PKEY_CTX_set0_rsa_oaep_label() should accept NULL as the label argument, though the function currently rejects it while setting the corresponding octet string parameter with OSSL_PARAM_construct_octet_string, which expects non-NULL input. This adds a workaround to the caller for backward compatibility. Signed-off-by: Daiki Ueno <dueno@redhat.com> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22397) (cherry picked from commit 21b98da9d80c561b6273b0c51c259196d6740e70)
2023-10-18Update unix Makefile template to handle paths with spacesJames Muir
Fixes #4668 (on unix-like platforms) Testing: rm -rf "$HOME/tmp/beforespace afterspace" ./Configure -Werror --strict-warnings --prefix="$HOME/tmp/beforespace afterspace" make -j6 update make -j6 make install make test Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22386)
2023-10-17EVP shake_ctrl(): add missing NULL evp_ctx checkDr. David von Oheimb
Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22390) (cherry picked from commit 410c80dc7bf2085167553ab9fa517189eed2b3a6)
2023-10-17CMS_add1_signer(): add missing ERR_raise() callsDr. David von Oheimb
Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22390) (cherry picked from commit 72a99ef665b26fa207c0eee6e7e4842d1e42752c)
2023-10-17CMS_add1_signer.pod: add missing info on CMS_SignerInfo_sign() return valuesDr. David von Oheimb
Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22390) (cherry picked from commit 2c581eb2fd92e997dfe0761b086eb690271cefc2)
2023-10-17PKCS7_SIGNER_INFO: point out confusing names of digest_enc_alg and ↵Dr. David von Oheimb
enc_digest fields Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22390) (cherry picked from commit e15891b477fe9c3d3dc6f331812c9e8afc48dc05)
2023-10-13cmp: add null pointer check in tear_down test functionPauli
problem reported by: 2ourc3 Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22355) (cherry picked from commit 91a5c0e40cf272d18b65c9e4c9a0268f244758a8)
2023-10-13Fix parenthesis, use a colonJames Muir
Reviewed-by: Paul Dale <pauli@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/22356) (cherry picked from commit 008ca01e506d85acf0cc06ea8f219a883328344c)
2023-10-13Windows: use srand() instead of srandom()Tomas Mraz
This is used for memory allocation failure debugging only Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22347) (cherry picked from commit 3b107b86ca7d1c6309bc7071ead59acb8c098f3b)
2023-10-13Windows CI: Add some non-default options to check they are workingTomas Mraz
Some of the non-default options that enable more code to be built need to be enabled in one of the Windows builds to avoid regressions. Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22347) (cherry picked from commit 10767fd9db14b6eedfb0827f9e404c0d4b94424b)
2023-10-11DH_check_pub_key() should not fail when setting result codeTomas Mraz
The semantics of ossl_ffc_validate_public_key() and ossl_ffc_validate_public_key_partial() needs to be changed to not return error on non-fatal problems. Fixes #22287 Reviewed-by: Todd Short <todd.short@me.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22291) (cherry picked from commit eaee1765a49c6a8ba728e3e2d18bb67bff8aaa55)
2023-10-11test/recipes/05-test_rand.t: replace 'and' with '&&'Richard Levitte
The lower priority 'and' seems to have some "interesting" interactions with function argument parsing in some perl versions (presumably because 'and' is lower priority than the comma). For the lines that are changed here, perl v5.20.1 says this: Useless use of string eq in void context at [.test.recipes]05-test_rand.t line 33. Useless use of numeric eq (==) in void context at [.test.recipes]05-test_rand.t line 39. Replacing 'and' with '&&' in these two cases fixes the problem. Replacing Reviewed-by: Hugo Landau <hlandau@openssl.org> 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/22331) (cherry picked from commit 715242b1ca2b7267a70fb13c3544a84b947a6e81)
2023-10-11Improve Malloc Failure TestBernd Edlinger
Allow 2 digits after the comma in percentage in OPENSSL_MALLOC_FAILURES. Add OPENSSL_MALLOC_SEED to allow for some randomization. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22127) (cherry picked from commit 3df5736cf303d2c69654ba1c295a9772b738608e)
2023-10-10Added check for the return value of the RAND_bytes() functionKlavishnik
Call app_bail_out if RAND_bytes() fails. Also changed the output parameter of RAND_bytes() to inp as writing to encrypted output buffer does not make sense. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21706) (cherry picked from commit 8d120aef951d7bb7deac0b8b559f8003f5ea6384)
2023-10-09Avoid divide-by-zero in kmac_prov.c's bytepad()Klavishnik
This would happen if EVP_MD_get_block_size() returned 0 so we return an error instead. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21698) (cherry picked from commit 91895e39b10033178e662fc7427a09d7562cf8e1)