Update copyright year.
[pwmd.git] / src / tls.h
blob6406631eeecc3c2180eb5a8887c480513255e263
1 /*
2 Copyright (C) 2006-2019 Ben Kibbey <bjk@luxsci.net>
4 This file is part of pwmd.
6 Pwmd is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 2 of the License, or
9 (at your option) any later version.
11 Pwmd is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Pwmd. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef TLS_H
20 #define TLS_H
22 #include <gnutls/gnutls.h>
23 #include <errno.h>
25 struct tls_s
27 gnutls_session_t ses;
28 char *fp;
29 int nl;
30 int rehandshake;
33 int tls_fd;
34 int tls6_fd;
36 struct client_s;
37 int tls_start_stop (int term);
38 struct tls_s *tls_init_client (int fd, int timeout, const char *prio);
39 void tls_log (int level, const char *msg);
40 void tls_audit_log (gnutls_session_t, const char *);
41 ssize_t tls_read_hook (assuan_context_t ctx, assuan_fd_t fd, void *data,
42 size_t len);
43 ssize_t tls_write_hook (assuan_context_t ctx, assuan_fd_t fd,
44 const void *data, size_t len);
45 void tls_deinit_params ();
46 gpg_error_t tls_validate_access (struct client_s *client, const char *filename);
47 void tls_rehandshake ();
49 #endif