summaryrefslogtreecommitdiffstats
path: root/providers
AgeCommit message (Collapse)Author
2022-10-19Avoid putting ripemd_prov.c in libcommon otherwise it is regarded as fips sourceTomas Mraz
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19375) (cherry picked from commit 155a82d1fe1c50d859081ff67f26633b9d7dada8)
2022-10-19default provider: include RIPEMD160Pauli
Including RIPEMD160 in both the default and legacy providers shouldn't break anyone and makes the algorithm available more readily. Fixes #17722 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19375) (cherry picked from commit ecd831469919215b0a45693b00ec0fd7d42d5d61)
2022-10-11make updateMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> Release: yes
2022-10-11Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> Release: yes (Merged from https://github.com/openssl/openssl/pull/19382)
2022-10-07set MGF1 digest correctlyJames Muir
Fixes #19290 update rsa_set_ctx_params() so that the digest function used in the MGF1 construction is set correctly. Add a test for this to evp_extra_test.c based on the code scaro-axway provided in #19290. Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19342) (cherry picked from commit e5a7536eaeaacd18d1aea59edeb295fb4eb2dfca)
2022-08-19Limit the size of various MAXCHUNK definitionsPauli
The current code has issues when sizeof(long) <> sizeof(size_t). The two types are assumed to be interchangeable and them being different will cause crashes and endless loops. This fix limits the maximum chunk size for many of the symmetric ciphers to 2^30 bytes. This chunk size limits the amount of data that will be encrypted/decrypted in one lump. The code internally handles block of data later than the chunk limit, so this will present no difference to the caller. Any loss of efficiency due to limiting the chunking to 1Gbyte rather than more should be insignificant. Fixes Coverity issues: 1508498, 1508500 - 1508505, 1508507 - 1508527, 1508529 - 1508533, 1508535 - 1508537, 1508539, 1508541 - 1508549, 1508551 - 1508569 & 1508571 - 1508582. Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18997) (cherry picked from commit 709d4be78f64a8ba0707fb5682b90039e848dad4)
2022-08-18ec_kmgmt.c: Do not crash when getting OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEYTomas Mraz
If the public key is not set on the key, return error instead of crash. Fixes #18495 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18902) (cherry picked from commit b5db237def7e22ccea1a540ec777045b3ce4600e)
2022-08-04providers: Set the size of EC signature on s390.Sebastian Andrzej Siewior
The s390x provides its custom implementation for the creation of the ed448 and ed25519 signatures. Unfortunately it does not set the size. Users that rely of this return parameter end up with wrong values and will compare wrong sizes of signature. Set the proper size of the returned signature on success. Set an error if the signing operation fails. Fixes: #18912 Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Todd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/18928) (cherry picked from commit bbedc052973b1c2fab7d7fb891d02aea393ff579)
2022-08-01Updating ifdefs to account for xlclang compiler frontend on AIX.Rob Mc Gee
The fallback DEP works fine there. XLC should be unaffected. CLA: trivial Reviewed-by: Todd Short <todd.short@me.com> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18892) (cherry picked from commit df1e33bc8ae67573a3f3488eff82e02fc0310203)
2022-07-27GCM: record limit counter gets reset on AAD changesPauli
It shouldn't be. This moves the reset to the init function instead and only does the reset on a key change. Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18860) (cherry picked from commit 3ebcb2fff56bda788ab1f363eb0023715018a4e5)
2022-07-19dh_to_text: Print the dh->length if setTomas Mraz
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Kurt Roeckx <kurt@roeckx.be> (Merged from https://github.com/openssl/openssl/pull/18793)
2022-07-11use #pragma comment(lib) with _MSC_VER onlyViktor Szakats
Avoid this warning when compiled with llvm/gcc + mingw-w64 and `USE_BCRYPTGENRANDOM` enabled: ``` ../providers/implementations/rands/seeding/rand_win.c:31:11: warning: unknown pragma ignored [-Wunknown-pragmas] ^ 1 warning generated. ``` CLA: trivial Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18709) (cherry picked from commit 695cb63c744bab090144a86949b68324ee3094d6)
2022-07-05make updateRichard Levitte
Reviewed-by: Paul Dale <pauli@openssl.org> Release: yes
2022-07-05Update copyright yearRichard Levitte
Reviewed-by: Paul Dale <pauli@openssl.org> Release: yes
2022-06-29Remove redundant check for `saltlen > UINT32_MAX`Daniel Fiala
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18671) (cherry picked from commit 05e51bc79bac45e194dd6f0bf73c99ed5ca06272)
2022-06-28kdf objects missing a return if malloc fails.slontis
I have searched through all references of ERR_R_MALLOC_FAILURE for any other instances.. 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/18638) (cherry picked from commit 7260709e9ef155c8b3fccaa32e8ba496a3059905)
2022-06-27Improve checks for invalid saltlen in DER writer.Daniel Fiala
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18615) (cherry picked from commit 08f876d0dea184b071a5aded4c55317e5a63c80e)
2022-06-27der_writer: Use uint32_t instead of long.Daniel Fiala
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18615) (cherry picked from commit 59196250cb45ecd128d2f8bbc47de612167606d3)
2022-06-27Add checks for saltlen and trailerfield to rsa key writer.Daniel Fiala
Fixes openssl#18168. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18615) (cherry picked from commit 48320997b49b07b5abadec89c7fbe5d5f3d41da4)
2022-06-24Update fips source checksums to drop the unwanted headersTomas Mraz
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/18630)
2022-06-23The flag "decoded-from-explicit" must be imp/exportableTomas Mraz
Otherwise the information that the EC group was imported from explicit parameters is lost when the key is moved across providers. Fixes #18600 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/18629)
2022-06-21make updateMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> Release: yes
2022-06-21Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> Release: yes
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-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-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-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-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-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-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-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-05-27Fix the incorrect checks of EVP_CIPHER_CTX_set_key_lengthPeiwei Hu
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18397) (cherry picked from commit 8d9fec1781751d2106d899c6076eeb3da6930bfe)
2022-05-24Fix check of EVP_CIPHER_CTX_ctrlPeiwei Hu
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/18368) (cherry picked from commit d649c51a5388912277dffb56d921eb720db54be1)
2022-05-23Fix regression in default key length for Blowfish CFB and OFB ciphersTomas Mraz
Fixes #18359 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18362) (cherry picked from commit 7a9e93dda58118c0fb1bade8fe915306b845325b)
2022-05-23strcasecmp: implement strcasecmp and strncasecmpPauli
Rather than relying on the locale code working, instead implement these functions directly. Fixes #18322 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/18344) (cherry picked from commit fb4cdca053fb9d3f0e11eeaf31f4b4ff87f69a95)
2022-05-13Avoid code duplication for locale initializationTomas Mraz
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18293)
2022-05-13Fix build on OPENSSL_SYS_TANDEM and older POSIXesTomas Mraz
It also allows for passing -DOPENSSL_NO_LOCALE as a workaround to ./Configure command. Fixes #18233 Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18293)
2022-05-03make updateMatt Caswell
Reviewed-by: Tomas Mraz <tomas@openssl.org> Release: yes
2022-05-03Update copyright yearMatt Caswell
Reviewed-by: Tomas Mraz <tomas@openssl.org> Release: yes
2022-05-03Fix the RC4-MD5 cipherMatt Caswell
A copy&paste error meant that the RC4-MD5 cipher (used in TLS) used the TLS AAD data as the MAC key. CVE-2022-1434 Fixes #18112 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org>
2022-04-29poly1305: Properly copy the whole context on dupTomas Mraz
Also reset the updated flag when Poly1305_Init is called. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18143) (cherry picked from commit bbe909d00e9a593bd5954dfca4d3020467977565)
2022-04-27Prefer GNU library initialization mechanism over platform oneJon Spillett
If GNU toolchain is used, use the __attribute__((constructor)) Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18147) (cherry picked from commit 2dc3a4a4a57eca0d9bebd87234c7d682506188fc)
2022-04-27siphash: Properly set mac size in sipcopyTomas Mraz
Also fully duplicate the context on dup Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18142) (cherry picked from commit 905fec4f4d6bb8a978476cbce0f293ffc683b5fd)
2022-04-21str[n]casecmp => OPENSSL_strncasecmpDmitry Belyavskiy
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18103)
2022-04-21FIPS provider modificationsDmitry Belyavskiy
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18103)
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)