OSSL_ALGORITHM(3SSL)
π OSSL_ALGORITHM π
okay bestie, gather round, because we're talking about OSSL_ALGORITHM, from the 3SSL manual suite β it's the OpenSSL core type that defines a fetchable algorithm. yes, it's giving very much "behind the scenes but make it iconic" π
β¨ 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 πΈ
OSSL_ALGORITHM is a public structure and its whole job is describing an algorithm that a provider(7) provides. Like, that's the assignment. Arrays of this type get handed back by providers, on demand, when the OpenSSL libraries come asking β basically the provider is like "here's what algorithms I implement and here's their properties, hope that helps π«Ά".
π¨ IMPORTANT, no cap: arrays of this type must be terminated with a tuple wherealgorithm_namesisNULL. Do not forget the NULL terminator. She is load-bearing.
This kind of array is typically returned by the provider's operation querying function β that's described further under "Provider Functions" in provider-base(7).
π 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're looking for. π
Having multiple names / identities means one specific algorithm implementation can be fetched multiple ways. Case in point: the RSA algorithm has these known identities:
"RSA""rsaEncryption"β this 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 take the first of the algorithm names as the main or canonical name, on a per algorithm implementation basis. π
Peep the notes down in "On the subject of algorithm names" for a deeper discussion on algorithm_names and how it may interact with applications and libraries, OpenSSL's included.
property_definitionβ this string defines a set of properties tied to 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 sitting around. Seeproperty(7)for a fuller description of what goes in this string.implementationβ a pointer to anOSSL_DISPATCH(3)array, containing pointers to the functions of a particular algorithm implementation. π§algorithm_descriptionβ a string with a short human-readable description of the algorithm.
π 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 β uses 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. fr fr, both.
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 it's not registered (or if OBJ_obj2txt(3) is called with no_name = 1).
It's recommended to make sure that the corresponding OSSL_ALGORITHM's algorithm_names includes known names as well as the OID itself in canonical decimal text form. That way you've covered all scenarios. π
π 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 π«
π 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, we ate and left no crumbs π this was OpenSSL 4.0.3, dated 2026-09-29 β catch you in the next manpage, muah πβ¨π
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms