aboutsummaryrefslogtreecommitdiffstats
path: root/doc/internal
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-05-15 15:56:05 +0200
committerRichard Levitte <levitte@openssl.org>2020-05-19 11:02:41 +0200
commit5a29b6286f8ccafc2ed9a026b0e8d4bd6d0396e6 (patch)
tree7addeebb9956f0e747bb0c1175e0e79eecb7b762 /doc/internal
parentc0ec5ce0bf97c358bea29c81d3d16047244a9a7e (diff)
downloadopenssl-5a29b6286f8ccafc2ed9a026b0e8d4bd6d0396e6.tar.gz
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 'doc/internal')
-rw-r--r--doc/internal/man3/ossl_provider_new.pod17
1 files changed, 16 insertions, 1 deletions
diff --git a/doc/internal/man3/ossl_provider_new.pod b/doc/internal/man3/ossl_provider_new.pod
index 36fe6301bf..d5d732d415 100644
--- a/doc/internal/man3/ossl_provider_new.pod
+++ b/doc/internal/man3/ossl_provider_new.pod
@@ -13,7 +13,8 @@ ossl_provider_name, ossl_provider_dso,
ossl_provider_module_name, ossl_provider_module_path,
ossl_provider_library_context,
ossl_provider_teardown, ossl_provider_gettable_params,
-ossl_provider_get_params, ossl_provider_query_operation
+ossl_provider_get_params, ossl_provider_query_operation,
+ossl_provider_set_operation_bit, ossl_provider_test_operation_bit
- internal provider routines
=head1 SYNOPSIS
@@ -63,6 +64,10 @@ ossl_provider_get_params, ossl_provider_query_operation
int operation_id,
int *no_cache);
+ int ossl_provider_set_operation_bit(OSSL_PROVIDER *provider, size_t bitnum);
+ int ossl_provider_test_operation_bit(OSSL_PROVIDER *provider, size_t bitnum,
+ int *result);
+
=head1 DESCRIPTION
I<OSSL_PROVIDER> is a type that holds all the necessary information
@@ -208,6 +213,13 @@ I<query_operation> function, if the provider has one.
It should return an array of I<OSSL_ALGORITHM> for the given
I<operation_id>.
+ossl_provider_set_operation_bit() registers a 1 for operation I<bitnum>
+in a bitstring that's internal to I<provider>.
+
+ossl_provider_tests_operation_bit() checks if the bit operation I<bitnum>
+is set (1) or not (0) in the internal I<provider> bitstring, and sets
+I<*result> to 1 or 0 accorddingly.
+
=head1 NOTES
Locating a provider module happens as follows:
@@ -270,6 +282,9 @@ otherwise NULL.
ossl_provider_get_params() returns 1 on success, or 0 on error.
If this function isn't available in the provider, 0 is returned.
+ossl_provider_set_operation_bit() and ossl_provider_test_operation_bit()
+return 1 on success, or 0 on error.
+
=head1 SEE ALSO
L<OSSL_PROVIDER(3)>, L<provider(7)>, L<openssl(1)>