diff options
author | Richard Levitte <levitte@openssl.org> | 2020-05-15 15:56:05 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-05-19 11:02:41 +0200 |
commit | 5a29b6286f8ccafc2ed9a026b0e8d4bd6d0396e6 (patch) | |
tree | 7addeebb9956f0e747bb0c1175e0e79eecb7b762 /crypto/evp/evp_fetch.c | |
parent | c0ec5ce0bf97c358bea29c81d3d16047244a9a7e (diff) |
CORE: query for operations only once per provider (unless no_store is true)
When a desired algorithm wasn't available, we didn't register anywhere
that an attempt had been made, with the result that next time the same
attempt was made, the whole process would be done again.
To avoid this churn, we register a bit for each operation that has
been queried in the libcrypto provider object, and test it before
trying the same query and method construction loop again.
If course, if the provider has told us not to cache, we don't register
this bit.
Fixes #11814
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11842)
Diffstat (limited to 'crypto/evp/evp_fetch.c')
-rw-r--r-- | crypto/evp/evp_fetch.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crypto/evp/evp_fetch.c b/crypto/evp/evp_fetch.c index be5ab111aa..596f592535 100644 --- a/crypto/evp/evp_fetch.c +++ b/crypto/evp/evp_fetch.c @@ -444,7 +444,13 @@ void evp_generic_do_all(OPENSSL_CTX *libctx, int operation_id, data.free_method = free_method; data.user_fn = user_fn; data.user_arg = user_arg; - ossl_algorithm_do_all(libctx, operation_id, NULL, do_one, &data); + + /* + * No pre- or post-condition for this call, as this only creates methods + * temporarly and then promptly destroys them. + */ + ossl_algorithm_do_all(libctx, operation_id, NULL, NULL, do_one, NULL, + &data); } const char *evp_first_name(const OSSL_PROVIDER *prov, int name_id) |