summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-09-24 03:42:18 +0200
committerRichard Levitte <levitte@openssl.org>2019-10-17 09:16:45 +0200
commit4dc0d81a1a7b58a0a61102d875eb2cb712fe6a4b (patch)
tree44801c7b90a7792a17f51bbbca9e8b3638d614a2 /crypto
parent'openssl list' and 'openssl provider': adapt display of multiple names (diff)
downloadopenssl-4dc0d81a1a7b58a0a61102d875eb2cb712fe6a4b.tar.xz
openssl-4dc0d81a1a7b58a0a61102d875eb2cb712fe6a4b.zip
evp_generic_do_all(): fix passing of method data
Method data was passed down as provider to ossl_algorithm_do_all(), which causes trouble as soon a it's non-NULL. Pass it via the data structure instead. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/9979)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/evp/evp_fetch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/evp/evp_fetch.c b/crypto/evp/evp_fetch.c
index e2039df3ef..907091fced 100644
--- a/crypto/evp/evp_fetch.c
+++ b/crypto/evp/evp_fetch.c
@@ -411,6 +411,7 @@ struct do_all_data_st {
void *user_arg;
void *(*new_method)(const int name_id, const OSSL_DISPATCH *fns,
OSSL_PROVIDER *prov, void *method_data);
+ void *method_data;
void (*free_method)(void *);
};
@@ -425,7 +426,7 @@ static void do_one(OSSL_PROVIDER *provider, const OSSL_ALGORITHM *algo,
if (name_id != 0)
method = data->new_method(name_id, algo->implementation, provider,
- NULL);
+ data->method_data);
if (method != NULL) {
data->user_fn(method, data->user_arg);
@@ -446,10 +447,11 @@ void evp_generic_do_all(OPENSSL_CTX *libctx, int operation_id,
struct do_all_data_st data;
data.new_method = new_method;
+ data.method_data = method_data;
data.free_method = free_method;
data.user_fn = user_fn;
data.user_arg = user_arg;
- ossl_algorithm_do_all(libctx, operation_id, method_data, do_one, &data);
+ ossl_algorithm_do_all(libctx, operation_id, NULL, do_one, &data);
}
const char *evp_first_name(OSSL_PROVIDER *prov, int name_id)