OSSL_SELF_TEST_SET_CALLBACK(3ossl)

πŸ“¦
version 15.1 Β· 3 versions
, in freebsd 15.1

πŸ’… OSSL_SELF_TEST_SET_CALLBACK(3ossl) β€” like, the OpenSSL manual, bestie

okay so this is the OSSL_SELF_TEST_set_callback / OSSL_SELF_TEST_get_callback page from the OpenSSL manual. yes it's a real thing, yes it's giving "security-critical infrastructure", and yes we're gonna make it make sense 🫢


✨ NAME ✨

OSSL_SELF_TEST_set_callback, OSSL_SELF_TEST_get_callback β€” specify a callback for processing self tests πŸŽ€


🌸 SYNOPSIS 🌸

#include <openssl/self_test.h>

void OSSL_SELF_TEST_set_callback(OSSL_LIB_CTX *ctx, OSSL_CALLBACK *cb, void *cbarg);
void OSSL_SELF_TEST_get_callback(OSSL_LIB_CTX *ctx, OSSL_CALLBACK **cb, void **cbarg);

literally just two functions, both void, both vibing. no cap πŸ’œ


πŸ¦‹ DESCRIPTION πŸ¦‹

so picture this: you're setting or getting the optional application callback (plus the callback argument that goes with it) β€” the one that gets called during self testing. that's the whole gig ✨

the application callback OSSL_CALLBACK(3) is associated with a OSSL_LIB_CTX β€” like, each library context has its own callback situation going on, and that's the main character energy right there πŸ‘‘

the application callback function receives information about a running self test, and it may return a result to the calling self test. so it's not just listening β€” it's got opinions and it can talk back πŸ’…

for further info on the callback itself, see openssl-core.h(7). iykyk 🧚


πŸ”₯ RETURN VALUES πŸ”₯

OSSL_SELF_TEST_get_callback() returns the callback and callback argument that has been set via OSSL_SELF_TEST_set_callback() for the given library context *ctx*.

and here's the vibe check: those returned parameters will be NULL if OSSL_SELF_TEST_set_callback() has not been called. no callback set, no callback returned. simple as that fr fr πŸ’€


🌈 SEE ALSO 🌈

go read the whole friend group, they're all connected πŸ“


⭐ HISTORY ⭐

the functions described here were added in OpenSSL 3.0. so if you're on something older β€” bestie, no you're not πŸ’–


Copyright 2019-2021 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>.


just a lil reminder bestie: that copyright + license line is not decorative β€” it's the actual legal text, so keep it intact when you pass this around πŸŽ€

and that's the page!! mwah πŸ’‹ β€” this was the OpenSSL 3.5.6 version, dated 2026-04-07. slay, go set some callbacks responsibly 🌸✨

πŸ“¦ where this page comes from