OSSL_SELF_TEST_SET_CALLBACK(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’… OSSL_SELF_TEST_SET_CALLBACK πŸ’…

okay so bestie, welcome to the 3ossl girlies' corner of the OpenSSL manual β€” yes this is the OpenSSL docs, and yes we're about to make self-test callbacks make sense. strap in πŸŽ€


✨ NAME ✨

OSSL_SELF_TEST_set_callback, OSSL_SELF_TEST_get_callback β€” these two are literally the "hey bestie, here's a callback for processing self tests" functions. one sets it, one gets it. iconic duo fr fr 🫢


🌸 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);

like, copy-paste that include and you're in business πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so basically these two set or get the optional application callback (plus the callback argument, cbarg) that gets called while self testing is happening. the way it works is the application callback OSSL_CALLBACK(3) is associated with an OSSL_LIB_CTX. 🫢

and what does that callback actually do? it receives information about a running self test, and it may return a result to the calling self test. that's the whole vibe. if you want the full lore on the callback itself, go read openssl-core.h(7) β€” it's giving required reading, ngl πŸ‘‘


⭐ RETURN VALUES ⭐

OSSL_SELF_TEST_get_callback() hands you back the callback and the callback argument that were set via OSSL_SELF_TEST_set_callback() for the given library context ctx. πŸŽ€

heads up: those returned parameters will be NULL if OSSL_SELF_TEST_set_callback() has not been called. so if you're seeing NULLs, it's not a bug, it's just nobody set anything yet. no cap πŸ’€

🌈 SEE ALSO 🌈

go touch grass in these other pages, they're all linked besties:


πŸ’œ HISTORY πŸ’œ

these functions described here were added in OpenSSL 3.0. so they're not ancient, they're fresh ✨


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>.


and that's the whole page, bestie πŸ“ this was OpenSSL 3.5.0, dated 2026-09-25 β€” mwah, go forth and callback responsibly πŸ§šπŸ’–

πŸ“¦ where this page comes from