summaryrefslogtreecommitdiffstats
path: root/providers
AgeCommit message (Collapse)Author
2022-04-19Avoid undefined behavior of provided macs on EVP_MAC reinitializationTomas Mraz
When the context is reinitialized, i.e. the same key should be used we must properly reinitialize the underlying implementation. However in POLY1305 case it does not make sense as this special MAC should not reuse keys. We fail with this provided implementation when reinitialization happens. Fixes #17811 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18100) (cherry picked from commit c9ddc5af5199909d196ee80ccd7abcff2eb42a34)
2022-04-11ec_export: Other parameters are exportable with domain parametersTomas Mraz
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17981) (cherry picked from commit e20af37d063514c27567c64e975fa5b3208707a9)
2022-04-11sm2: Allow setting 0 length SM2 dist ID paramTomas Mraz
Fixes #18022 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18052) (cherry picked from commit 2904d0a2ae0ec6ce23d5cec66ce8c7bdb005d4e5)
2022-04-11kdf: avoid NULL dereference on malloc failure in sshkdfPauli
Fixes #18009 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/18011) (cherry picked from commit 148176ca323e3dfce5d5cdb5578c113c8d2440bb)
2022-03-15make updateMatt Caswell
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2022-03-15Update copyright yearMatt Caswell
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2022-03-14DH: Make padding always on when X9.42 KDF is usedTomas Mraz
Fixes #17834 Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/17859) (cherry picked from commit 01b18775676115945956f4de0eb0cafedaf027ab)
2022-02-14dh_exch.c: Add check for OPENSSL_strdupJiasheng Jiang
Since the OPENSSL_strdup() may return NULL if allocation fails, it should be better to check the return value. Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17651) (cherry picked from commit c920020f0bb13f0d2bf0fcad5c7ee63458b633b4)
2022-02-03Fix copyrightsTodd Short
Add copyright to files that were missing it. Update license from OpenSSL to Apache as needed. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17606) (cherry picked from commit 9d987de3aabe54e65a55649a61953966f33b070b)
2022-02-03Fix EVP todata and fromdata when used with selection of EVP_PKEY_PUBLIC_KEY.slontis
The private key for rsa, dsa, dh and ecx was being included when the selector was just the public key. (ec was working correctly). This matches the documented behaviour. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17200) (cherry picked from commit 944f822aadc88b2e25f7695366810c73a53a00c8)
2022-01-28Add the missing check of BN_bn2hex return valueZhou Qingyang
CLA: trivial Signed-off-by: Zhou Qingyang <zhou1615@umn.edu> 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/17578) (cherry picked from commit 4dd085c03a885580cc945f71187131ea7fb39b70)
2022-01-27Fix IV length of DES EDE ECB implementationsTomas Mraz
Fixes #17587 Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17591) (cherry picked from commit d450eb84c802b2f78971f905b251a0fb89ebb7d1)
2022-01-18dh_exch.c: Correct gettable parameters for DH key exchangeTomas Mraz
Fixes #17510 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17515) (cherry picked from commit c1167f09d840b109ef1c1c1485e3de64be2fc625)
2022-01-17Do not call ossl_ffc_name_to_dh_named_group with NULL argumentTomas Mraz
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17498) (cherry picked from commit 3b53f88c008d288e86d2bbdc0c4e2d16c29fcee8)
2022-01-13drbg: add handling for cases where TSAN isn't availablePauli
Most of the DRGB code is run under lock from the EVP layer. This is relied on to make the majority of TSAN operations safe. However, it is still necessary to enable locking for all DRBGs created. Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/17479)
2022-01-13Avoid using a macro expansion in a macro when statically initialisingPauli
Circumvents a problem with ancient PA-RISC compilers on HP/UX. Fixes #17477 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17478) (cherry picked from commit 9c5d1451292566e546d5dd01c7f19950fa34391d)
2022-01-07providers/implementations/keymgmt/rsa_kmgmt.c: refactor gen_initPeiwei Hu
There is risk to pass the gctx with NULL value to rsa_gen_set_params which dereference gctx directly. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17429) (cherry picked from commit 22778abad905536fa6c93cdc6fffc8c736dfee79)
2022-01-06OSSL_STORE: Prevent spurious error during loading private keysDr. David von Oheimb
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15283) (cherry picked from commit da198adb9c5626f31c52613fe2ae59a7066c3366)
2022-01-05check the return value of OSSL_PARAM_BLD_new in dsa_kmgmt.c:195x2018
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17155) (cherry picked from commit 0da3b39af3d961486758262ca71d2135d7013048)
2022-01-03Check the return value of ossl_bio_new_from_core_bio()x2018
There are missing checks of its return value in 8 different spots. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17154) (cherry picked from commit 352a0bcaab8eda18cce786d2871e8d4ec6f9cbfe)
2021-12-20Fix deref after nullABautkin
ctx may be NULL at 178 line CLA: trivial Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17293) (cherry picked from commit 68b78dd7e40f57064b0f24728d8b544fe583599c)
2021-12-14make updateMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2021-12-13Adapt our OSSL_FUNC_keymgmt_match() implementations to the EVP_PKEY_eq() fixRichard Levitte
The match function (called OSSL_FUNC_keymgmt_match() in our documentation) in our KEYMGMT implementations were interpretting the selector bits a bit too strictly, so they get a bit relaxed to make it reasonable to match diverse key contents. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16765) (cherry picked from commit ee22a3741e3fc27c981e7f7e9bcb8d3342b0c65a)
2021-12-08rename MIN() macroGerd Hoffmann
MIN is a rather generic name and results in a name clash when trying to port tianocore over to openssl 3.0. Use the usual ossl prefix and rename the macro to ossl_min() to solve this. CLA: trivial Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17219) (cherry picked from commit f4f77c2d9756cee12875397276799a93f057d412)
2021-12-06key_to_type_specific_pem_bio_cb: Use passphrase callback from the argumentsTomas Mraz
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17181) (cherry picked from commit c22b6592135bfba95a315e438ac7bfc6db461407)
2021-12-06PVK decoder: prompt for PVK passphrase and not PEMTomas Mraz
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17181) (cherry picked from commit 28257d60577932e66934096d0ee8a5dfaca1191e)
2021-12-06Fix pvk encoder to properly query for the passphraseTomas Mraz
The passphrase callback data was not properly initialized. Fixes #17054 Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17181) (cherry picked from commit baa88d9d170b95fd6f177b3e5f8d8818e024a55d)
2021-12-01various kdfs: Always reset buflen after clearing the bufferTomas Mraz
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17165) (cherry picked from commit d2217c88df6e65c756013417e5ee4f470dd12470)
2021-11-23rsa_signverify_init: Set the PARAMS after key is setTomas Mraz
Also, default to unrestricted pss parameters until the key is set. Fixes #17075 Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17080) (cherry picked from commit eaae5d69eb5a8cd9c054b23cc388397cbb4ffb98)
2021-11-22Fix the return check of OBJ_obj2txtPW Hu
Also update OBJ_nid2obj.pod to document the possible return values. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17005) (cherry picked from commit 2349d7ba57c9327290df6f7bc18b7f0c3976ca9e)
2021-11-15Add null digest implementation to the default providerTomas Mraz
This is necessary to keep compatibility with 1.1.1. Fixes #16660 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17016) (cherry picked from commit bef9b48e5071cdd2b41a4f486d1bcb5e14b2a5c3)
2021-11-12providers: Allow possible reinitialization in all signature algorithmsTomas Mraz
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16964) (cherry picked from commit 3ffd23e9529d725903bc97fd45489a77b831876f)
2021-11-12do_sigver_init: Allow reinitialization of an existing operation.Tomas Mraz
Fixes #16936 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16964) (cherry picked from commit ae6b68b761b9c5f30897747487ea943ccfab53ba)
2021-11-09Fix DER encoder implementations for output structures "EC" and "SM2"Richard Levitte
These DER encoder implementations are supposed to be aliases for the "type-specific" output structure, but were made different in so far that they would output a "type specific" public key, which turns out to be garbage (it called i2o_ECPublicKey()). The "type-specific" output structure doesn't support that, and shouldn't. Fixes #16977 Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16983)
2021-11-08Address Coverity 1493362 resource leakPauli
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16962) (cherry picked from commit 1b4d9967a24154f1dc00f471eb843203ec7bb7d4)
2021-10-27Don't crash encoding a public key with no public key valueMatt Caswell
If asked to encode an EC_KEY public key, but no public key value is present in the structure, we should fail rather than crash. Fixes the crash seen here: https://mta.openssl.org/pipermail/openssl-users/2021-October/014479.html Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16911) (cherry picked from commit 6187d9eac2738e873d23c0c91f9769333b1bb6af)
2021-10-26test-rand: return failure on not enough data, allow parentPauli
The test-rand RNG was returning success when it had some but insufficient data. Now, it returns failure and doesn't advance the data pointer. The test-rand RNG was failing when a parent was specified. This case is now ignored. Fixes #16785 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16905) (cherry picked from commit d4dfd983e32b32b633aaa9edec422cc30419c6f7)
2021-10-22Fix a bug in signature self tests in the FIPS moduleMatt Caswell
When calling EVP_PKEY_sign(), the size of the signature buffer must be passed in *siglen. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16789) (cherry picked from commit 61adb6cf950b65a7bfce9a8d78a7744dfae9f978)
2021-10-22Fix SSKDF to not claim a buffer size that is too small for the MACMatt Caswell
We also check that our buffer is sufficiently sized for the MAC output Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16789) (cherry picked from commit 7be8ba546267787c1b0df8a4fddaf9cb29944cbb)
2021-10-19Update provider_util.c to correctly handle ENGINE referencesMatt Caswell
provider_util.c failed to free ENGINE references when clearing a cipher or a digest. Additionally ciphers and digests were not copied correctly, which would lead to double-frees if it were not for the previously mentioned leaks. Fixes #16845 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16846) (cherry picked from commit 86c15ba87488f88e6191f098ff154f79ce91847b)
2021-10-15Raise error when invalid digest used with SM2Tomas Mraz
Otherwise commands like openssl req -newkey sm2 fail silently without reporting any error unless -sm3 option is added. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16833) (cherry picked from commit d5d95daba59adc41ab60ea86acd513f255fca3c0)
2021-09-22rand: don't free an mis-set pointer on errorPauli
This is adding robustness to the code. The fix to not mis-set the pointer is in #16636. Fixes #16631 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/16640) (cherry picked from commit caf569a5b3271c2860732ee44509f3825a179fd5)
2021-09-21Avoid double-free on unsuccessful getting PRNG seedingDmitry Belyavskiy
Fixes #16631 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16636) (cherry picked from commit 52dcc011191ad1a40fd52ae92ef009309deaca52)
2021-09-15providers: Do not use global EVP_CIPHERs and EVP_MDsTomas Mraz
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16600) (cherry picked from commit e59bfbaa2dbd680f77e1121e382502bd522a466c)
2021-09-07make updateRichard Levitte
Reviewed-by: Tomas Mraz <tomas@openssl.org>
2021-09-07Update copyright yearRichard Levitte
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16534)
2021-09-05ENCODER PROV: Add encoders with EncryptedPrivateKeyInfo outputRichard Levitte
Since EncryptedPrivateKeyInfo is a recognised structure, it's reasonable to think that someone might want to specify it. To be noted is that if someone specifies the structure PrivateKeyInfo but has also passed a passphrase callback, the result will still become a EncryptedPrivateKeyInfo structure. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16466) (cherry picked from commit 0195cdd28fde7d0897e368fdcd4e92509425faad)
2021-09-05OSSL_STORE 'file:' scheme: Set input structure for certificates and CRLsRichard Levitte
When the user expects to load a certificate or a CRL through the OSSL_STORE loading function, the 'file:' implementation sets the corresponding structure names in the internal decoder context. This is especially geared for PEM files, which often contain a mix of objects, and password prompting should be avoided for objects that need them, but aren't what the caller is looking for. Fixes #16224 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16466) (cherry picked from commit 821b3956ec698927281a5b29c55cd87eb7b2793d)
2021-09-05PEM to DER decoder: Specify object type and data structure more consistentlyRichard Levitte
The data structure wasn't given for recognised certificates or CRLs. It's better, though, to specify it for those objects as well, so they can be used to filter what actually gets decoded, which will be helpful for our OSSL_STORE 'file:' scheme implementation. Fixes #16224 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16466) (cherry picked from commit 98408852c167d895a662dcda824fd5170cad3f7d)
2021-09-03Fix dh dupctx refcount errorslontis
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16495) (cherry picked from commit 21a0d9f3edda78d27d12cd7704de9e32976393ba)