提交 5a950048 编写于 作者: S Shane Lontis

Add EVP_KEM_gettable_ctx_params() and EVP_KEM_settable_ctx_params()

Reviewed-by: NRichard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12943)
上级 d3edef83
......@@ -349,7 +349,6 @@ void EVP_KEM_do_all_provided(OPENSSL_CTX *libctx,
(void (*)(void *))EVP_KEM_free);
}
void EVP_KEM_names_do_all(const EVP_KEM *kem,
void (*fn)(const char *name, void *data),
void *data)
......@@ -357,3 +356,25 @@ void EVP_KEM_names_do_all(const EVP_KEM *kem,
if (kem->prov != NULL)
evp_names_do_all(kem->prov, kem->name_id, fn, data);
}
const OSSL_PARAM *EVP_KEM_gettable_ctx_params(const EVP_KEM *kem)
{
void *provctx;
if (kem == NULL || kem->gettable_ctx_params == NULL)
return NULL;
provctx = ossl_provider_ctx(EVP_KEM_provider(kem));
return kem->gettable_ctx_params(provctx);
}
const OSSL_PARAM *EVP_KEM_settable_ctx_params(const EVP_KEM *kem)
{
void *provctx;
if (kem == NULL || kem->settable_ctx_params == NULL)
return NULL;
provctx = ossl_provider_ctx(EVP_KEM_provider(kem));
return kem->settable_ctx_params(provctx);
}
......@@ -4,7 +4,8 @@
EVP_KEM_fetch, EVP_KEM_free, EVP_KEM_up_ref,
EVP_KEM_number, EVP_KEM_is_a, EVP_KEM_provider,
EVP_KEM_do_all_provided, EVP_KEM_names_do_all
EVP_KEM_do_all_provided, EVP_KEM_names_do_all,
EVP_KEM_gettable_ctx_params, EVP_KEM_settable_ctx_params
- Functions to manage EVP_KEM algorithm objects
=head1 SYNOPSIS
......@@ -22,6 +23,8 @@ EVP_KEM_do_all_provided, EVP_KEM_names_do_all
void (*fn)(EVP_KEM *kem, void *arg), void *arg);
void EVP_KEM_names_do_all(const EVP_KEM *kem,
void (*fn)(const char *name, void *data), void *data);
const OSSL_PARAM *EVP_KEM_gettable_ctx_params(const EVP_KEM *kem);
const OSSL_PARAM *EVP_KEM_settable_ctx_params(const EVP_KEM *kem);
=head1 DESCRIPTION
......@@ -55,6 +58,11 @@ EVP_KEM_number() returns the internal dynamic number assigned to I<kem>.
EVP_KEM_names_do_all() traverses all names for I<kem>, and calls I<fn> with
each name and I<data>.
EVP_KEM_gettable_ctx_params() and EVP_KEM_settable_ctx_params() return
a constant B<OSSL_PARAM> array that describes the names and types of key
parameters that can be retrieved or set by a key encapsulation algorithm using
L<EVP_PKEY_CTX_get_params(3)> and L<EVP_PKEY_CTX_set_params(3)>.
=head1 RETURN VALUES
EVP_KEM_fetch() returns a pointer to an B<EVP_KEM> for success or B<NULL> for
......@@ -62,6 +70,9 @@ failure.
EVP_KEM_up_ref() returns 1 for success or 0 otherwise.
EVP_KEM_gettable_ctx_params() and EVP_KEM_settable_ctx_params() return
a constant B<OSSL_PARAM> array or NULL on error.
=head1 SEE ALSO
L<provider(7)/Fetching algorithms>, L<OSSL_PROVIDER(3)>
......
......@@ -1687,6 +1687,8 @@ void EVP_KEM_do_all_provided(OPENSSL_CTX *libctx,
void (*fn)(EVP_KEM *wrap, void *arg), void *arg);
void EVP_KEM_names_do_all(const EVP_KEM *wrap,
void (*fn)(const char *name, void *data), void *data);
const OSSL_PARAM *EVP_KEM_gettable_ctx_params(const EVP_KEM *kem);
const OSSL_PARAM *EVP_KEM_settable_ctx_params(const EVP_KEM *kem);
int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx);
int EVP_PKEY_sign(EVP_PKEY_CTX *ctx,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册