Minor HELP output fixes.
[pwmd.git] / src / tls.h
blobc445f24fe570b9e342471e8c29013ba4b7a7a172
1 /*
2 Copyright (C) 2008 Ben Kibbey <bjk@luxsci.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02110-1301 USA
18 #ifndef TLS_H
19 #define TLS_H
21 #include <gnutls/gnutls.h>
22 #include <errno.h>
24 struct tls_s {
25 gnutls_session_t ses;
26 char *fp;
29 struct client_s;
31 gnutls_dh_params_t dh_params;
32 gnutls_rsa_params_t rsa_params;
33 gnutls_certificate_credentials_t x509_cred;
35 struct tls_s *tls_init(int fd, const char *prio);
36 int tls_get_params(gnutls_session_t ses, gnutls_params_type_t type,
37 gnutls_params_st *st);
38 void tls_log(int level, const char *msg);
39 ssize_t tls_read_hook(assuan_context_t ctx, assuan_fd_t fd, void *data,
40 size_t len);
41 ssize_t tls_write_hook(assuan_context_t ctx, assuan_fd_t fd, const void *data,
42 size_t len);
43 void tls_deinit_params();
44 gpg_error_t tls_init_params();
45 gpg_error_t tls_validate_access(struct client_s *client, const char *filename);
47 #endif