1gnutls_srp_set_server_credentials_gfnuungtcnltusit_olsnsr(p3_)set_server_credentials_function(3)
2
3
4

NAME

6       gnutls_srp_set_server_credentials_function - API function
7

SYNOPSIS

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 * func);
13

ARGUMENTS

15       gnutls_srp_server_credentials_t cred
16                   is a gnutls_srp_server_credentials_t type.
17
18       gnutls_srp_server_credentials_function * func
19                   is the callback function
20

DESCRIPTION

22       This function can be used to set a callback to retrieve the user's  SRP
23       credentials.  The callback's function form is:
24
25       int  (*callback)(gnutls_session_t, const char* username, gnutls_datum_t
26       *salt, gnutls_datum_t *verifier, gnutls_datum_t *generator,  gnutls_da‐
27       tum_t *prime);
28
29        username  contains the actual username.  The  salt ,  verifier ,  gen‐
30       erator and  prime must be filled in using the gnutls_malloc(). For con‐
31       venience  prime and  generator may also be one of the static parameters
32       defined in gnutls.h.
33
34       Initially, the data field is NULL  in  every  gnutls_datum_t  structure
35       that  the callback has to fill in. When the callback is done GnuTLS de‐
36       allocates all of those buffers which are non-NULL,  regardless  of  the
37       return value.
38
39       In  order to prevent attackers from guessing valid usernames, if a user
40       does not exist, g and n values should  be  filled  in  using  a  random
41       user's  parameters.  In  that case the callback must return the special
42       value (1).  See gnutls_srp_set_server_fake_salt_seed too.  If  this  is
43       not  required  for  your application, return a negative number from the
44       callback to abort the handshake.
45
46       The callback function will only be  called  once  per  handshake.   The
47       callback function should return 0 on success, while -1 indicates an er‐
48       ror.
49

REPORTING BUGS

51       Report bugs to <bugs@gnutls.org>.
52       Home page: https://www.gnutls.org
53
54
56       Copyright © 2001-2023 Free Software Foundation, Inc., and others.
57       Copying and distribution of this file, with  or  without  modification,
58       are  permitted in any medium without royalty provided the copyright no‐
59       tice and this notice are preserved.
60

SEE ALSO

62       The full documentation for gnutls is maintained as  a  Texinfo  manual.
63       If  the /usr/share/doc/gnutls/ directory does not contain the HTML form
64       visit
65
66       https://www.gnutls.org/manual/
67
68gnutls                           gnut3l.s8_.s2rp_set_server_credentials_function(3)
Impressum