OSSL_DISPATCH(3ossl)

πŸ“¦ version 15.1, in freebsd 15.1

πŸ’– NAME πŸ’– β€” OSSL_DISPATCH(3ossl)

OSSL_DISPATCH and OSSL_DISPATCH_END are the OpenSSL Core type for defining a dispatchable function table, bestie. Yes, this is the OSSL_DISPATCH(3ossl) page, and we're gonna get into it. ✨

🌸 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 πŸ¦‹

This type is literally a tuple of function identity and function pointer. Arrays of this type get passed between the OpenSSL libraries and the providers to describe what functionality one side provides to the other. It's giving "here's my little menu of abilities" and honestly that's iconic. πŸ’…

Arrays of this type must be terminated with the OSSL_DISPATCH_END macro. No cap.

🚨 bestie warning: do not forget the OSSL_DISPATCH_END terminator. That ending is not optional.

πŸŽ€ OSSL_DISPATCH fields πŸŽ€

  • function_id β€” the OpenSSL defined function identity of the implemented function. This is the label that says what this function is.
  • function β€” a pointer to the implemented function itself. Even though this field has a generic definition, the implemented function it points to must have a function signature that corresponds to the function_id. Fr fr, the vibe has to match.

Available function identities and corresponding function signatures are defined in openssl-core_dispatch.h(7). Also, the chosen function identities and associated function signature must be chosen specifically for the operation that it's intended for, as determined by the intended OSSL_ALGORITHM(3) array.

Any function identity not recognised by the recipient of this type will be ignored. That's the whole slay: it ensures that providers built with one OpenSSL version in mind will work together with any other OpenSSL version that supports this mechanism. 🫢

πŸ‘€ SEE ALSO πŸ‘€

πŸ•°οΈ HISTORY πŸ•°οΈ

OSSL_DISPATCH was added in OpenSSL 3.0.

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. this was OpenSSL 3.5.6, dated 2026-04-07, signed OSSL_DISPATCH(3ossl) β€” mwah πŸ’‹πŸŽ€πŸŒˆ

πŸ“¦ where this page comes from