Corrected bugs in record parsing.
[gnutls.git] / lib / auth / srp.h
blobe2ef6d813c90393c95c9fbbcb57517fcd56d6f96
1 /*
2 * Copyright (C) 2001-2012 Free Software Foundation, Inc.
4 * Author: Nikos Mavrogiannopoulos
6 * This file is part of GnuTLS.
8 * The GnuTLS is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 3 of
11 * the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>
23 #ifndef AUTH_SRP_H
24 #define AUTH_SRP_H
26 #include <gnutls_auth.h>
28 typedef struct gnutls_srp_client_credentials_st
30 char *username;
31 char *password;
32 gnutls_srp_client_credentials_function *get_function;
33 } srp_client_credentials_st;
35 typedef struct gnutls_srp_server_credentials_st
37 char *password_file;
38 char *password_conf_file;
39 /* callback function, instead of reading the
40 * password files.
42 gnutls_srp_server_credentials_function *pwd_callback;
43 } srp_server_cred_st;
45 /* these structures should not use allocated data */
46 typedef struct srp_server_auth_info_st
48 char username[MAX_USERNAME_SIZE + 1];
49 } *srp_server_auth_info_t;
51 #ifdef ENABLE_SRP
53 int _gnutls_proc_srp_server_hello (gnutls_session_t state,
54 const uint8_t * data, size_t data_size);
55 int _gnutls_gen_srp_server_hello (gnutls_session_t state, uint8_t * data,
56 size_t data_size);
58 int _gnutls_gen_srp_server_kx (gnutls_session_t, gnutls_buffer_st*);
59 int _gnutls_gen_srp_client_kx (gnutls_session_t, gnutls_buffer_st*);
61 int _gnutls_proc_srp_server_kx (gnutls_session_t, uint8_t *, size_t);
62 int _gnutls_proc_srp_client_kx (gnutls_session_t, uint8_t *, size_t);
64 typedef struct srp_server_auth_info_st srp_server_auth_info_st;
66 #endif /* ENABLE_SRP */
68 #endif