openssl/crypto/evp
Matt Caswell 36424806d6 Don't take a write lock when freeing an EVP_PKEY
When freeing the last reference to an EVP_PKEY there is no point in
taking the lock for the key. It is the last reference and is being freed
so must only be being used by a single thread.

This should not have been the source of any contention so its unclear to
what extent this will improve performance. But we should not be locking
when we don't need to.

Partially fixes #20286

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20932)
2023-05-29 16:08:34 +02:00
..
asymcipher.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
bio_b64.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
bio_enc.c Fix BIO_f_cipher() flushing 2022-12-22 11:01:06 +01:00
bio_md.c evp: remove TODOs 2021-06-02 16:30:15 +10:00
bio_ok.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
build.info Remove unused code from the fips module 2021-05-08 20:44:41 +10:00
c_allc.c Update copyright year 2022-05-03 13:34:51 +01:00
c_alld.c Restore MD5-SHA1 in legacy method database 2019-10-14 16:07:41 +02:00
cmeth_lib.c Fix EVP_MD_meth_dup and EVP_CIPHER_meth_dup 2021-07-28 09:36:54 +10:00
ctrl_params_translate.c Fixed EVP_PKEY_CTX_set_ec_paramgen_curve_nid() for SM2 in ENGINEs 2023-05-15 12:04:55 +02:00
dh_ctrl.c todo: remove TODO(3.0) from the sources. 2021-05-20 09:00:22 +01:00
dh_support.c Fixes related to separation of DH and DHX types 2021-04-26 19:52:11 +02:00
digest.c Fix incorrect parameter verification in EVP_MD_CTX_get_params 2023-05-24 10:02:09 +10:00
dsa_ctrl.c todo: remove TODO(3.0) from the sources. 2021-05-20 09:00:22 +01:00
e_aes_cbc_hmac_sha1.c Update copyright year 2022-05-03 13:34:51 +01:00
e_aes_cbc_hmac_sha256.c Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
e_aes.c crypto: Fix various typos, repeated words, align some spelling to LDP. 2022-10-12 16:55:01 +11:00
e_aria.c crypto: Fix various typos, repeated words, align some spelling to LDP. 2022-10-12 16:55:01 +11:00
e_bf.c Update copyright year 2021-06-17 13:24:59 +01:00
e_camellia.c fix some code with obvious wrong coding style 2021-10-28 13:10:46 +10:00
e_cast.c Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
e_chacha20_poly1305.c evp: Use functions instead of direct structure field references 2022-08-22 10:14:39 +02:00
e_des3.c Fix Coverity 1201740 & 1201712: uninitialised values 2022-05-08 17:50:04 +10:00
e_des.c Fix Coverity 1201740 & 1201712: uninitialised values 2022-05-08 17:50:04 +10:00
e_idea.c fix some code with obvious wrong coding style 2021-10-28 13:10:46 +10:00
e_null.c Update copyright year 2021-04-22 14:38:44 +01:00
e_old.c Update copyright year 2020-04-23 13:55:52 +01:00
e_rc2.c Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
e_rc4_hmac_md5.c Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
e_rc4.c Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
e_rc5.c Address coverity 1493382 argument cannot be negative 2021-11-08 08:55:32 +10:00
e_seed.c fix some code with obvious wrong coding style 2021-10-28 13:10:46 +10:00
e_sm4.c Update copyright year 2022-05-03 13:34:51 +01:00
e_xcbc_d.c Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
ec_ctrl.c Fixed EVP_PKEY_CTX_set_ec_paramgen_curve_nid() for SM2 in ENGINEs 2023-05-15 12:04:55 +02:00
ec_support.c Update copyright year 2022-05-03 13:34:51 +01:00
encode.c Update copyright year 2020-06-25 14:13:12 +01:00
evp_cnf.c Don't try and load the config file while already loading the config file 2021-07-28 10:35:06 +10:00
evp_enc.c Avoid calling into provider with the same iv_len or key_len 2023-04-03 08:22:28 +10:00
evp_err.c err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
evp_fetch.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
evp_key.c Update copyright year 2021-06-17 13:24:59 +01:00
evp_lib.c Fix incomplete checks for EVP_CIPHER_asn1_to_param 2023-01-25 14:27:14 +00:00
evp_local.h Add OSSL_FUNC_keymgmt_im/export_types function that gets the provider context 2023-02-24 09:53:07 +00:00
evp_pbe.c pbe: sort stack before using find 2023-05-01 17:14:42 +10:00
evp_pkey.c Improve the performance of EVP_PKCS82PKEY_ex 2023-03-06 10:53:31 +00:00
evp_rand.c rand: add set0 calls for the private and public DRBGs 2022-11-02 08:42:46 +11:00
evp_utils.c Rename the field 'provctx and data' to 'algctx' inside some objects containing 2021-05-24 10:12:18 +10:00
exchange.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
kdf_lib.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
kdf_meth.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
kem.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
keymgmt_lib.c Don't take a write lock when freeing an EVP_PKEY 2023-05-29 16:08:34 +02:00
keymgmt_meth.c Incorrect null pointer check 2023-03-31 15:09:18 -04:00
legacy_blake2.c Add "origin" field to EVP_CIPHER, EVP_MD 2021-04-18 10:03:07 +02:00
legacy_md2.c Update copyright year 2021-04-22 14:38:44 +01:00
legacy_md4.c Update copyright year 2021-04-22 14:38:44 +01:00
legacy_md5_sha1.c Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
legacy_md5.c Update copyright year 2021-04-22 14:38:44 +01:00
legacy_mdc2.c Update copyright year 2021-04-22 14:38:44 +01:00
legacy_meth.h Update copyright year 2021-06-17 13:24:59 +01:00
legacy_ripemd.c Update copyright year 2021-04-22 14:38:44 +01:00
legacy_sha.c Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
legacy_wp.c Update copyright year 2021-04-22 14:38:44 +01:00
m_null.c Update copyright year 2021-04-22 14:38:44 +01:00
m_sigver.c Add a flag so finalised contexts are not reused 2023-03-15 08:42:59 +11:00
mac_lib.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
mac_meth.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
names.c Update copyright year 2021-03-11 13:27:36 +00:00
p5_crpt2.c Fix incomplete checks for EVP_CIPHER_asn1_to_param 2023-01-25 14:27:14 +00:00
p5_crpt.c Update copyright year 2021-06-17 13:24:59 +01:00
p_dec.c Fix possible null pointer dereference of evp_pkey_get_legacy() 2022-06-02 12:06:08 +02:00
p_enc.c Fix possible null pointer dereference of evp_pkey_get_legacy() 2022-06-02 12:06:08 +02:00
p_legacy.c Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
p_lib.c Don't take a write lock when freeing an EVP_PKEY 2023-05-29 16:08:34 +02:00
p_open.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
p_seal.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
p_sign.c Do not fail if ctx dup does not succeed 2023-03-15 08:42:52 +11:00
p_verify.c Do not fail if ctx dup does not succeed 2023-03-15 08:42:52 +11:00
pbe_scrypt.c Add library context and property query support into the PKCS12 API 2021-04-30 09:15:50 +10:00
pmeth_check.c Make EVP_PKEY_check() be an alias for EVP_PKEY_pairwise_check() 2021-07-15 10:54:25 +10:00
pmeth_gn.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
pmeth_lib.c EVP_PKEY_CTX_dup segmentation fault fix 2023-03-27 12:53:25 +02:00
signature.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00