OSSL_DISPATCH(3SSL)
π OSSL_DISPATCH β bestie, it's the OpenSSL dispatch table π
okay so this is OSSL_DISPATCH from the OpenSSL manual (section 3SSL), and also OSSL_DISPATCH_END which is its ride-or-die macro. Sit down, grab a strawberry π, we're gonna talk about function tables.
β¨ NAME β¨
OSSL_DISPATCH, OSSL_DISPATCH_END β the OpenSSL Core type that defines a dispatchable function table π«Ά
β¨ 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
β¨ DESCRIPTION β¨
so this type is literally a little duo: a function identity paired with a function pointer. that's the whole vibe. it's giving "who are you and what do you do" π
Arrays of this type get passed back and forth between the OpenSSL libraries and the providers to describe what functionality one side is handing over to the other. it's the group chat where everybody says what they bring to the party π
β οΈ important!! Arrays of this type must be terminated with the OSSL_DISPATCH_END macro. no cap. don't leave it hanging bestie, that's how you get chaos.
πΈ OSSL_DISPATCH fields πΈ
function_idβ the OpenSSL-defined function identity of the function you implemented. this is the "name tag" energy β¨functionβ a pointer to the implemented function itself. and here's the tea: even though this field is defined generically, the function it points to must have a function signature that matches thefunction_id. the generic look is a costume, bestie, the real signature has to fit π₯
Available function identities and their corresponding function signatures are defined in openssl-core_dispatch.h(7). and listen β the function identities you pick and the function signature that goes with them have to be chosen specifically for the operation they're intended for, as determined by the intended OSSL_ALGORITHM(3) array. it's not mix-and-match, it's a matching set π¦
Any function identity that the recipient of this type doesn't recognise will be ignored. and that's actually iconic, not a bug β it means providers built with one OpenSSL version in mind will work together with any other OpenSSL version that supports this mechanism. forward compat, we love to see it π
β¨ SEE ALSO β¨
β¨ HISTORY β¨
OSSL_DISPATCH was added in OpenSSL 3.0. she's a 3.0 girlie π
β¨ 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, go forth and dispatch πβ¨
mwah π this was OpenSSL 4.0.3, dated 2026-09-29 β stay iconic, drink water, terminate your arrays π«Ά
π¦ 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