mirror of
https://github.com/openssl/openssl.git
synced 2025-02-17 14:32:04 +08:00
EVP: add missing common functionality
This adds the missing functions that should be common for all fetchable EVP sub-APIs: EVP_KEYMGMT_is_a(), EVP_KEYMGMT_do_all_provided(), EVP_KEYEXCH_is_a(), EVP_KEYEXCH_do_all_provided(), EVP_KDF_is_a(), EVP_MD_is_a(), EVP_SIGNATURE_do_all_provided(), EVP_SIGNATURE_is_a(). This also renames EVP_MD_do_all_ex(), EVP_CIPHER_do_all_ex(), EVP_KDF_do_all_ex(), EVP_MAC_do_all_ex() to change '_ex' to '_provided'. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/9979)
This commit is contained in:
parent
ee2161e8a6
commit
251e610ce4
@ -902,9 +902,9 @@ void EVP_MD_free(EVP_MD *md)
|
||||
OPENSSL_free(md);
|
||||
}
|
||||
|
||||
void EVP_MD_do_all_ex(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_MD *mac, void *arg),
|
||||
void *arg)
|
||||
void EVP_MD_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_MD *mac, void *arg),
|
||||
void *arg)
|
||||
{
|
||||
evp_generic_do_all(libctx, OSSL_OP_DIGEST,
|
||||
(void (*)(void *, void *))fn, arg,
|
||||
|
@ -1521,9 +1521,9 @@ void EVP_CIPHER_free(EVP_CIPHER *cipher)
|
||||
OPENSSL_free(cipher);
|
||||
}
|
||||
|
||||
void EVP_CIPHER_do_all_ex(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_CIPHER *mac, void *arg),
|
||||
void *arg)
|
||||
void EVP_CIPHER_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_CIPHER *mac, void *arg),
|
||||
void *arg)
|
||||
{
|
||||
evp_generic_do_all(libctx, OSSL_OP_CIPHER,
|
||||
(void (*)(void *, void *))fn, arg,
|
||||
|
@ -573,6 +573,11 @@ int EVP_CIPHER_mode(const EVP_CIPHER *cipher)
|
||||
return ok != 0 ? (int)v : 0;
|
||||
}
|
||||
|
||||
int EVP_MD_is_a(const EVP_MD *md, const char *name)
|
||||
{
|
||||
return evp_is_a(md->prov, md->name_id, name);
|
||||
}
|
||||
|
||||
const char *EVP_MD_name(const EVP_MD *md)
|
||||
{
|
||||
if (md->prov != NULL)
|
||||
|
@ -386,3 +386,22 @@ int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *pkeylen)
|
||||
M_check_autoarg(ctx, key, pkeylen, EVP_F_EVP_PKEY_DERIVE)
|
||||
return ctx->pmeth->derive(ctx, key, pkeylen);
|
||||
}
|
||||
|
||||
int EVP_KEYEXCH_is_a(const EVP_KEYEXCH *keyexch, const char *name)
|
||||
{
|
||||
return evp_is_a(keyexch->prov, keyexch->name_id, name);
|
||||
}
|
||||
|
||||
void EVP_KEYEXCH_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_KEYEXCH *keyexch, void *arg),
|
||||
void *arg)
|
||||
{
|
||||
struct keymgmt_data_st keymgmt_data;
|
||||
|
||||
keymgmt_data.ctx = libctx;
|
||||
keymgmt_data.properties = NULL;
|
||||
evp_generic_do_all(libctx, OSSL_OP_KEYEXCH,
|
||||
(void (*)(void *, void *))fn, arg,
|
||||
evp_keyexch_from_dispatch, &keymgmt_data,
|
||||
(void (*)(void *))EVP_KEYEXCH_free);
|
||||
}
|
||||
|
@ -88,6 +88,11 @@ const char *EVP_KDF_name(const EVP_KDF *kdf)
|
||||
return evp_first_name(kdf->prov, kdf->name_id);
|
||||
}
|
||||
|
||||
int EVP_KDF_is_a(const EVP_KDF *kdf, const char *name)
|
||||
{
|
||||
return evp_is_a(kdf->prov, kdf->name_id, name);
|
||||
}
|
||||
|
||||
const OSSL_PROVIDER *EVP_KDF_provider(const EVP_KDF *kdf)
|
||||
{
|
||||
return kdf->prov;
|
||||
|
@ -187,9 +187,9 @@ const OSSL_PARAM *EVP_KDF_settable_ctx_params(const EVP_KDF *kdf)
|
||||
return kdf->settable_ctx_params();
|
||||
}
|
||||
|
||||
void EVP_KDF_do_all_ex(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_KDF *kdf, void *arg),
|
||||
void *arg)
|
||||
void EVP_KDF_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_KDF *kdf, void *arg),
|
||||
void *arg)
|
||||
{
|
||||
evp_generic_do_all(libctx, OSSL_OP_KDF,
|
||||
(void (*)(void *, void *))fn, arg,
|
||||
|
@ -200,3 +200,17 @@ const OSSL_PROVIDER *EVP_KEYMGMT_provider(const EVP_KEYMGMT *keymgmt)
|
||||
return keymgmt->prov;
|
||||
}
|
||||
|
||||
int EVP_KEYMGMT_is_a(const EVP_KEYMGMT *keymgmt, const char *name)
|
||||
{
|
||||
return evp_is_a(keymgmt->prov, keymgmt->name_id, name);
|
||||
}
|
||||
|
||||
void EVP_KEYMGMT_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_KEYMGMT *keymgmt, void *arg),
|
||||
void *arg)
|
||||
{
|
||||
evp_generic_do_all(libctx, OSSL_OP_KEYMGMT,
|
||||
(void (*)(void *, void *))fn, arg,
|
||||
keymgmt_from_dispatch, NULL,
|
||||
(void (*)(void *))EVP_KEYMGMT_free);
|
||||
}
|
||||
|
@ -157,3 +157,8 @@ int EVP_MAC_CTX_set_params(EVP_MAC_CTX *ctx, const OSSL_PARAM params[])
|
||||
return ctx->meth->set_ctx_params(ctx->data, params);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int EVP_MAC_is_a(const EVP_MAC *mac, const char *name)
|
||||
{
|
||||
return evp_is_a(mac->prov, mac->name_id, name);
|
||||
}
|
||||
|
@ -168,11 +168,6 @@ void EVP_MAC_free(EVP_MAC *mac)
|
||||
evp_mac_free(mac);
|
||||
}
|
||||
|
||||
int EVP_MAC_is_a(const EVP_MAC *mac, const char *name)
|
||||
{
|
||||
return evp_is_a(mac->prov, mac->name_id, name);
|
||||
}
|
||||
|
||||
const char *EVP_MAC_name(const EVP_MAC *mac)
|
||||
{
|
||||
return evp_first_name(mac->prov, mac->name_id);
|
||||
@ -204,9 +199,9 @@ const OSSL_PARAM *EVP_MAC_settable_ctx_params(const EVP_MAC *mac)
|
||||
return mac->settable_ctx_params();
|
||||
}
|
||||
|
||||
void EVP_MAC_do_all_ex(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_MAC *mac, void *arg),
|
||||
void *arg)
|
||||
void EVP_MAC_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_MAC *mac, void *arg),
|
||||
void *arg)
|
||||
{
|
||||
evp_generic_do_all(libctx, OSSL_OP_MAC,
|
||||
(void (*)(void *, void *))fn, arg,
|
||||
|
@ -312,6 +312,26 @@ EVP_SIGNATURE *EVP_SIGNATURE_fetch(OPENSSL_CTX *ctx, const char *algorithm,
|
||||
(void (*)(void *))EVP_SIGNATURE_free);
|
||||
}
|
||||
|
||||
int EVP_SIGNATURE_is_a(const EVP_SIGNATURE *signature, const char *name)
|
||||
{
|
||||
return evp_is_a(signature->prov, signature->name_id, name);
|
||||
}
|
||||
|
||||
void EVP_SIGNATURE_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_SIGNATURE *signature,
|
||||
void *arg),
|
||||
void *arg)
|
||||
{
|
||||
struct keymgmt_data_st keymgmt_data;
|
||||
|
||||
keymgmt_data.ctx = libctx;
|
||||
keymgmt_data.properties = NULL;
|
||||
evp_generic_do_all(libctx, OSSL_OP_SIGNATURE,
|
||||
(void (*)(void *, void *))fn, arg,
|
||||
evp_signature_from_dispatch, &keymgmt_data,
|
||||
(void (*)(void *))EVP_SIGNATURE_free);
|
||||
}
|
||||
|
||||
static int evp_pkey_signature_init(EVP_PKEY_CTX *ctx, EVP_SIGNATURE *signature,
|
||||
int operation)
|
||||
{
|
||||
|
@ -12,7 +12,7 @@ EVP_MD_CTX_settable_params, EVP_MD_CTX_gettable_params,
|
||||
EVP_MD_CTX_set_flags, EVP_MD_CTX_clear_flags, EVP_MD_CTX_test_flags,
|
||||
EVP_Digest, EVP_DigestInit_ex, EVP_DigestInit, EVP_DigestUpdate,
|
||||
EVP_DigestFinal_ex, EVP_DigestFinalXOF, EVP_DigestFinal,
|
||||
EVP_MD_name, EVP_MD_provider,
|
||||
EVP_MD_is_a, EVP_MD_name, EVP_MD_provider,
|
||||
EVP_MD_type, EVP_MD_pkey_type, EVP_MD_size, EVP_MD_block_size, EVP_MD_flags,
|
||||
EVP_MD_CTX_name,
|
||||
EVP_MD_CTX_md, EVP_MD_CTX_type, EVP_MD_CTX_size, EVP_MD_CTX_block_size,
|
||||
@ -20,7 +20,7 @@ EVP_MD_CTX_md_data, EVP_MD_CTX_update_fn, EVP_MD_CTX_set_update_fn,
|
||||
EVP_md_null,
|
||||
EVP_get_digestbyname, EVP_get_digestbynid, EVP_get_digestbyobj,
|
||||
EVP_MD_CTX_pkey_ctx, EVP_MD_CTX_set_pkey_ctx,
|
||||
EVP_MD_do_all_ex
|
||||
EVP_MD_do_all_provided
|
||||
- EVP digest routines
|
||||
|
||||
=head1 SYNOPSIS
|
||||
@ -62,6 +62,7 @@ EVP_MD_do_all_ex
|
||||
int EVP_MD_CTX_copy(EVP_MD_CTX *out, EVP_MD_CTX *in);
|
||||
|
||||
const char *EVP_MD_name(const EVP_MD *md);
|
||||
int EVP_MD_is_a(const EVP_MD *md, const char *name);
|
||||
const OSSL_PROVIDER *EVP_MD_provider(const EVP_MD *md);
|
||||
int EVP_MD_type(const EVP_MD *md);
|
||||
int EVP_MD_pkey_type(const EVP_MD *md);
|
||||
@ -90,9 +91,9 @@ EVP_MD_do_all_ex
|
||||
EVP_PKEY_CTX *EVP_MD_CTX_pkey_ctx(const EVP_MD_CTX *ctx);
|
||||
void EVP_MD_CTX_set_pkey_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pctx);
|
||||
|
||||
void EVP_MD_do_all_ex(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_MD *mac, void *arg),
|
||||
void *arg);
|
||||
void EVP_MD_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_MD *mac, void *arg),
|
||||
void *arg);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
@ -238,10 +239,16 @@ automatically cleaned up.
|
||||
Similar to EVP_MD_CTX_copy_ex() except the destination B<out> does not have to
|
||||
be initialized.
|
||||
|
||||
=item EVP_MD_is_a()
|
||||
|
||||
Returns 1 if I<md> is an implementation of an algorithm that's
|
||||
identifiable with I<name>, otherwise 0.
|
||||
|
||||
=item EVP_MD_name(),
|
||||
EVP_MD_CTX_name()
|
||||
|
||||
Return the name of the given message digest.
|
||||
Return the name of the given message digest. For fetched message
|
||||
digests with multiple names, only one of them is returned.
|
||||
|
||||
=item EVP_MD_provider()
|
||||
|
||||
@ -330,7 +337,7 @@ by the caller. A NULL B<pctx> pointer is also allowed to clear the B<EVP_PKEY_CT
|
||||
assigned to B<ctx>. In such case, freeing the cleared B<EVP_PKEY_CTX> or not
|
||||
depends on how the B<EVP_PKEY_CTX> is created.
|
||||
|
||||
=item EVP_MD_do_all_ex()
|
||||
=item EVP_MD_do_all_provided()
|
||||
|
||||
Traverses all messages digests implemented by all activated providers
|
||||
in the given library context I<libctx>, and for each of the implementations,
|
||||
|
@ -61,7 +61,7 @@ EVP_CIPHER_param_to_asn1,
|
||||
EVP_CIPHER_asn1_to_param,
|
||||
EVP_CIPHER_CTX_set_padding,
|
||||
EVP_enc_null,
|
||||
EVP_CIPHER_do_all_ex
|
||||
EVP_CIPHER_do_all_provided
|
||||
- EVP cipher routines
|
||||
|
||||
=head1 SYNOPSIS
|
||||
@ -153,9 +153,9 @@ EVP_CIPHER_do_all_ex
|
||||
int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
|
||||
int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
|
||||
|
||||
void EVP_CIPHER_do_all_ex(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_CIPHER *cipher, void *arg),
|
||||
void *arg);
|
||||
void EVP_CIPHER_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_CIPHER *cipher, void *arg),
|
||||
void *arg);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
@ -330,11 +330,12 @@ IDENTIFIER as such it ignores the cipher parameters and 40 bit RC2 and
|
||||
identifier or does not have ASN1 support this function will return
|
||||
B<NID_undef>.
|
||||
|
||||
EVP_CIPHER_is_a() returns 1 if the given I<cipher> is an implementation of an
|
||||
EVP_CIPHER_is_a() returns 1 if I<cipher> is an implementation of an
|
||||
algorithm that's identifiable with I<name>, otherwise 0.
|
||||
|
||||
EVP_CIPHER_name() and EVP_CIPHER_CTX_name() return the name of the passed
|
||||
cipher or context.
|
||||
cipher or context. For fetched ciphers with multiple names, only one
|
||||
of them is returned.
|
||||
|
||||
EVP_CIPHER_provider() returns an B<OSSL_PROVIDER> pointer to the provider
|
||||
that implements the given B<EVP_CIPHER>.
|
||||
@ -377,7 +378,7 @@ based on the cipher context. The EVP_CIPHER can provide its own random key
|
||||
generation routine to support keys of a specific form. B<Key> must point to a
|
||||
buffer at least as big as the value returned by EVP_CIPHER_CTX_key_length().
|
||||
|
||||
EVP_CIPHER_do_all_ex() traverses all ciphers implemented by all activated
|
||||
EVP_CIPHER_do_all_provided() traverses all ciphers implemented by all activated
|
||||
providers in the given library context I<libctx>, and for each of the
|
||||
implementations, calls the given function I<fn> with the implementation method
|
||||
and the given I<arg> as argument.
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
EVP_KDF, EVP_KDF_fetch, EVP_KDF_free, EVP_KDF_provider, EVP_KDF_up_ref,
|
||||
EVP_KDF_name,
|
||||
EVP_KDF_CTX, EVP_KDF_CTX_new, EVP_KDF_CTX_free, EVP_KDF_CTX_kdf,
|
||||
EVP_KDF_reset, EVP_KDF_size, EVP_KDF_derive, EVP_KDF_CTX_dup,
|
||||
EVP_KDF_CTX_get_params, EVP_KDF_CTX_set_params, EVP_KDF_do_all_ex,
|
||||
EVP_KDF, EVP_KDF_fetch, EVP_KDF_free, EVP_KDF_up_ref,
|
||||
EVP_KDF_CTX, EVP_KDF_CTX_new, EVP_KDF_CTX_free, EVP_KDF_CTX_dup,
|
||||
EVP_KDF_reset, EVP_KDF_derive,
|
||||
EVP_KDF_size, EVP_KDF_provider, EVP_KDF_CTX_kdf, EVP_KDF_is_a,
|
||||
EVP_KDF_CTX_get_params, EVP_KDF_CTX_set_params, EVP_KDF_do_all_provided,
|
||||
EVP_KDF_get_params, EVP_KDF_gettable_ctx_params, EVP_KDF_settable_ctx_params,
|
||||
EVP_KDF_gettable_params - EVP KDF routines
|
||||
|
||||
@ -29,9 +29,11 @@ EVP_KDF_gettable_params - EVP KDF routines
|
||||
void EVP_KDF_free(EVP_KDF *kdf);
|
||||
EVP_KDF *EVP_KDF_fetch(OPENSSL_CTX *libctx, const char *algorithm,
|
||||
const char *properties);
|
||||
void EVP_KDF_do_all_ex(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_KDF *kdf, void *arg),
|
||||
void *arg);
|
||||
int EVP_KDF_is_a(const EVP_KDF *kdf, const char *name);
|
||||
const OSSL_PROVIDER *EVP_KDF_provider(const EVP_KDF *kdf);
|
||||
void EVP_KDF_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_KDF *kdf, void *arg),
|
||||
void *arg);
|
||||
int EVP_KDF_get_params(EVP_KDF *kdf, OSSL_PARAM params[]);
|
||||
int EVP_KDF_CTX_get_params(EVP_KDF_CTX *ctx, OSSL_PARAM params[]);
|
||||
int EVP_KDF_CTX_set_params(EVP_KDF_CTX *ctx, const OSSL_PARAM params[]);
|
||||
@ -130,10 +132,13 @@ calculate a fixed output size have not yet been supplied.
|
||||
|
||||
EVP_KDF_name() returns the name of the given KDF implementation.
|
||||
|
||||
EVP_KDF_is_a() returns 1 if I<kdf> is an implementation of an
|
||||
algorithm that's identifiable with I<name>, otherwise 0.
|
||||
|
||||
EVP_KDF_provider() returns the provider that holds the implementation
|
||||
of the given I<kdf>.
|
||||
|
||||
EVP_KDF_do_all_ex() traverses all KDF implemented by all activated
|
||||
EVP_KDF_do_all_provided() traverses all KDF implemented by all activated
|
||||
providers in the given library context I<libctx>, and for each of the
|
||||
implementations, calls the given function I<fn> with the implementation method
|
||||
and the given I<arg> as argument.
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
EVP_KEYEXCH_fetch, EVP_KEYEXCH_free, EVP_KEYEXCH_up_ref, EVP_KEYEXCH_provider
|
||||
EVP_KEYEXCH_fetch, EVP_KEYEXCH_free, EVP_KEYEXCH_up_ref, EVP_KEYEXCH_provider,
|
||||
EVP_KEYEXCH_is_a, EVP_KEYEXCH_do_all_provided,
|
||||
- Functions to manage EVP_KEYEXCH algorithm objects
|
||||
|
||||
=head1 SYNOPSIS
|
||||
@ -14,6 +15,10 @@ EVP_KEYEXCH_fetch, EVP_KEYEXCH_free, EVP_KEYEXCH_up_ref, EVP_KEYEXCH_provider
|
||||
void EVP_KEYEXCH_free(EVP_KEYEXCH *exchange);
|
||||
int EVP_KEYEXCH_up_ref(EVP_KEYEXCH *exchange);
|
||||
OSSL_PROVIDER *EVP_KEYEXCH_provider(const EVP_KEYEXCH *exchange);
|
||||
int EVP_KEYEXCH_is_a(const EVP_KEYEXCH *exchange, const char *name);
|
||||
void EVP_KEYEXCH_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_KEYEXCH *exchange, void *arg),
|
||||
void *arg);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
@ -34,6 +39,14 @@ structure.
|
||||
|
||||
EVP_KEYEXCH_provider() returns the provider that I<exchange> was fetched from.
|
||||
|
||||
EVP_KEYEXCH_is_a() checks if I<exchange> is an implementation of an
|
||||
algorithm that's identifiable with I<name>.
|
||||
|
||||
EVP_KEYEXCH_do_all_provided() traverses all key exchange implementations by
|
||||
all activated providers in the library context I<libctx>, and for each
|
||||
of the implementations, calls I<fn> with the implementation method and
|
||||
I<data> as arguments.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
EVP_KEYEXCH_fetch() returns a pointer to a B<EVP_KEYEXCH> for success
|
||||
@ -41,6 +54,9 @@ or NULL for failure.
|
||||
|
||||
EVP_KEYEXCH_up_ref() returns 1 for success or 0 otherwise.
|
||||
|
||||
EVP_KEYEXCH_is_a() returns 1 of I<exchange> was identifiable,
|
||||
otherwise 0.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<provider(7)/Fetching algorithms>, L<OSSL_PROVIDER(3)>
|
||||
|
@ -6,7 +6,9 @@ EVP_KEYMGMT,
|
||||
EVP_KEYMGMT_fetch,
|
||||
EVP_KEYMGMT_up_ref,
|
||||
EVP_KEYMGMT_free,
|
||||
EVP_KEYMGMT_provider
|
||||
EVP_KEYMGMT_provider,
|
||||
EVP_KEYMGMT_is_a,
|
||||
EVP_KEYMGMT_do_all_provided,
|
||||
- EVP key management routines
|
||||
|
||||
=head1 SYNOPSIS
|
||||
@ -20,6 +22,10 @@ EVP_KEYMGMT_provider
|
||||
int EVP_KEYMGMT_up_ref(EVP_KEYMGMT *keymgmt);
|
||||
void EVP_KEYMGMT_free(EVP_KEYMGMT *keymgmt);
|
||||
const OSSL_PROVIDER *EVP_KEYMGMT_provider(const EVP_KEYMGMT *keymgmt);
|
||||
int EVP_KEYMGMT_is_a(const EVP_KEYMGMT *keymgmt, const char *name);
|
||||
void EVP_KEYMGMT_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_KEYMGMT *keymgmt, void *arg),
|
||||
void *arg);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
@ -45,6 +51,14 @@ B<EVP_KEYMGMT> I<keymgmt>, and when the count reaches zero, frees it.
|
||||
EVP_KEYMGMT_provider() returns the provider that has this particular
|
||||
implementation.
|
||||
|
||||
EVP_KEYMGMT_is_a() checks if I<keymgmt> is an implementation of an
|
||||
algorithm that's identifiable with I<name>.
|
||||
|
||||
EVP_KEYMGMT_do_all_provided() traverses all key keymgmt implementations by
|
||||
all activated providers in the library context I<libctx>, and for each
|
||||
of the implementations, calls I<fn> with the implementation method and
|
||||
I<data> as arguments.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
EVP_KEYMGMT_fetch() may be called implicitly by other fetching
|
||||
@ -64,6 +78,9 @@ EVP_KEYMGMT_free() doesn't return any value.
|
||||
EVP_KEYMGMT_provider() returns a pointer to a provider object, or NULL
|
||||
on error.
|
||||
|
||||
EVP_KEYMGMT_is_a() returns 1 of I<keymgmt> was identifiable,
|
||||
otherwise 0.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<EVP_MD_fetch(3)>, L<OPENSSL_CTX(3)>
|
||||
|
@ -9,7 +9,7 @@ EVP_MAC_CTX, EVP_MAC_CTX_new, EVP_MAC_CTX_free, EVP_MAC_CTX_dup,
|
||||
EVP_MAC_CTX_mac, EVP_MAC_CTX_get_params, EVP_MAC_CTX_set_params,
|
||||
EVP_MAC_size, EVP_MAC_init, EVP_MAC_update, EVP_MAC_final,
|
||||
EVP_MAC_gettable_ctx_params, EVP_MAC_settable_ctx_params,
|
||||
EVP_MAC_do_all_ex - EVP MAC routines
|
||||
EVP_MAC_do_all_provided - EVP MAC routines
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@ -44,9 +44,9 @@ EVP_MAC_do_all_ex - EVP MAC routines
|
||||
const OSSL_PARAM *EVP_MAC_gettable_ctx_params(const EVP_MAC *mac);
|
||||
const OSSL_PARAM *EVP_MAC_settable_ctx_params(const EVP_MAC *mac);
|
||||
|
||||
void EVP_MAC_do_all_ex(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_MAC *mac, void *arg),
|
||||
void *arg);
|
||||
void EVP_MAC_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_MAC *mac, void *arg),
|
||||
void *arg);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
@ -165,7 +165,7 @@ algorithm that's identifiable with I<name>.
|
||||
EVP_MAC_provider() returns the provider that holds the implementation
|
||||
of the given I<mac>.
|
||||
|
||||
EVP_MAC_do_all_ex() traverses all MAC implemented by all activated
|
||||
EVP_MAC_do_all_provided() traverses all MAC implemented by all activated
|
||||
providers in the given library context I<libctx>, and for each of the
|
||||
implementations, calls the given function I<fn> with the implementation method
|
||||
and the given I<arg> as argument.
|
||||
@ -278,7 +278,7 @@ EVP_MAC_size() returns the expected output size, or 0 if it isn't
|
||||
set.
|
||||
If it isn't set, a call to EVP_MAC_init() should get it set.
|
||||
|
||||
EVP_MAC_do_all_ex() returns nothing at all.
|
||||
EVP_MAC_do_all_provided() returns nothing at all.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
=head1 NAME
|
||||
|
||||
EVP_SIGNATURE_fetch, EVP_SIGNATURE_free, EVP_SIGNATURE_up_ref,
|
||||
EVP_SIGNATURE_provider
|
||||
EVP_SIGNATURE_is_a, EVP_SIGNATURE_provider, EVP_SIGNATURE_do_all_provided
|
||||
- Functions to manage EVP_SIGNATURE algorithm objects
|
||||
|
||||
=head1 SYNOPSIS
|
||||
@ -14,7 +14,12 @@ EVP_SIGNATURE_provider
|
||||
const char *properties);
|
||||
void EVP_SIGNATURE_free(EVP_SIGNATURE *signature);
|
||||
int EVP_SIGNATURE_up_ref(EVP_SIGNATURE *signature);
|
||||
int EVP_SIGNATURE_is_a(const EVP_SIGNATURE *signature, const char *name);
|
||||
OSSL_PROVIDER *EVP_SIGNATURE_provider(const EVP_SIGNATURE *signature);
|
||||
void EVP_SIGNATURE_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_SIGNATURE *signature,
|
||||
void *arg),
|
||||
void *arg);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
@ -35,8 +40,16 @@ structure is freed.
|
||||
EVP_SIGNATURE_up_ref() increments the reference count for an B<EVP_SIGNATURE>
|
||||
structure.
|
||||
|
||||
EVP_SIGNATURE_is_a() returns 1 if I<signature> is an implementation of an
|
||||
algorithm that's identifiable with I<name>, otherwise 0.
|
||||
|
||||
EVP_SIGNATURE_provider() returns the provider that I<signature> was fetched from.
|
||||
|
||||
EVP_SIGNATURE_do_all_provided() traverses all SIGNATURE implemented by all
|
||||
activated roviders in the given library context I<libctx>, and for each of the
|
||||
implementations, calls the given function I<fn> with the implementation method
|
||||
and the given I<arg> as argument.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
EVP_SIGNATURE_fetch() returns a pointer to an B<EVP_SIGNATURE> for success
|
||||
|
@ -462,6 +462,7 @@ typedef int (EVP_PBE_KEYGEN) (EVP_CIPHER_CTX *ctx, const char *pass,
|
||||
int EVP_MD_type(const EVP_MD *md);
|
||||
# define EVP_MD_nid(e) EVP_MD_type(e)
|
||||
const char *EVP_MD_name(const EVP_MD *md);
|
||||
int EVP_MD_is_a(const EVP_MD *md, const char *name);
|
||||
const OSSL_PROVIDER *EVP_MD_provider(const EVP_MD *md);
|
||||
int EVP_MD_pkey_type(const EVP_MD *md);
|
||||
int EVP_MD_size(const EVP_MD *md);
|
||||
@ -1031,9 +1032,9 @@ void EVP_CIPHER_do_all(void (*fn) (const EVP_CIPHER *ciph,
|
||||
void EVP_CIPHER_do_all_sorted(void (*fn)
|
||||
(const EVP_CIPHER *ciph, const char *from,
|
||||
const char *to, void *x), void *arg);
|
||||
void EVP_CIPHER_do_all_ex(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_CIPHER *cipher, void *arg),
|
||||
void *arg);
|
||||
void EVP_CIPHER_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_CIPHER *cipher, void *arg),
|
||||
void *arg);
|
||||
|
||||
void EVP_MD_do_all(void (*fn) (const EVP_MD *ciph,
|
||||
const char *from, const char *to, void *x),
|
||||
@ -1041,9 +1042,9 @@ void EVP_MD_do_all(void (*fn) (const EVP_MD *ciph,
|
||||
void EVP_MD_do_all_sorted(void (*fn)
|
||||
(const EVP_MD *ciph, const char *from,
|
||||
const char *to, void *x), void *arg);
|
||||
void EVP_MD_do_all_ex(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_MD *md, void *arg),
|
||||
void *arg);
|
||||
void EVP_MD_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_MD *md, void *arg),
|
||||
void *arg);
|
||||
|
||||
/* MAC stuff */
|
||||
|
||||
@ -1072,9 +1073,9 @@ const OSSL_PARAM *EVP_MAC_gettable_params(const EVP_MAC *mac);
|
||||
const OSSL_PARAM *EVP_MAC_gettable_ctx_params(const EVP_MAC *mac);
|
||||
const OSSL_PARAM *EVP_MAC_settable_ctx_params(const EVP_MAC *mac);
|
||||
|
||||
void EVP_MAC_do_all_ex(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_MAC *mac, void *arg),
|
||||
void *arg);
|
||||
void EVP_MAC_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_MAC *mac, void *arg),
|
||||
void *arg);
|
||||
|
||||
/* PKEY stuff */
|
||||
int EVP_PKEY_decrypt_old(unsigned char *dec_key,
|
||||
@ -1438,6 +1439,10 @@ EVP_KEYMGMT *EVP_KEYMGMT_fetch(OPENSSL_CTX *ctx, const char *algorithm,
|
||||
int EVP_KEYMGMT_up_ref(EVP_KEYMGMT *keymgmt);
|
||||
void EVP_KEYMGMT_free(EVP_KEYMGMT *keymgmt);
|
||||
const OSSL_PROVIDER *EVP_KEYMGMT_provider(const EVP_KEYMGMT *keymgmt);
|
||||
int EVP_KEYMGMT_is_a(const EVP_KEYMGMT *keymgmt, const char *name);
|
||||
void EVP_KEYMGMT_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_KEYMGMT *keymgmt, void *arg),
|
||||
void *arg);
|
||||
|
||||
EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e);
|
||||
EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e);
|
||||
@ -1495,6 +1500,11 @@ int EVP_SIGNATURE_up_ref(EVP_SIGNATURE *signature);
|
||||
OSSL_PROVIDER *EVP_SIGNATURE_provider(const EVP_SIGNATURE *signature);
|
||||
EVP_SIGNATURE *EVP_SIGNATURE_fetch(OPENSSL_CTX *ctx, const char *algorithm,
|
||||
const char *properties);
|
||||
int EVP_SIGNATURE_is_a(const EVP_SIGNATURE *signature, const char *name);
|
||||
void EVP_SIGNATURE_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_SIGNATURE *signature,
|
||||
void *data),
|
||||
void *data);
|
||||
|
||||
int EVP_PKEY_sign_init_ex(EVP_PKEY_CTX *ctx, EVP_SIGNATURE *signature);
|
||||
int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx);
|
||||
@ -1755,6 +1765,10 @@ int EVP_KEYEXCH_up_ref(EVP_KEYEXCH *exchange);
|
||||
EVP_KEYEXCH *EVP_KEYEXCH_fetch(OPENSSL_CTX *ctx, const char *algorithm,
|
||||
const char *properties);
|
||||
OSSL_PROVIDER *EVP_KEYEXCH_provider(const EVP_KEYEXCH *exchange);
|
||||
int EVP_KEYEXCH_is_a(const EVP_KEYEXCH *keyexch, const char *name);
|
||||
void EVP_KEYEXCH_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_KEYEXCH *keyexch, void *data),
|
||||
void *data);
|
||||
|
||||
void EVP_add_alg_module(void);
|
||||
|
||||
|
@ -34,6 +34,7 @@ EVP_KDF_CTX *EVP_KDF_CTX_new(EVP_KDF *kdf);
|
||||
void EVP_KDF_CTX_free(EVP_KDF_CTX *ctx);
|
||||
EVP_KDF_CTX *EVP_KDF_CTX_dup(const EVP_KDF_CTX *src);
|
||||
const char *EVP_KDF_name(const EVP_KDF *kdf);
|
||||
int EVP_KDF_is_a(const EVP_KDF *kdf, const char *name);
|
||||
const OSSL_PROVIDER *EVP_KDF_provider(const EVP_KDF *kdf);
|
||||
const EVP_KDF *EVP_KDF_CTX_kdf(EVP_KDF_CTX *ctx);
|
||||
|
||||
@ -47,9 +48,9 @@ const OSSL_PARAM *EVP_KDF_gettable_params(const EVP_KDF *kdf);
|
||||
const OSSL_PARAM *EVP_KDF_gettable_ctx_params(const EVP_KDF *kdf);
|
||||
const OSSL_PARAM *EVP_KDF_settable_ctx_params(const EVP_KDF *kdf);
|
||||
|
||||
void EVP_KDF_do_all_ex(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_KDF *kdf, void *arg),
|
||||
void *arg);
|
||||
void EVP_KDF_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_KDF *kdf, void *arg),
|
||||
void *arg);
|
||||
|
||||
# define EVP_KDF_CTRL_SET_PASS 0x01 /* unsigned char *, size_t */
|
||||
# define EVP_KDF_CTRL_SET_SALT 0x02 /* unsigned char *, size_t */
|
||||
|
@ -4683,8 +4683,8 @@ EVP_CIPHER_name 4799 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MD_provider 4800 3_0_0 EXIST::FUNCTION:
|
||||
EVP_CIPHER_provider 4801 3_0_0 EXIST::FUNCTION:
|
||||
OSSL_PROVIDER_name 4802 3_0_0 EXIST::FUNCTION:
|
||||
EVP_CIPHER_do_all_ex 4803 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MD_do_all_ex 4804 3_0_0 EXIST::FUNCTION:
|
||||
EVP_CIPHER_do_all_provided 4803 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MD_do_all_provided 4804 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KEYEXCH_provider 4805 3_0_0 EXIST::FUNCTION:
|
||||
OSSL_PROVIDER_available 4806 3_0_0 EXIST::FUNCTION:
|
||||
ERR_new 4807 3_0_0 EXIST::FUNCTION:
|
||||
@ -4722,7 +4722,7 @@ EVP_MAC_name 4838 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_get_params 4839 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_gettable_params 4840 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_provider 4841 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_do_all_ex 4842 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_do_all_provided 4842 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MD_free 4843 3_0_0 EXIST::FUNCTION:
|
||||
EVP_CIPHER_free 4844 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_up_ref 4845 3_0_0 EXIST::FUNCTION:
|
||||
@ -4737,7 +4737,7 @@ EVP_KDF_CTX_set_params 4853 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_gettable_params 4854 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_gettable_ctx_params 4855 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_settable_ctx_params 4856 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_do_all_ex 4857 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_do_all_provided 4857 3_0_0 EXIST::FUNCTION:
|
||||
EVP_SIGNATURE_free 4858 3_0_0 EXIST::FUNCTION:
|
||||
EVP_SIGNATURE_up_ref 4859 3_0_0 EXIST::FUNCTION:
|
||||
EVP_SIGNATURE_provider 4860 3_0_0 EXIST::FUNCTION:
|
||||
@ -4828,3 +4828,11 @@ EVP_DigestVerifyInit_ex 4944 3_0_0 EXIST::FUNCTION:
|
||||
EVP_DigestVerifyUpdate 4945 3_0_0 EXIST::FUNCTION:
|
||||
BN_check_prime 4946 3_0_0 EXIST::FUNCTION:
|
||||
EVP_PKEY_CTX_new_provided 4947 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KEYMGMT_is_a 4948 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KEYMGMT_do_all_provided 4949 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KEYEXCH_is_a 4950 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KEYEXCH_do_all_provided 4951 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_is_a 4952 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MD_is_a 4953 3_0_0 EXIST::FUNCTION:
|
||||
EVP_SIGNATURE_is_a 4954 3_0_0 EXIST::FUNCTION:
|
||||
EVP_SIGNATURE_do_all_provided 4955 3_0_0 EXIST::FUNCTION:
|
||||
|
Loading…
Reference in New Issue
Block a user