Sortix cross-nightly manual
This manual documents Sortix cross-nightly. You can instead view this document in the latest official manual.
NAME
SSL_CTX_set_default_passwd_cb, SSL_CTX_set_default_passwd_cb_userdata, SSL_CTX_get_default_passwd_cb, SSL_CTX_get_default_passwd_cb_userdata — set or get passwd callback for encrypted PEM file handlingSYNOPSIS
#include <openssl/ssl.h>SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb);
SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, void *userdata);
SSL_CTX_get_default_passwd_cb(SSL_CTX *ctx);
SSL_CTX_get_default_passwd_cb_userdata(SSL_CTX *ctx);
DESCRIPTION
SSL_CTX_set_default_passwd_cb() sets the password callback for loading a certificate or private key from encrypted PEM format. In particular, the callback is used by SSL_CTX_use_certificate_file(3), SSL_use_certificate_file(3), SSL_CTX_use_certificate_chain_file(3), SSL_use_certificate_chain_file(3), SSL_CTX_use_certificate_chain_mem(3), SSL_CTX_use_PrivateKey_file(3), SSL_use_PrivateKey_file(3), SSL_CTX_use_RSAPrivateKey_file(3), and SSL_use_RSAPrivateKey_file(3).RETURN VALUES
SSL_CTX_get_default_passwd_cb() returns a function pointer to the password callback currently set in ctx, or NULL if none is set.EXAMPLES
The following example provides a subset of the functionality of PEM_def_callback(3), except that PEM_def_callback(3) does not NUL-terminate and copies up to size rather than size- 1
bytes. It interprets userdata as a NUL-terminated string and copies it to the password buffer, truncating the copy if it does not fit.int trivial_passwd_cb(char *password, int size, int verify, void *userdata) { strlcpy(password, userdata, size); return strlen(password); }