Blame doc/functions/gnutls_psk_set_server_credentials_function

Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
@deftypefun {void} {gnutls_psk_set_server_credentials_function} (gnutls_psk_server_credentials_t         @var{cred}, gnutls_psk_server_credentials_function         * @var{func})
Packit Service 4684c1
@var{cred}: is a @code{gnutls_psk_server_credentials_t}  type.
Packit Service 4684c1
Packit Service 4684c1
@var{func}: is the callback function
Packit Service 4684c1
Packit Service 4684c1
This function can be used to set a callback to retrieve the user's PSK credentials.
Packit Service 4684c1
The callback's function form is:
Packit Service 4684c1
int (*callback)(gnutls_session_t, const char* username,
Packit Service 4684c1
gnutls_datum_t* key);
Packit Service 4684c1
Packit Service 4684c1
 @code{username} contains the actual username.
Packit Service 4684c1
The  @code{key} must be filled in using the @code{gnutls_malloc()} .
Packit Service 4684c1
Packit Service 4684c1
In case the callback returned a negative number then gnutls will
Packit Service 4684c1
assume that the username does not exist.
Packit Service 4684c1
Packit Service 4684c1
The callback function will only be called once per handshake.  The
Packit Service 4684c1
callback function should return 0 on success, while -1 indicates
Packit Service 4684c1
an error.
Packit Service 4684c1
@end deftypefun