CORE: query for operations only once per provider (unless no_store is true)
authorRichard Levitte <levitte@openssl.org>
Fri, 15 May 2020 13:56:05 +0000 (15:56 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 19 May 2020 09:02:41 +0000 (11:02 +0200)
commit5a29b6286f8ccafc2ed9a026b0e8d4bd6d0396e6
tree7addeebb9956f0e747bb0c1175e0e79eecb7b762
parentc0ec5ce0bf97c358bea29c81d3d16047244a9a7e
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)
crypto/core_algorithm.c
crypto/core_fetch.c
crypto/evp/evp_fetch.c
crypto/provider_core.c
crypto/serializer/serializer_meth.c
doc/internal/man3/ossl_provider_new.pod
include/internal/core.h
include/internal/provider.h