Tizen 2.0 Release
[external/libgnutls26.git] / doc / manpages / gnutls_srp_set_server_credentials_function.3
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"
3 .SH NAME
4 gnutls_srp_set_server_credentials_function \- API function
5 .SH SYNOPSIS
6 .B #include <gnutls/gnutls.h>
7 .sp
8 .BI "void gnutls_srp_set_server_credentials_function(gnutls_srp_server_credentials_t                                             " cred ", gnutls_srp_server_credentials_function                                             * " func ");"
9 .SH ARGUMENTS
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
14 .SH "DESCRIPTION"
15 This function can be used to set a callback to retrieve the user's
16 SRP credentials.  The callback's function form is:
17
18 int (*callback)(gnutls_session_t, const char* username,
19 gnutls_datum_t* salt, gnutls_datum_t *verifier, gnutls_datum_t* g,
20 gnutls_datum_t* n);
21
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.
26
27 In case the callback returned a negative number then gnutls will
28 assume that the username does not exist.
29
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).
34
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.
38 .SH "REPORTING BUGS"
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/
42 .SH COPYRIGHT
43 Copyright \(co 2008 Free Software Foundation.
44 .br
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.
48 .SH "SEE ALSO"
49 The full documentation for
50 .B gnutls
51 is maintained as a Texinfo manual.  If the
52 .B info
53 and
54 .B gnutls
55 programs are properly installed at your site, the command
56 .IP
57 .B info gnutls
58 .PP
59 should give you access to the complete manual.