NAME
EVP_CIPHER_do_all, EVP_CIPHER_do_all_sorted, EVP_MD_do_all, EVP_MD_do_all_sorted, OBJ_NAME_do_all, OBJ_NAME_do_all_sorted – iterate over lookup tables for ciphers and digests
SYNOPSIS
Crypto Library (libcrypto, -lcrypto)
#include <openssl/evp.h>
void
EVP_CIPHER_do_all(void (*fn)(const EVP_CIPHER *cipher, const char *from, const char *to, void *arg), void *arg);
void
EVP_CIPHER_do_all_sorted(void (*fn)(const EVP_CIPHER *cipher, const char *from, const char *to, void *arg), void *arg);
void
EVP_MD_do_all(void (*fn)(const EVP_MD *md, const char *from, const char *to, void *arg), void *arg);
void
EVP_MD_do_all_sorted(void (*fn)(const EVP_MD *md, const char *from, const char *to, void *arg), void *arg);
typedef struct {
int type;
int alias;
const char *name;
const char *data;
} OBJ_NAME;
void
OBJ_NAME_do_all(int type, void (*fn)(const OBJ_NAME *obj_name, void *arg), void *arg);
void
OBJ_NAME_do_all_sorted(int type, void (*fn)(const OBJ_NAME *obj_name, void *arg), void *arg);
DESCRIPTION
EVP_CIPHER_do_all() calls fn on every entry of the global table of cipher names and aliases. For a cipher name entry, fn is called with a non-NULL cipher, its non-NULL cipher name from, a NULL to, and the arg pointer. For an alias entry, fn is called with a NULL cipher, its alias from, the cipher name that alias points to, and the arg pointer.
EVP_CIPHER_do_all_sorted() is similar, except that it processes the cipher names and aliases in lexicographic order of their from names as determined by strcmp(3).
EVP_MD_do_all() calls fn on every entry of the global table of digest names and aliases. For a digest name entry, fn is called with a non-NULL md, its non-NULL digest name from, a NULL to, and the arg pointer. For an alias entry, fn is called with a NULL md, its alias from, the digest name that alias points to, and the arg pointer.
EVP_MD_do_all_sorted() is similar, except that it processes the digest names and aliases in lexicographic order of their from names as determined by strcmp(3).
OBJ_NAME is an abstraction of the types underlying the lookup tables for ciphers and their aliases, and digests and their aliases, respectively. For a cipher, type is OBJ_NAME_TYPE_CIPHER_METH, alias is 0, name is its lookup name and data is the EVP_CIPHER object it represents, cast to const char *. For a cipher alias, type is OBJ_NAME_TYPE_CIPHER_METH, alias is OBJ_NAME_ALIAS, name is its lookup name and data is the name it aliases. Digests representing an EVP_MD object and their aliases are represented similarly, except that their type is OBJ_NAME_TYPE_MD_METH.
OBJ_NAME_do_all() calls fn on every obj_name in the table that has the given type (either OBJ_NAME_TYPE_CIPHER_METH or OBJ_NAME_TYPE_MD_METH), also passing the arg pointer. OBJ_NAME_do_all_sorted() is similar except that it processes the obj_name in lexicographic order of their names as determined by strcmp(3).
SEE ALSO
evp(3), EVP_get_cipherbyname(3), EVP_get_digestbyname(3)
HISTORY
These functions first appeared in OpenSSL 1.0.0 and have been available since OpenBSD 4.9.
CAVEATS
EVP_CIPHER_do_all_sorted(), EVP_MD_do_all_sorted(), and OBJ_NAME_do_all_sorted() cannot report errors. In some implementations they need to allocate internally and if memory allocation fails they do nothing at all, without telling the caller about the problem.