LIBRESSL-X509_STORE_SET_VERIFY_CB_FUNC(3)

πŸ“¦ version 4.4.0, in alpine 3.24, arch rolling

πŸ¦‹ NAME πŸ¦‹

X509_STORE_set_verify_cb, X509_STORE_set_verify_cb_func, and X509_STORE_get_verify_cb β€” the little trio for setting and getting the verification callback, bestie. This is the X509_STORE_SET_VERIFY_CB(3) page from the Library Functions Manual, and it lives in libcrypto. Periodt.


🌈 SYNOPSIS 🌈

okay so first, library:

library β€œlibcrypto” #include <openssl/x509_vfy.h>

void
X509_STORE_set_verify_cb(X509_STORE *st,
    X509_STORE_CTX_verify_cb verify_cb);

void
X509_STORE_set_verify_cb_func(X509_STORE *st,
    X509_STORE_CTX_verify_cb verify_cb);

X509_STORE_CTX_verify_cb
X509_STORE_get_verify_cb(X509_STORE *st);

πŸ’… DESCRIPTION πŸ’…

So X509_STORE_set_verify_cb() sets the verification callback of ctx to verify_cb, and it overwrites any existing callback β€” no stacking, no collecting them like PokΓ©mon, just a clean swap. (The page says ctx right there; I’m keeping the lore exactly as written 🫢.)

X509_STORE_set_verify_cb_func() also sets the verification callback, but plot twist: it is implemented as a macro. ✨

The verification callback from an X509_STORE gets inherited by the corresponding X509_STORE_CTX structure when it is initialized. That’s lowkey the useful part: it lets you set the verification callback when the X509_STORE_CTX is otherwise inaccessible β€” for example during S/MIME verification. Iykyk.


πŸŽ€ RETURN VALUES πŸŽ€

X509_STORE_get_verify_cb() returns the function pointer set with X509_STORE_set_verify_cb(), or NULL if that function was not called on st. That’s it, bestie β€” no hidden drama.


πŸ”₯ SEE ALSO πŸ”₯


πŸ‘‘ HISTORY πŸ‘‘

  • X509_STORE_set_verify_cb_func() first appeared in SSLeay 0.8.0 and has been available since OpenBSD 2.4.
  • X509_STORE_set_verify_cb() first appeared in OpenSSL 1.0.0 and has been available since OpenBSD 4.9.
  • X509_STORE_get_verify_cb() first appeared in OpenSSL 1.1.0 and has been available since OpenBSD 7.2.

okay that’s the whole page, bestie πŸ’– This ✨ Debian ✨ edition of X509_STORE_SET_VERIFY_CB_FUNC(3) is dated June 8, 2025 β€” mwah, slay, and goodbye πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from