Update copyright year.
[pwmd.git] / src / tls.h
blob0d637703d1154ca27cd3416c10785575038b1e99
1 /*
2 Copyright (C) 2006-2022 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 version 2 as
8 published by the Free Software Foundation.
10 Pwmd is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with Pwmd. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef TLS_H
19 #define TLS_H
21 #include <gnutls/gnutls.h>
22 #include <errno.h>
24 struct tls_s
26 gnutls_session_t ses;
27 char *fp;
28 int nl;
29 int rehandshake;
32 extern int tls_fd;
33 extern int tls6_fd;
35 struct client_s;
36 int tls_start_stop (int term);
37 struct tls_s *tls_init_client (int fd, int timeout, const char *prio);
38 void tls_log (int level, const char *msg);
39 void tls_audit_log (gnutls_session_t, const char *);
40 ssize_t tls_read_hook (assuan_context_t ctx, assuan_fd_t fd, void *data,
41 size_t len);
42 ssize_t tls_write_hook (assuan_context_t ctx, assuan_fd_t fd,
43 const void *data, size_t len);
44 void tls_deinit_params ();
45 gpg_error_t tls_validate_access (struct client_s *client, const char *filename);
46 void tls_rehandshake ();
48 #endif