1gnutls_srp_set_server_credentials_gfnuungtcnltusit_olsnsr(p3_)set_server_credentials_function(3)
2
3
4
6 gnutls_srp_set_server_credentials_function - API function
7
9 #include <gnutls/gnutls.h>
10
11 void gnutls_srp_set_server_credentials_function(gnutls_srp_server_cre‐
12 dentials_t cred, gnutls_srp_server_credentials_function
13 * func);
14
16 gnutls_srp_server_credentials_t cred
17 is a gnutls_srp_server_credentials_t type.
18
19 gnutls_srp_server_credentials_function * func
20 is the callback function
21
23 This function can be used to set a callback to retrieve the user's SRP
24 credentials. The callback's function form is:
25
26 int (*callback)(gnutls_session_t, const char* username, gnutls_datum_t
27 *salt, gnutls_datum_t *verifier, gnutls_datum_t *generator, gnutls_da‐
28 tum_t *prime);
29
30 username contains the actual username. The salt , verifier , gen‐
31 erator and prime must be filled in using the gnutls_malloc(). For con‐
32 venience prime and generator may also be one of the static parameters
33 defined in gnutls.h.
34
35 Initially, the data field is NULL in every gnutls_datum_t structure
36 that the callback has to fill in. When the callback is done GnuTLS de‐
37 allocates all of those buffers which are non-NULL, regardless of the
38 return value.
39
40 In order to prevent attackers from guessing valid usernames, if a user
41 does not exist, g and n values should be filled in using a random
42 user's parameters. In that case the callback must return the special
43 value (1). See gnutls_srp_set_server_fake_salt_seed too. If this is
44 not required for your application, return a negative number from the
45 callback to abort the handshake.
46
47 The callback function will only be called once per handshake. The
48 callback function should return 0 on success, while -1 indicates an er‐
49 ror.
50
52 Report bugs to <bugs@gnutls.org>.
53 Home page: https://www.gnutls.org
54
55
57 Copyright © 2001- Free Software Foundation, Inc., and others.
58 Copying and distribution of this file, with or without modification,
59 are permitted in any medium without royalty provided the copyright no‐
60 tice and this notice are preserved.
61
63 The full documentation for gnutls is maintained as a Texinfo manual.
64 If the /usr/share/doc/gnutls/ directory does not contain the HTML form
65 visit
66
67 https://www.gnutls.org/manual/
68
69gnutls gnut3l.s7_.s2rp_set_server_credentials_function(3)