OSSL_ALGORITHM(3ossl)
π OSSL_ALGORITHM π
okay bestie, welcome to the OpenSSL manual, and today's main character is OSSL_ALGORITHM β the OpenSSL core type that defines a fetchable algorithm. yes we're going in, hold my iced coffee π§
β¨ SYNOPSIS β¨
#include <openssl/core.h>
typedef struct ossl_algorithm_st OSSL_ALGORITHM;
struct ossl_algorithm_st {
const char *algorithm_names; /* key */
const char *property_definition; /* key */
const OSSL_DISPATCH *implementation;
const char *algorithm_description;
};
πΈ DESCRIPTION πΈ
so. OSSL_ALGORITHM is a public struct that describes an algorithm that a provider(7) provides. literally its whole job. Arrays of this type get returned by providers on demand from the OpenSSL libraries, and they're basically the provider going "here's what algorithms I have implementations of, and here's their properties" π
β οΈ the vibe check you cannot fail: arrays of this type must be terminated with a tuple wherealgorithm_namesisNULL. no cap. don't forget it or it's giving undefined chaos.
This type of array is typically returned by the provider's operation querying function β that's further described in "Provider Functions" in provider-base(7). iykyk π«Ά
π OSSL_ALGORITHM fields
algorithm_namesβ this string is a colon separated set of names / identities, and the appropriate fetching functionality (likeEVP_CIPHER_fetch(3),EVP_MD_fetch(3), etc) uses it to find the algorithm you want. π
multiple names / identities mean a specific algorithm implementation can be fetched multiple ways. iconic, honestly. for example, the RSA algorithm has these known identities:
"RSA""rsaEncryption"
this one is the name of the algorithm's OBJECT IDENTIFIER (OID), as given by the PKCS#1 RFC's ASN.1 module <https://www.rfc-editor.org/rfc/rfc8017#appendix-C>
1.2.840.113549.1.1.1
this is the OID itself for "rsaEncryption", in canonical decimal text form.
so the resulting algorithm_names string would look like this:
"RSA:rsaEncryption:1.2.840.113549.1.1.1"
the OpenSSL libraries use the first of the algorithm names as the main or canonical name, on a per algorithm implementation basis. first one eats first π
see the notes "On the subject of algorithm names" below for a more in depth discussion on algorithm_names and how that may interact with applications and libraries, including OpenSSL's own. it's a whole thing, bestie.
property_definitionβ this string defines a set of properties associated with a particular algorithm implementation, and the appropriate fetching functionality (likeEVP_CIPHER_fetch(3),EVP_MD_fetch(3), etc) uses it for a finer grained lookup of an algorithm implementation. super useful when multiple implementations of the same algorithm are available and you need to pick your fave β¨
see property(7) for a further description of the contents of this string.
implementationβ pointer to anOSSL_DISPATCH(3)array, containing pointers to the functions of a particular algorithm implementation. the actual function lineup, the squad πalgorithm_descriptionβ a string with a short human-readable description of the algorithm. short. human-readable. adorable.
π¦ NOTES π¦
On the subject of algorithm names
providers may find the need to register ASN.1 OIDs for algorithms using OBJ_create(3) β via the core_obj_create upcall described in provider-base(7) β because some application or library (possibly still the OpenSSL libraries, even π) use NIDs to look up algorithms.
in that scenario, you must make sure that the corresponding OSSL_ALGORITHM's algorithm_names includes both the short and the long name. both. not one. both. periodt.
most of the time, registering ASN.1 OIDs like this shouldn't be necessary, and applications and libraries are encouraged to use OBJ_obj2txt(3) to get a text representation of the OID, which may be a long or short name for OIDs that are registered, or the OID itself in canonical decimal text form if not (or if OBJ_obj2txt(3) is called with no_name = 1). slay π
it's recommended to make sure that the corresponding OSSL_ALGORITHM's algorithm_names include known names as well as the OID itself in canonical decimal text form. that should cover all scenarios. chef's kiss, we love a future-proof queen π
π SEE ALSO π
crypto(7), provider-base(7), openssl-core.h(7), openssl-core_dispatch.h(7), OSSL_DISPATCH(3)
β HISTORY β
OSSL_ALGORITHM was added in OpenSSL 3.0. a modern icon fr fr.
π COPYRIGHT π
Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
and that's the whole page bestie!! π this was the OSSL_ALGORITHM(3ossl) manual for OpenSSL 3.5.9, dated 2026-09-29 β go forth and terminate your arrays with a NULL algorithm_names tuple, mwah π
β¨π¦
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms