Fix for commit a7e15f9.
[pwmd.git] / src / tls.h
bloba5fbb4600fb2f1a4111603eb6d9798b7ef0df88d
1 /* vim:tw=78:ts=8:sw=4:set ft=c: */
2 /*
3 Copyright (C) 2008 Ben Kibbey <bjk@luxsci.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program 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 this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02110-1301 USA
19 #ifndef TLS_H
20 #define TLS_H
22 #include <gnutls/gnutls.h>
23 #include <errno.h>
25 struct tls_s {
26 gnutls_session_t ses;
27 gchar *fp;
30 gnutls_dh_params_t dh_params;
31 gnutls_rsa_params_t rsa_params;
32 gnutls_certificate_credentials_t x509_cred;
34 struct tls_s *tls_init(gint fd, const gchar *prio);
35 gint tls_get_params(gnutls_session_t ses, gnutls_params_type_t type,
36 gnutls_params_st *st);
37 void tls_log(gint level, const char *msg);
38 int read_hook(assuan_context_t ctx, assuan_fd_t fd, void *data,
39 size_t len, ssize_t *ret);
40 int write_hook(assuan_context_t ctx, assuan_fd_t fd, const void *data,
41 size_t len, ssize_t *ret);
43 #endif