summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2022-06-21make updateMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> Release: yes
2022-06-21Use --release in dev/release.shHugo Landau
Fixes #18243. Fixes #18242. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18305)
2022-06-21Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> Release: yes
2022-06-21Update CHANGES.md and NEWS.md for new releaseMatt Caswell
Reviewed-by: Tomas Mraz <tomas@openssl.org> Release: yes
2022-06-20c_rehash: Drop the issuer_name_hash= prefix from the CRL hashTomas Mraz
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2022-06-20Fix file operations in c_rehash.Daniel Fiala
CVE-2022-2068 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2022-06-20providers/implementations/exchange/kdf_exch.c: fix unavailable SIZE_MAXRichard Levitte
SIZE_MAX is used in a recent fix of this file, but without including internal/numbers.h, so that macro ends up not existing on some platforms, resulting in build failures. 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/18605)
2022-06-17Clarify use of EGD for HPNS in rand/rand_egd.c comments.Randall S. Becker
Signed-off-by: Randall S. Becker <randall.becker@nexbridge.ca> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18565)
2022-06-16Fix documentation of BIO_FLAGS_BASE64_NO_NLFraser Tweedale
Commit 8bfb7506d210841f2ee4eda8afe96441a0e33fa5 updated `BIO_f_base64(3)` to improve the documentation of the `BIO_FLAGS_BASE64_NO_NL` flag. In particular, the updated text states that when this flag is used, all newlines in the input are ignored. This is incorrect, as the following program proves: ```c unsigned char *in_buf = "IlRoZSBxdWljayBicm93biBmb3gganVt\ncHMgb3ZlciBhIGxhenkgZG9nLiI=\n"; int main(int argc, char **argv) { BIO *b64 = BIO_new(BIO_f_base64()); if (b64 == NULL) return 1; BIO_set_flags(b64, BIO_get_flags(b64) | BIO_FLAGS_BASE64_NO_NL); int in_len = strlen(in_buf); BIO *in = BIO_new_mem_buf(in_buf, in_len); if (in == NULL) return 2; in = BIO_push(b64, in); unsigned char *out_buf = calloc(in_len, sizeof(unsigned char)); if (out_buf == NULL) return 3; size_t out_len; int r = BIO_read_ex(in, out_buf, in_len, &out_len); printf("rv = %d\n", r); printf("decoded = %s\n", out_buf); return 0; } ``` Update the text of `BIO_f_base64(3)` to clarify that when the flag is set, the data must be all on one line (with or without a trailing newline character). Signed-off-by: Fraser Tweedale <ftweedal@redhat.com> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18568) (cherry picked from commit 0edcbacca99ab2b716da395f204610fc2775ea83)
2022-06-16Have set_dateopt() return 1 on success to make -dateopt workHartmut Holzgraefe
Fixes #18553 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18554)
2022-06-16test/recipes/*.t: setup() doesn't play well with spaces in the argumentRichard Levitte
The argument translates into a directory name, and there are platforms that don't allow spaces (at least not easily), which makes the test fail. This modifies it to conform a bit better to the usual form for that arg. Reviewed-by: Todd Short <todd.short@me.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18531) (cherry picked from commit e3ba938b584275839dda404d846abdb06a88693f)
2022-06-16Fix for OSSL_PARAM sample code referencing OSSL_PARAM_UTF8_PTRMichael Baentsch
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18490) (cherry picked from commit 809526a06c1305d67a8f231ca15cd27ec800efce)
2022-06-16Add an extra reduction step to RSAZ mod_exp implementationsTomas Mraz
Inspired by BoringSSL fix by David Benjamin. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18510) (cherry picked from commit 6d702cebfce3ffd9d8c0cb2af80a987d3288e7a3)
2022-06-16Always end BN_mod_exp_mont_consttime with normal Montgomery reduction.Tomas Mraz
This partially fixes a bug where, on x86_64, BN_mod_exp_mont_consttime would sometimes return m, the modulus, when it should have returned zero. Thanks to Guido Vranken for reporting it. It is only a partial fix because the same bug also exists in the "rsaz" codepath. The bug only affects zero outputs (with non-zero inputs), so we believe it has no security impact on our cryptographic functions. The fx is to delete lowercase bn_from_montgomery altogether, and have the mont5 path use the same BN_from_montgomery ending as the non-mont5 path. This only impacts the final step of the whole exponentiation and has no measurable perf impact. See the original BoringSSL commit https://boringssl.googlesource.com/boringssl/+/13c9d5c69d04485a7a8840c12185c832026c8315 for further analysis. Original-author: David Benjamin <davidben@google.com> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18510) (cherry picked from commit 0ae365e1f80648f4c52aa3ac9bbc279b6192b23e)
2022-06-16test/ssl_old_test.c: Add check for OPENSSL_mallocJiasheng Jiang
As the potential failure of the OPENSSL_malloc(), it should be better to add the check and return error if fails. Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18555) (cherry picked from commit b2feb9f0e394da6570346598837f1b01eb58c028)
2022-06-16Add sensitive memory clean in priv encodeKan
Fixes #18540 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18541) (cherry picked from commit 16249341bb64329c2542c3d1e23b97ed3c44fad3)
2022-06-15test/ssl_old_test.c: Add check for OPENSSL_zallocJiasheng Jiang
As the potential failure of the OPENSSL_zalloc(), it should be better to add the check and return error if fails. Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Yang <kaishen.yy@antfin.com> Reviewed-by: Todd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/18552) (cherry picked from commit 4f4942a133bd57c4940fb1bc6ed7c8b67da4d8f0)
2022-06-15Fix a mem leak in evp_pkey_export_to_providerK1
If keymgmt is NULL, tmp_keymgmt is allocated and will not be freed. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Yang <kaishen.yy@antfin.com> Reviewed-by: Todd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/18499) (cherry picked from commit 115eb945acd9a27bf81c6c8923f43768f9e487a8)
2022-06-15Fix a crash in X509v3_asid_subset()Matt Caswell
If the asnum or rdi fields are NULL and the ASIdentifiers are otherwise subsets then this will result in a crash. Of note is that rdi will usually be NULL. Reported by Theo Buehler (@botovq) Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Yang <kaishen.yy@antfin.com> Reviewed-by: Todd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/18514) (cherry picked from commit 01fc9b6bce82f0534d6673659a0e59a71f57ee82)
2022-06-15providers/implementations/exchange/kdf_exch.c: Fix kdf_derive()Richard Levitte
kdf_derive() calls EVP_KDF_derive(), but didn't do enough to adapt its input buffer length arguments to fit the requirements to call EVP_KDF_derive(). Fixes #18517 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18533)
2022-06-15test/evp_test.c: Check too big output buffer sizes in PKEYKDF testsRichard Levitte
EVP_PKEY_derive() should be able to cope with a too big buffer for fixed size outputs. However, we don't test that. This change modifies the PKEYKDF tests to ask EVP_PKEY_derive() what the desired output buffer size is, and as long as the returned value isn't absurd (indicating that anything goes), the output buffer is made to be twice as big as what is expected. Tests #18517 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18533)
2022-06-15Fix the export routines to not return success if param alloc failedMatt Caswell
We fix the dsa, dh, ec and rsa export routines so that they are consistent with each other and do not report success if the allocation of parameters failed. This is essentially the same fix as applied in #18483 but applied to all relevant key types. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18507) (cherry picked from commit 46c1c2d7fa9153da4eb5e1aefd7b0139dc507c00)
2022-06-15test_pkey_check: Positive testcase for private key with unknown parametersTomas Mraz
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18099) (cherry picked from commit 08e0aad293f1c283dccf7e9065ec28af5e143304)
2022-06-15ossl_dh_check_priv_key: Do not fail on private keys without qTomas Mraz
Fixes #18098 Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18099) (cherry picked from commit 0615cedecda7ed18300db48b0bb56cec6d3527bd)
2022-06-15Testcase for regression by PPC64 fixed length montgomery multiplicationTomas Mraz
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18512) (cherry picked from commit 14f95126c098358c434d59835834f9f0be7ea498)
2022-06-15Revert "bn: Add fixed length (n=6), unrolled PPC Montgomery Multiplication"Tomas Mraz
This reverts commit 0d40ca47bd86e74a95c3a2f5fb6c67cdbee93c79. It was found that the computation produces incorrect results in some cases. Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18512) (cherry picked from commit 712d9cc90e355b2c98a959d4e9398610d2269c9e)
2022-06-15Avoid reusing the init_lock for a different purposeTomas Mraz
Otherwise we might cause a recursive locking. Fixes #18535 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18545) (cherry picked from commit e9a806b2c265da3a4ca472acb4a4286d9c1b5c9d)
2022-06-13RSA keygen update: Raise an error if no prime candidate q is found.slontis
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18429) (cherry picked from commit d2399d8cd29f56e6614f0b3db4e7e563a745902a)
2022-06-13RSA Keygen update - When using the default provider fallback to default ↵slontis
multiprime keygen if e is < 65537 Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18429) (cherry picked from commit 27c1cfd7653b7204af3301f93ccd2a3decfc309b)
2022-06-13RSA keygen fixesslontis
Fixes #18321 Increase the iteration factor used when 'Computing a Probable Prime Factor Based on Auxiliary Primes' from 5 to 20. This matches the algorithm update made in FIPS 186-5. Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18429) (cherry picked from commit ad7e0fd550a9eb2946edf38003ebc6d5b988dac7)
2022-06-12Include the modules directory in openssl.pcRichard Levitte
Affected file: Configurations/unix-Makefile.tmpl Fixes #18516 Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18520)
2022-06-10sm2_dupctx: Avoid potential use after free of the mdTomas Mraz
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18494) (cherry picked from commit 926c698c6f0a197e0322d4617db0ecd0d40f6e06)
2022-06-10Check return of BIO_new() and always free pkey from evp_pkey_copy_downgraded()Tomas Mraz
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18494) (cherry picked from commit d8732803c493cba7a863c5c16da62ee9d611c5ca)
2022-06-10add_provider_groups: Clean up algorithm pointer on failureTomas Mraz
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18494) (cherry picked from commit a7863f994955c45fb7ce29e30b81a6206994c3dd)
2022-06-10parse_unquoted: Check returned value from ossl_property_value()Tomas Mraz
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18494) (cherry picked from commit f91568eb50e847d0db2441fd9b9c5ffc8c4fe934)
2022-06-10Fix a use after free in error handling of hmac_dupBernd Edlinger
dst->digest needs to be zeroized in case HMAC_CTX_copy or ossl_prov_digest_copy return failure. Fixes #18493 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18502) (cherry picked from commit cec1699f1f54ba8b87f055776dc77b48dd37d5fa)
2022-06-09Assert that a property definition cache entry is the firstMatt Caswell
When adding a property definition cache entry for a given property query string we add an assert that we are not replacing an existing entry. If we are then that indicates a bug in the caller. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Todd Short <todd.short@me.com> Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18458) (cherry picked from commit 5f4b3db624a83b812f23412e698ffd9c4284f87a)
2022-06-09Fix a memory leak in ossl_method_store_add()Matt Caswell
If the call to ossl_prop_defn_set() fails then the OSSL_PROPERTY_LIST we just created will leak. Found as a result of: https://github.com/openssl/openssl/pull/18355#issuecomment-1139499881 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Todd Short <todd.short@me.com> Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18458) (cherry picked from commit fed8dbea27b7e01ee934951b25c6ffd40ad1d5c3)
2022-06-09Update SIV mode documentationTodd Short
Fixes #18440 Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18485) (cherry picked from commit 9cef2a70b151b6a92eb1770ceb5fa90331305934)
2022-06-08Don't report success from ec_export if OSSL_PARAM_BLD_to_param failedMatt Caswell
If the call to OSSL_PARAM_BLD_to_param() failed then ec_export was reporting success, even though it has never called the param_cb. Found due to: https://github.com/openssl/openssl/pull/18355#issuecomment-1145993650 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18483) (cherry picked from commit 7d6aad832b4cebb181c53ab80a3f61dc8549be08)
2022-06-08Fix a mem leak in evp_pkey_copy_downgraded()Matt Caswell
If we get a failure during evp_pkey_copy_downgraded() and on entry *dest was NULL then we leak the EVP_PKEY that was automatically allocated and stored in *dest. Found due to this comment: https://github.com/openssl/openssl/pull/18355#issuecomment-1145028315 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/18470)
2022-06-06Check return value of ossl_parse_property()Tomas Mraz
Also check if we have d2i_public_key() function pointer. Fixes https://github.com/openssl/openssl/pull/18355#issuecomment-1144893289 Reviewed-by: Todd Short <todd.short@me.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18462) (cherry picked from commit 4fa5ed5ce5c345eaeaec8b86eda265add467f941)
2022-06-06CONF_modules_unload should fail if CONF_modules_finish failsMatt Caswell
The module_list_lock is used by CONF_modules_unload(). That function relies on the RUN_ONCE in CONF_modules_finish() to initialise that lock. However if the RUN_ONCE fails that failure is not propagated to CONF_modules_unload() and so it erroneously tries to use the lock anyway. Found due to: https://github.com/openssl/openssl/pull/18355#issuecomment-1144734604 Reviewed-by: Todd Short <todd.short@me.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18460) (cherry picked from commit 697d0b5ba146c232f5b2aa87f4e847a5495c1735)
2022-06-05Fix inadvertent NULL assignments in ternary opsClemens Lang
As identified by both clang with a warning and $> git grep -P '(?<![!=])= NULL \?' Signed-off-by: Clemens Lang <cllang@redhat.com> CLA: trivial Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18469) (cherry picked from commit 1a01e5c29dfaf09af3960b4c8e6ec0f8171eda80)
2022-06-05Update further expiring certificates that affect testsTomas Mraz
Namely the smime certificates used in test_cms and the SM2 certificates will expire soon and affect tests. Fixes #15179 Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18467) (cherry picked from commit 5d219937d067a761fb871483369a6020c60a3cb8)
2022-06-03Change the SCT issuer key to RSA 2048Bernd Edlinger
This avoids the need to use SECLEVEL=1 in 12-ct.cnf.in. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Todd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/18450) (cherry picked from commit 479b9adb88b9050186c1e9fc94879906f378b14b)
2022-06-03Fix strict client chain check with TLS-1.3Tomas Mraz
When TLS-1.3 is used and the server does not send any CA names the ca_dn will be NULL. sk_X509_NAME_num() returns -1 on null argument. Reviewed-by: Todd Short <todd.short@me.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17986) (cherry picked from commit 89dd85430770d39cbfb15eb586c921958ca7687f)
2022-06-02Add VERSIONINFO resource to legacy provider if it is not builtinslontis
Reviewed-by: Richard Levitte <levitte@openssl.org> 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/18416) (cherry picked from commit 9510661400470d357c74c5c4d0ff01c7b813b974)
2022-06-02Add Windows VERSIONINFO resource to fips provider dll.slontis
Fixes #18388 This just looks like an omission, as this is added to libcrypto and libssl Reviewed-by: Richard Levitte <levitte@openssl.org> 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/18416) (cherry picked from commit 18f0870d39eb055c8c67af8025fd1b9e01ce6a43)
2022-06-02Fix the checks of BIO_get_cipher_statusPeiwei Hu
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/18424) (cherry picked from commit 48b571fe771f283d547ca2a5999ce5dd9a5509d0)