1 .\" DO NOT MODIFY THIS FILE! It was generated by gdoc.
2 .TH "gnutls_srp_set_server_credentials_function" 3 "2.12.6.1" "gnutls" "gnutls"
4 gnutls_srp_set_server_credentials_function \- API function
6 .B #include <gnutls/gnutls.h>
8 .BI "void gnutls_srp_set_server_credentials_function(gnutls_srp_server_credentials_t " cred ", gnutls_srp_server_credentials_function * " func ");"
10 .IP "gnutls_srp_server_credentials_t cred" 12
11 is a \fBgnutls_srp_server_credentials_t\fP structure.
12 .IP "gnutls_srp_server_credentials_function * func" 12
13 is the callback function
15 This function can be used to set a callback to retrieve the user's
16 SRP credentials. The callback's function form is:
18 int (*callback)(gnutls_session_t, const char* username,
19 gnutls_datum_t* salt, gnutls_datum_t *verifier, gnutls_datum_t* g,
22 \fIusername\fP contains the actual username.
23 The \fIsalt\fP, \fIverifier\fP, \fIgenerator\fP and \fIprime\fP must be filled
24 in using the \fBgnutls_malloc()\fP. For convenience \fIprime\fP and \fIgenerator\fP
25 may also be one of the static parameters defined in extra.h.
27 In case the callback returned a negative number then gnutls will
28 assume that the username does not exist.
30 In order to prevent attackers from guessing valid usernames,
31 if a user does not exist, g and n values should be filled in
32 using a random user's parameters. In that case the callback must
33 return the special value (1).
35 The callback function will only be called once per handshake.
36 The callback function should return 0 on success, while
37 \-1 indicates an error.
39 Report bugs to <bug-gnutls@gnu.org>.
40 GnuTLS home page: http://www.gnu.org/software/gnutls/
41 General help using GNU software: http://www.gnu.org/gethelp/
43 Copyright \(co 2008 Free Software Foundation.
45 Copying and distribution of this file, with or without modification,
46 are permitted in any medium without royalty provided the copyright
47 notice and this notice are preserved.
49 The full documentation for
51 is maintained as a Texinfo manual. If the
55 programs are properly installed at your site, the command
59 should give you access to the complete manual.