summaryrefslogtreecommitdiffstats
path: root/providers
AgeCommit message (Collapse)Author
2021-08-18pkcs12: check for zero length digest to avoid division by zeroPauli
Fixes #16331 Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Kurt Roeckx <kurt@roeckx.be> (Merged from https://github.com/openssl/openssl/pull/16332)
2021-08-18Fix CTS cipher decrypt so that the updated IV is returned correctly.Shane Lontis
Adding KRB5 test vector 'NextIV' values to evp_test data for AES CTS indicated that the CTS decrypt functions incorrectly returned the wrong IV. The returned IV should match the value returned by the encrypt methods. Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16286)
2021-08-18Change CTS CS3 (Kerberos) so that it accepts a 16 byte input blockShane Lontis
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16286)
2021-08-18Add support for camellia cbc cts modeShane Lontis
Fixes #16276 Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16286)
2021-08-18Refactor cipher aes_cts code so that it can be used by other 128bit ciphersShane Lontis
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16286)
2021-08-11MacOS: Add an include of <CommonCrypto/CommonCryptoError.h>David Bohman
The include is added before <CommonCrypto/CommonRandom.h>, as required by older releases of the macOS developer tools. Fixes #16248 CLA: trivial Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16258)
2021-08-06Fix VS2019 compile error C4703: potentially uninitialized local pointer ↵Kelvin Lee
variable used. encode_key2text.c(689): error C4703: potentially uninitialized local pointer variable 'modulus_label' used encode_key2text.c(691): error C4703: potentially uninitialized local pointer variable 'exponent_label' used CLA: trivial Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12845)
2021-08-05fips: add power up test for TLS 1.3 KDFPauli
The power up known answer test for the TLS 1.3 KDF does just the first step to derive the "client_early_traffic_secret" using the two modes of the KDF. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/16203)
2021-08-05provider: add TLS13_KDF to the default and FIPS providersPauli
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/16203)
2021-08-05tls/prov: move the TLS 1.3 KDF code to providersPauli
This function needs to be power up tested as part of the FIPS validation and thus it needs to be inside the provider boundary. This is realised by introducing a new KDF "TLS13-KDF" which does the required massaging of parameters but is otherwise functionally equivalent to HKDF. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/16203)
2021-07-29make updateMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2021-07-29Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16176)
2021-07-28Don't leak the OSSL_LIB_CTX in the event of a failure to load the FIPS moduleMatt Caswell
Ensure we free the OSSL_LIB_CTX on the error path. Fixes #16163 Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16168)
2021-07-20drbg: allow the ctr derivation function to be disabled in FIPS modePauli
Word from the lab is: The use of the derivation function is optional if either an approved RBG or an entropy source provides full entropy output when entropy input is requested by the DRBG mechanism. Otherwise, the derivation function shall be used. So our disallowing it's use was more than required. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/16096)
2021-07-16Allow RSA signature operations with RSA_NO_PADDINGTomas Mraz
When no md is set, the raw operations should be allowed. Fixes #16056 Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/16068)
2021-07-16Signature algos: allow having identical digest in paramsTomas Mraz
The flag_allow_md prevents setting a digest in params however this is unnecessarily strict. If the digest is the same as the one already set, we do not return an error. Fixes #16071 Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16076)
2021-07-14Remove lower limit on GCM mode ciphersPauli
Fixes #16057 Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16064)
2021-07-06Add HKDF negative testsShane Lontis
Fix memory leak if legacy test is skipped. Using EVP_KDF_CTX_get_params() to get OSSL_KDF_PARAM_SIZE will now return 0 if the returned size is 0. Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15977)
2021-07-06update fips checksumsTomas Mraz
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15974)
2021-07-06fips module header inclusion fine-tunningTomas Mraz
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15974)
2021-07-05provider: use #define for PBKDF1 algorithm namePauli
This seems to be standard practice so bringing PBKDF1 into line. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15967)
2021-07-03PROV & STORE: Make the 'file:' store loader understand more binary formatsRichard Levitte
The 'file:' store loader only understood DER natively. With all the whatever to key decoders gone, direct support for other binary file formats are gone, and we need to recreate them for this store loader. With these changes, it now also understands MSBLOB and PVK files. As a consequence, any store loader that handles some form of open file data (such as a PEM object) can now simply pass that data back via OSSL_FUNC_store_load()'s object callback. As long as libcrypto has access to a decoder that can understand the data, the appropriate OpenSSL object will be generated for it, even if the store loader sits in a different provider than any decoder or keymgmt. For example, an LDAP store loader, which typically finds diverse PEM formatted blobs in the database, can simply pass those back via the object callback, and let libcrypto do the rest of the work. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15981)
2021-07-03PROV & STORE: Don't decode keys in the 'file:' store loaderRichard Levitte
This makes the 'file:' store loader only read the file, and only decode down to a base level binary format, and simply pass that blob of data back to the OSSL_FUNC_store_load() object callback. This offloads the decoding into specific OpenSSL types to libcrypto, which takes away the issue of origins, which provider is it that holds the key (or other future types of objects). Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15981)
2021-06-29DECODER & ENCODER: Make sure to pass around the original selection bitsRichard Levitte
When decoding a key and asking the keymgmt to import the key data, it was told that the key data includes everything. This may not be true, since the user may have specified a different selection, and some keymgmts may want to be informed. Our key decoders' export function, on the other hand, didn't care either, and simply export anything they could, regardless. In both cases, the selection that was specified by the user is now passed all the way. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15934)
2021-06-29darwin platform replacing getentropy usage by platform api instead.David CARLIER
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15924)
2021-06-29PROV: Have our PEM->DER decoder only recognise our PEM namesRichard Levitte
This is to avoid creating confusion where other PEM decoder implementations may know better what PEM names that are unknown to us actually mean. Fixes #15929 Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15930)
2021-06-26Update fips sources and checksumsTomas Mraz
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15903)
2021-06-25Fix file_name_check() in storemgmt/file_store.c and e_loader_attic.cDr. David von Oheimb
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15892)
2021-06-24epki2pki_decode: passphrase callback failure is fatal errorTomas Mraz
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15878)
2021-06-22Change self test for AES_CGM to perform both an encrypt and decrypt.Shane Lontis
This is a request from the lab that changes the AES_GCM test back to perform both a encrypt and decrypt. (This makes no logical sense since this is not an inverse cipher). I have left the AES_ECB decrypt test in (although it may not be needed) since it is actually testing the inverse cipher case. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15844)
2021-06-18aix64-gcc target: Fix build breakage with enable-fipsTomas Mraz
Fixes #15804 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15807)
2021-06-17make updateMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2021-06-17Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15801)
2021-06-17Add self test for ECDSA using curve with a binary fieldShane Lontis
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15794)
2021-06-16prov: tag SM2 encoders and decoders as non-FIPSPauli
They're impossible to use in a FIPS environment, so they shouldn't be flagged as compatible. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15782)
2021-06-16Correct processing of AES-SHA stitched ciphersDmitry Belyavskiy
Fixes: #15706 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15740)
2021-06-14Add a generic SubjectPublicKeyInfo decoderMatt Caswell
Previously all the SubjectPublicKeyInfo decoders were specific to a key type. We would iterate over all them until a match was found for the correct key type. Each one would fully decode the key before then testing whether it was a match or not - throwing it away if not. This was very inefficient. Instead we introduce a generic SubjectPublicKeyInfo decoder which figures out what type of key is contained within it, before subsequently passing on the data to a key type specific SubjectPublicKeyInfo decoder. Fixes #15646 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15662)
2021-06-14Avoid duplicating prov_running.o in libdefault and libcryptoTomas Mraz
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15704)
2021-06-10store: Avoid spurious error from decoding at EOFTomas Mraz
Fixes #15596 Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15661)
2021-06-09Decoding PKCS#8: separate decoding of encrypted and unencrypted PKCS#8Richard Levitte
This has us switch from the 'structure' "pkcs8" to "PrivateKeyInfo", which is sensible considering we already have "SubjectPublicKeyInfo". We also add "EncryptedPrivateKeyInfo", and use it for a special decoder that detects and decrypts an EncryptedPrivateKeyInfo structured DER blob into a PrivateKeyInfo structured DER blob and passes that on to the next decoder implementation. The result of this change is that PKCS#8 decryption should only happen once per decoding instead of once for every expected key type. Furthermore, this new decoder implementation sets the data type to the OID of the algorithmIdentifier field, thus reducing how many decoder implementations are tentativaly run further down the call chain. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15498)
2021-06-08EVP_PKEY_new_raw_private_key: Allow zero length keysTomas Mraz
Allocate at least one byte to distinguish a zero length key from an unset key. Fixes #15632 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15643)
2021-06-08Fix compilation on systems with empty _POSIX_TIMERSLarkin Nickle
Systems such as Tru64 ship with broken headers that have _POSIX_TIMERS defined but empty. CLA: trivial Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15598)
2021-06-08Fix AIX FIPS DEP.Shane Lontis
The entry point needs the option 'binitfini', but it was not being added since the perl code to detect the match did not work. The entry point for AIX is no longer static - so a wrapper has been added to call the static version. Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15636)
2021-06-08Add a gettable for provider ciphers to return the EVP_CIPH_RAND_KEY flagShane Lontis
Fixes #15531 DES and TDES set this flag which could possibly be used by applications. The gettable cipher param OSSL_CIPHER_PARAM_HAS_RAND_KEY has been added. Note that EVP_CIPHER_CTX_rand_key() uses this flag. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15606)
2021-06-08Document missing EC/SM2 paramsShane Lontis
Fixes #15548 Document OSSL_PKEY_PARAM_EC_PUB_X, OSSL_PKEY_PARAM_EC_PUB_Y and OSSL_PKEY_PARAM_DEFAULT_DIGEST Added a section related to parameters for SM2. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15601)
2021-06-08Fix CipherInit on s390x.Juergen Christ
Various different initialization sequences led to bugs on s390x due to caching and processing during key setting. Since, e.g., the direction does not necessarily have to be correct during initialization, this produced bugs in s390x which were not present on other architectures. Fix this by recomputing the function codes on the fly during updates and final operations. Signed-off-by: Juergen Christ <jchrist@linux.ibm.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15521)
2021-06-05PROV: drop get_params() and gettable_params() from all encoder implementatioRichard Levitte
They aren't needed at all any more, since the properties contain the same information. This also drops the parameter names OSSL_ENCODER_PARAM_OUTPUT_TYPE and OSSL_ENCODER_PARAM_OUTPUT_STRUCTURE Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15570)
2021-06-05ENCODER: Drop OSSL_ENCODER_PARAM_INPUT_TYPERichard Levitte
This was a poor substitute for using the name of the decoder implementation, and since there is functionality to get the latter now, this parameter can be dropped. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15570)
2021-06-05PROV: drop get_params() and gettable_params() from all decoder implementationsRichard Levitte
They aren't needed at all any more, since the properties contain the same information. This also drops the parameter names OSSL_DECODER_PARAM_INPUT_TYPE and OSSL_DECODER_PARAM_INPUT_STRUCTURE. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15570)
2021-06-05make update-fips-checksumsRichard Levitte
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15615)