diff options
author | Richard Levitte <levitte@openssl.org> | 2019-09-14 16:35:08 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-09-19 14:58:17 +0200 |
commit | 7cfa1717b812a126ce6f8e4cc32139164c89d789 (patch) | |
tree | 6baeb081c8d404bb4e82cabe0d42b5c78a356e19 /doc | |
parent | f7c16d48a945e80f22f6f02550ee3fe14edb52fa (diff) |
Modify providers that keep track of underlying algorithms
With some provider implementations, there are underlying ciphers,
digests and macs. For some of them, the name was retrieved from the
method, but since the methods do not store those any more, we add
different mechanics.
For code that needs to pass on the name of a cipher or diges via
parameters, we simply locally store the name that was used when
fetching said cipher or digest. This will ensure that any underlying
code that needs to fetch that same cipher or digest does so with the
exact same name instead of any random name from the set of names
associated with the algorithm.
For code that needs to check what kind of algorithm was passed, we
provide EVP_{type}_is_a(), that returns true if the given method has
the given name as one of its names.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9897)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/man3/EVP_EncryptInit.pod | 5 | ||||
-rw-r--r-- | doc/man3/EVP_MAC.pod | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/doc/man3/EVP_EncryptInit.pod b/doc/man3/EVP_EncryptInit.pod index 78f67bd643..a2ccc6f3d6 100644 --- a/doc/man3/EVP_EncryptInit.pod +++ b/doc/man3/EVP_EncryptInit.pod @@ -28,6 +28,7 @@ EVP_CipherFinal, EVP_get_cipherbyname, EVP_get_cipherbynid, EVP_get_cipherbyobj, +EVP_CIPHER_is_a, EVP_CIPHER_name, EVP_CIPHER_provider, EVP_CIPHER_nid, @@ -116,6 +117,7 @@ EVP_CIPHER_do_all_ex const EVP_CIPHER *EVP_get_cipherbyobj(const ASN1_OBJECT *a); int EVP_CIPHER_nid(const EVP_CIPHER *e); + int EVP_CIPHER_is_a(const EVP_CIPHER *cipher, const char *name); const char *EVP_CIPHER_name(const EVP_CIPHER *cipher); const OSSL_PROVIDER *EVP_CIPHER_provider(const EVP_CIPHER *cipher); int EVP_CIPHER_block_size(const EVP_CIPHER *e); @@ -315,6 +317,9 @@ 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 +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. diff --git a/doc/man3/EVP_MAC.pod b/doc/man3/EVP_MAC.pod index 2ab4c48fbf..df15a907ec 100644 --- a/doc/man3/EVP_MAC.pod +++ b/doc/man3/EVP_MAC.pod @@ -2,7 +2,8 @@ =head1 NAME -EVP_MAC, EVP_MAC_fetch, EVP_MAC_up_ref, EVP_MAC_free, EVP_MAC_name, +EVP_MAC, EVP_MAC_fetch, EVP_MAC_up_ref, EVP_MAC_free, +EVP_MAC_is_a, EVP_MAC_name, EVP_MAC_provider, EVP_MAC_get_params, EVP_MAC_gettable_params, 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, @@ -21,6 +22,7 @@ EVP_MAC_do_all_ex - EVP MAC routines const char *properties); int EVP_MAC_up_ref(EVP_MAC *mac); void EVP_MAC_free(EVP_MAC *mac); + int EVP_MAC_is_a(const EVP_MAC *mac, const char *name); const char *EVP_MAC_name(const EVP_MAC *mac); const OSSL_PROVIDER *EVP_MAC_provider(const EVP_MAC *mac); int EVP_MAC_get_params(EVP_MAC *mac, OSSL_PARAM params[]); @@ -157,6 +159,9 @@ EVP_MAC_size() returns the MAC output size for the given context. EVP_MAC_name() returns the name of the given MAC implementation. +EVP_MAC_is_a() checks if the given I<mac> is an implementation of an +algorithm that's identifiable with I<name>. + EVP_MAC_provider() returns the provider that holds the implementation of the given I<mac>. @@ -256,6 +261,9 @@ EVP_MAC_free() returns nothing at all. EVP_MAC_name() returns the name of the MAC, or NULL if NULL was passed. +EVP_MAC_is_a() returns 1 if the given method can be identified with +the given name, otherwise 0. + EVP_MAC_provider() returns a pointer to the provider for the MAC, or NULL on error. |