summaryrefslogtreecommitdiff
path: root/libextra/auth_srp.h
blob: 7b42f0229f5c01cc49ae3eb712452e3a04ba16b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef AUTH_SRP_H
# define AUTH_SRP_H

#include <gnutls_auth.h>


typedef int gnutls_srp_server_credentials_function(gnutls_session,
						   char *username,
						   gnutls_datum * salt,
						   gnutls_datum * verifier,
						   gnutls_datum *
						   generator,
						   gnutls_datum * prime);


typedef struct {
   char *username;
   char *password;
} SRP_CLIENT_CREDENTIALS_INT;

#define gnutls_srp_client_credentials SRP_CLIENT_CREDENTIALS_INT*

typedef struct {
   char **password_file;
   char **password_conf_file;
   int password_files;
   /* callback function, instead of reading the
    * password files.
    */
   gnutls_srp_server_credentials_function *pwd_callback;
} SRP_SERVER_CREDENTIALS_INT;

#define gnutls_srp_server_credentials SRP_SERVER_CREDENTIALS_INT*

/* these structures should not use allocated data */
typedef struct SRP_SERVER_AUTH_INFO_INT {
   char username[MAX_SRP_USERNAME];
} *SRP_SERVER_AUTH_INFO;

#ifdef ENABLE_SRP

int _gnutls_proc_srp_server_hello(gnutls_session state,
				  const opaque * data, size_t data_size);
int _gnutls_gen_srp_server_hello(gnutls_session state, opaque * data,
				 size_t data_size);

int _gnutls_gen_srp_server_kx(gnutls_session, opaque **);
int _gnutls_gen_srp_client_kx(gnutls_session, opaque **);

int _gnutls_proc_srp_server_kx(gnutls_session, opaque *, size_t);
int _gnutls_proc_srp_client_kx(gnutls_session, opaque *, size_t);

typedef struct SRP_SERVER_AUTH_INFO_INT SRP_SERVER_AUTH_INFO_INT;

#endif				/* ENABLE_SRP */

#endif