---
name: "libressl-EVP_CIPHER_do_all"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-EVP_CIPHER_do_all"
---

# libressl-EVP\_CIPHER\_do\_all(3)

iterate over lookup tables for ciphers and digests

## 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)](/strcmp/3.md).

**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)](/strcmp/3.md).

*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)](/strcmp/3.md).

## 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.
