summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2021-04-08curve448: Use constant time zero check functionAmitay Isaacs
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
2021-04-08Add a constant time zero check function for 64-bit integersAmitay Isaacs
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
2021-04-08curve448: Remove the unrolled loop versionAmitay Isaacs
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
2021-04-08curve448: Use NLIMBS where appropriate to simplify the codeAmitay Isaacs
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
2021-04-08curve448: Modernise reference 64-bit codeAmitay Isaacs
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
2021-04-08curve448: Rename arch_ref64 to arch_64Amitay Isaacs
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
2021-04-08Partially Revert "Remove curve448 architecture specific files"Amitay Isaacs
This reverts commit 7e492f3372ed83af074a63d5920f13de7e3455b6. This brings back the 64-bit reference implementation for curve448. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
2021-04-08curve448: Use relative includes to avoid explicit dependenciesAmitay Isaacs
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
2021-04-08Use numbers definition of int128_t and uint128_tAmitay Isaacs
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
2021-04-08numbers: Define 128-bit integers if compiler supportsAmitay Isaacs
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
2021-04-08test: add extra secure memory test case.Pauli
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14782)
2021-04-08param_build: check for the usage of secure memory better.Pauli
The param build now checks the string types and locates them in secure memory if the original string is. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14782)
2021-04-08Revert "Fix AES-CBC perf test failure issue"Pauli
This reverts commit bec9289143c955b330a8f9ad32f26f3da76e2685. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14796)
2021-04-08property: lock the lib ctx when updating the property definition cachePauli
Although the store being used is adequately and properly locked, the library context is not. Due to the mechanisms used for fetching, it is possible for multiple stores to live within the same library context for short periods. This fix prevents threading issues resulting from such coincidences. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14773)
2021-04-08test: fix problem with threads test using default library context.Pauli
Also add a new test that deliberately tests the default library context. Fixes #14720 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14773)
2021-04-08property: check return values from the property locking calls.Pauli
A failure to obtain a lock would have resulted in much badness, now it results in a failure return. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14773)
2021-04-08apps: fix AES CBC performance loopPauli
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14778)
2021-04-08Fix more certificate related lib_ctx settings.Shane Lontis
Fixes #13732 Fix a few places that were not using the '_ex' variants of ASN1_item_sign/verify. Added X509_CRL_new_ex(). Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14752)
2021-04-08fix coverity 1466710: resource leakPauli
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14620)
2021-04-08dh: fix coverity 1473238: argument cannot be negativePauli
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14620)
2021-04-08evp: fix coverity 1473631: argument cannot be negativePauli
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14620)
2021-04-08evp: fix coverity 1451509: argument cannot be negativePauli
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14620)
2021-04-08evp: fix coverity 1451510: argument cannot be negativePauli
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14620)
2021-04-08evp: fix coverity 1472682: argument cannot be negativePauli
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14620)
2021-04-08test: fix coverity 1473234 & 1473239: argument cannot be negativePauli
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14620)
2021-04-07test/recipes/02-test_errstr.t: Do not test negative system error codesRichard Levitte
It's been deemed unlikely that these will end up in OpenSSL error records, so we simply don't test them if they happen to be among the error codes that perl has support for. Fixes #14763 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14779)
2021-04-07test: fix coverity 1475940: negative returnPauli
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14769)
2021-04-07test: fix coverity 1475941: resource leakPauli
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14769)
2021-04-07Disallow ASN.1 enumerated types to be treated as strings.Pauli
They are actually integers. Problem reported by: Scott McPeak <scott.g.mcpeak@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14774)
2021-04-07Remove locking in CRYPTO_secure_allocated()Pauli
The check for being in secure memory is against the arena. The arena is only ever modified by sh_init() and sh_done() and in both cases, it is done without locking. Thus, it is safe for the CRYPTO_secure_allocated() to not lock. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14775)
2021-04-07Make the lock in CRYPTO_secure_allocated() a read lockPauli
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14775)
2021-04-07Fix AES-CBC perf test failure issueFangming.Fang
As ossl_cipher_generic dosen't support to set key length, and "openssl speed aes-(128|192|256)-cbc" tests fail. A small fix by adding OSSL_CIPHER_PARAM_KEYLEN params. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14777)
2021-04-07Fix typo in store_meth.cNan Xiao
CLA: trivial Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14776)
2021-04-07Remove unnecessary setting SSL_MODE_AUTO_RETRYNan Xiao
Since SSL_MODE_AUTO_RETRY is enabled by default, no need to set it explicitly. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14742)
2021-04-07Adds a new lock to read default_path and uses a strdup() on default_path ↵Sahana Prasad
before using it Fixes #14483 Signed-off-by: Sahana Prasad <sahana@redhat.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14650)
2021-04-07Ensure that the negative flag is correct set for ASN1 integer types.Pauli
Reported by: Scott McPeak <scott.g.mcpeak@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14768)
2021-04-07Check for integer overflow in i2a_ASN1_OBJECT and error out if found.Pauli
Problem reported by Scott McPeak <scott.g.mcpeak@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14768)
2021-04-07Fix potential double free in sslapitest.cNan Xiao
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14758)
2021-04-06Deprecate the EVP_PKEY controls for CMS and PKCS#7Tomas Mraz
Improve the ossl_rsa_check_key() to prevent non-signature operations with PSS keys. Do not invoke the EVP_PKEY controls for CMS and PKCS#7 anymore as they are not needed anymore and deprecate them. Fixes #14276 Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/14760)
2021-04-02Include BN assembler alongside CPUID codeRichard Levitte
It turns out that some CPUID code requires the presence of some BN assembler code, so we make sure it's included in the same manner as the CPUID code itself. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14755)
2021-04-02Refactor CPUID codeRichard Levitte
We were using CPUID coded in several modules, but it was unclear how it actually got there, and could fail randomly. To remedy that, this change separates the CPUID C code from the rest of cryptlib.c, and ensures the right modules get both that and the assembler sources explicitly. Fixes #11281 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14755)
2021-04-02APPS: Replace the use of OBJ_nid2ln() with name or description callsRichard Levitte
With new provided algorithms added, we'd rather rely on the names and descriptions that we get from the providers. Specifically with the 'openssl list' command, we now display the description of all algorithms. For '-public-key-algorithms', we additionally print key type information a bit more like we do for legacy methods. We also add descriptions to all our keymgmt functions, because the built in EVP_PKEY_ASN1_METHODs had them. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14656)
2021-04-02EVP: Add EVP_<TYPE>_description()Richard Levitte
The following operation types are covered: EVP_MD, EVP_CIPHER, EVP_MAC, EVP_RAND, EVP_KEYMGMT, EVP_SIGNATURE, EVP_ASYM_CIPHER, EVP_KEM, EVP_KEYEXCH, EVP_KDF. Also EVP_PKEY. For EVP_MD and EVP_CIPHER, OBJ_nid2ln() is used as a fallback for legacy implementations. For EVP_PKEY, the info field of the EVP_PKEY_ASN1_METHOD is used as a fallback for legacy implementations. Fixes #14514 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14656)
2021-04-02Add OSSL_STORE_LOADER_description()Richard Levitte
Fixes #14514 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14656)
2021-04-02Add OSSL_DECODER_description() and OSSL_ENCODER_description()Richard Levitte
Fixes #14514 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14656)
2021-04-02CORE: Add an algorithm_description field to OSSL_ALGORITHMRichard Levitte
This corresponds to the |info| field in EVP_PKEY_ASN1_METHOD, as well as the generic use of OBJ_nid2ln() as a one line description. We also add the base functionality to make use of this field. Fixes #14514 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14656)
2021-04-01Corrected missing definitions from NonStop SPT build.Randall S. Becker
This change includes swapping the PUT and SPT configuration, includes of sys/stat.h and sys/types.h in the correct scope to be picked up by SPT definitions. Fixes: #14698 Fixes: #14734 CLA: The author has the permission to grant the OpenSSL Team the right to use this change. Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14736)
2021-04-01DSA_generate_parameters_ex: use the old method for all small keysTomas Mraz
Fixes #14733 Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14744)
2021-04-01Fix typos in ssl_lib.cNan Xiao
CLA: trivial Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14751)
2021-04-01Add riscv64 targetluyahan
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14723)