OSSL_DISPATCH(3ossl)
π OSSL_DISPATCH β the OpenSSL core type that's literally a function table, bestie π
okay so welcome to the OSSL_DISPATCH page in the OpenSSL manual (that's section 3ossl for the record, iykyk). this is the glow-up doc for OSSL_DISPATCH and its bestie OSSL_DISPATCH_END β the OpenSSL Core type you use to define a dispatchable function table. yes it's giving β¨plumbingβ¨ but it's important plumbing, so sit with me π«Ά
β¨ NAME β¨
OSSL_DISPATCH, OSSL_DISPATCH_END β the OpenSSL Core type that defines a dispatchable function table. that's it, that's the whole vibe. π
πΈ SYNOPSIS πΈ
#include <openssl/core.h>
typedef struct ossl_dispatch_st OSSL_DISPATCH;
struct ossl_dispatch_st {
int function_id;
void (*function)(void);
};
#define OSSL_DISPATCH_END
look at her. tiny struct, big responsibilities. π
π¦ DESCRIPTION π¦
so OSSL_DISPATCH is a tuple β a little buddy-pair β of a function identity and a function pointer. that's the whole concept, no cap.
arrays of this type get passed back and forth between the OpenSSL libraries and the providers, and their whole job is describing what functionality one side is handing over to the other side. it's basically a friendship bracelet but make it function pointers. π
β οΈ real talk: arrays of this type must be terminated with the OSSL_DISPATCH_END macro. do not forget the ender. the ender is not optional, bestie, it's the periodt of the whole array.
π OSSL_DISPATCH fields π
okay let's meet the two fields one by one, because there's only two and they both matter:
function_idβ the OpenSSL-defined function identity of the function you implemented. this is the name-tag basically. π·οΈfunctionβ a pointer to the implemented function itself. and here's the tea: even though this field is declared all generic andvoid (*)(void)-coded, the function it points to must actually have a function signature that corresponds to thefunction_id. the declaration is lying to you a little bit (affectionately) and it's on you to make the signature match. π
the available function identities and their corresponding function signatures live in openssl-core_dispatch.h(7). go read that, it's the guest list. π
and more: the function identities you pick, plus the associated function signature, must be chosen specifically for the operation you intend them for β and what operation that is gets determined by the intended OSSL_ALGORITHM(3) array. so it's not a free-for-all, it's a coordinated fit. β¨
π also iconic behaviour: any function identity that the recipient of this type doesn't recognise gets ignored. that's on purpose!! it's the whole reason a provider built with one OpenSSL version in mind can still work together with any other OpenSSL version that supports this mechanism. backwards-compatible queen. π
π SEE ALSO π
go click around, it's all connected, it's a whole ecosystem fr fr. π§
π HISTORY π
OSSL_DISPATCH was added in OpenSSL 3.0. so she's a 3.0 baby. born iconic, raised correct. π
π COPYRIGHT π
Copyright 2022-2023 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>.
okay that's the whole page, bestie, you ate it. π«Ά this was OpenSSL 3.5.9, dated 2026-09-29 β so when you're citing this in your group chat, that's the version and that's the date. slay, bye πβ¨
π¦ 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