mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-05-05 20:44:38 +02:00
Document wolfSSL_CTX_set_default_passwd_cb and wolfSSL_CTX_set_default_passwd_cb_userdata.
Fixes #6008.
This commit is contained in:
@@ -15936,3 +15936,51 @@ WOLFSSL_CIPHERSUITE_INFO wolfSSL_get_ciphersuite_info(byte first,
|
||||
*/
|
||||
int wolfSSL_get_sigalg_info(byte first, byte second,
|
||||
int* hashAlgo, int* sigAlgo);
|
||||
|
||||
/*!
|
||||
\brief This function will set the password callback in the provided CTX.
|
||||
This callback is used when loading an encrypted cert or key which requires
|
||||
a password.
|
||||
|
||||
\param ctx a pointer to a WOLFSSL_CTX structure, created with
|
||||
wolfSSL_CTX_new().
|
||||
\param cb a function pointer to (*wc_pem_password_cb) that is set to the
|
||||
passwd_cb member of the WOLFSSL_CTX.
|
||||
|
||||
_Example_
|
||||
\code
|
||||
WOLFSSL_CTX* ctx = wolfSSL_CTX_new( protocol method );
|
||||
int PasswordCallBack(char* passwd, int sz, int rw, void* userdata) {
|
||||
|
||||
}
|
||||
…
|
||||
wolfSSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack);
|
||||
\endcode
|
||||
|
||||
\sa wolfSSL_CTX_set_default_passwd_cb_userdata
|
||||
*/
|
||||
void wolfSSL_CTX_set_default_passwd_cb(WOLFSSL_CTX* ctx,
|
||||
wc_pem_password_cb* cb);
|
||||
|
||||
/*!
|
||||
\brief This function will set the userdata argument to the passwd_userdata
|
||||
member of the WOLFSSL_CTX structure.
|
||||
This member is passed into the CTX's password callback when called.
|
||||
|
||||
\param ctx a pointer to a WOLFSSL_CTX structure, created with
|
||||
wolfSSL_CTX_new().
|
||||
\param userdata a pointer to userdata which is passed into the
|
||||
password callback.
|
||||
|
||||
_Example_
|
||||
\code
|
||||
WOLFSSL_CTX* ctx = wolfSSL_CTX_new( protocol method );
|
||||
int data;
|
||||
…
|
||||
wolfSSL_CTX_set_default_passwd_cb_userdata(ctx, (void*)&data);
|
||||
\endcode
|
||||
|
||||
\sa wolfSSL_CTX_set_default_passwd_cb
|
||||
*/
|
||||
void wolfSSL_CTX_set_default_passwd_cb_userdata(WOLFSSL_CTX* ctx,
|
||||
void* userdata);
|
||||
Reference in New Issue
Block a user