mirror of
https://github.com/openssl/openssl.git
synced 2026-01-25 02:56:43 +00:00
Change evp_keymgmt_util_clear_operation_cache return type to void
Found by Linux Verification Center (linuxtesting.org) with SVACE. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/29458)
This commit is contained in:
@@ -219,14 +219,13 @@ static void op_cache_free(OP_CACHE_ELEM *e)
|
||||
OPENSSL_free(e);
|
||||
}
|
||||
|
||||
int evp_keymgmt_util_clear_operation_cache(EVP_PKEY *pk)
|
||||
void evp_keymgmt_util_clear_operation_cache(EVP_PKEY *pk)
|
||||
{
|
||||
if (pk != NULL) {
|
||||
sk_OP_CACHE_ELEM_pop_free(pk->operation_cache, op_cache_free);
|
||||
pk->operation_cache = NULL;
|
||||
}
|
||||
if (pk == NULL)
|
||||
return;
|
||||
|
||||
return 1;
|
||||
sk_OP_CACHE_ELEM_pop_free(pk->operation_cache, op_cache_free);
|
||||
pk->operation_cache = NULL;
|
||||
}
|
||||
|
||||
OP_CACHE_ELEM *evp_keymgmt_util_find_operation_cache(EVP_PKEY *pk,
|
||||
|
||||
@@ -1921,14 +1921,10 @@ void *evp_pkey_export_to_provider(EVP_PKEY *pk, OSSL_LIB_CTX *libctx,
|
||||
|
||||
if (!CRYPTO_THREAD_write_lock(pk->lock))
|
||||
goto end;
|
||||
if (pk->ameth->dirty_cnt(pk) != pk->dirty_cnt_copy
|
||||
&& !evp_keymgmt_util_clear_operation_cache(pk)) {
|
||||
CRYPTO_THREAD_unlock(pk->lock);
|
||||
evp_keymgmt_freedata(tmp_keymgmt, keydata);
|
||||
keydata = NULL;
|
||||
EVP_KEYMGMT_free(tmp_keymgmt);
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (pk->ameth->dirty_cnt(pk) != pk->dirty_cnt_copy)
|
||||
evp_keymgmt_util_clear_operation_cache(pk);
|
||||
|
||||
EVP_KEYMGMT_free(tmp_keymgmt); /* refcnt-- */
|
||||
|
||||
/* Check to make sure some other thread didn't get there first */
|
||||
|
||||
@@ -25,7 +25,7 @@ OP_CACHE_ELEM
|
||||
OP_CACHE_ELEM *evp_keymgmt_util_find_operation_cache(EVP_PKEY *pk,
|
||||
EVP_KEYMGMT *keymgmt,
|
||||
int selection);
|
||||
int evp_keymgmt_util_clear_operation_cache(EVP_PKEY *pk);
|
||||
void evp_keymgmt_util_clear_operation_cache(EVP_PKEY *pk);
|
||||
int evp_keymgmt_util_cache_keydata(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt,
|
||||
void *keydata, int selection);
|
||||
void evp_keymgmt_util_cache_keyinfo(EVP_PKEY *pk);
|
||||
@@ -81,8 +81,7 @@ evp_keymgmt_util_find_operation_cache() returns a pointer to the
|
||||
operation cache slot. If I<keymgmt> is NULL, or if there is no slot
|
||||
with a match for I<keymgmt>, NULL is returned.
|
||||
|
||||
evp_keymgmt_util_cache_keydata() and evp_keymgmt_util_clear_operation_cache()
|
||||
return 1 on success or 0 otherwise.
|
||||
evp_keymgmt_util_cache_keydata() return 1 on success or 0 otherwise.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
|
||||
@@ -535,7 +535,7 @@ void *evp_keymgmt_util_export_to_provider(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt,
|
||||
OP_CACHE_ELEM *evp_keymgmt_util_find_operation_cache(EVP_PKEY *pk,
|
||||
EVP_KEYMGMT *keymgmt,
|
||||
int selection);
|
||||
int evp_keymgmt_util_clear_operation_cache(EVP_PKEY *pk);
|
||||
void evp_keymgmt_util_clear_operation_cache(EVP_PKEY *pk);
|
||||
int evp_keymgmt_util_cache_keydata(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt,
|
||||
void *keydata, int selection);
|
||||
void evp_keymgmt_util_cache_keyinfo(EVP_PKEY *pk);
|
||||
|
||||
Reference in New Issue
Block a user