syslog-ng source
tls-verifier.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2002-2013 Balabit
3  * Copyright (c) 1998-2011 Balázs Scheidler
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library 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 GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * As an additional exemption you are allowed to compile & link against the
20  * OpenSSL libraries as published by the OpenSSL project. See the file
21  * COPYING for details.
22  */
23 
24 #ifndef TRANSPORT_TLS_VERIFIER_H_INCLUDED
25 #define TRANSPORT_TLS_VERIFIER_H_INCLUDED
26 
27 #include "syslog-ng.h"
28 #include "atomic.h"
29 #include <openssl/ssl.h>
30 
31 typedef gint (*TLSSessionVerifyFunc)(gint ok, X509_STORE_CTX *ctx, gpointer user_data);
32 typedef struct _TLSVerifier
33 {
36  gpointer verify_data;
37  GDestroyNotify verify_data_destroy;
38 } TLSVerifier;
39 
40 TLSVerifier *tls_verifier_new(TLSSessionVerifyFunc verify_func, gpointer verify_data,
41  GDestroyNotify verify_data_destroy);
44 
45 gboolean tls_verify_certificate_name(X509 *cert, const gchar *hostname);
46 
47 gboolean tls_wildcard_match(const gchar *host_name, const gchar *pattern);
48 
49 
50 #endif
Definition: atomic.h:31
Definition: tls-verifier.h:33
TLSSessionVerifyFunc verify_func
Definition: tls-verifier.h:35
gpointer verify_data
Definition: tls-verifier.h:36
GDestroyNotify verify_data_destroy
Definition: tls-verifier.h:37
GAtomicCounter ref_cnt
Definition: tls-verifier.h:34
gint(* TLSSessionVerifyFunc)(gint ok, X509_STORE_CTX *ctx, gpointer user_data)
Definition: tls-verifier.h:31
gboolean tls_wildcard_match(const gchar *host_name, const gchar *pattern)
Definition: tls-verifier.c:81
TLSVerifier * tls_verifier_new(TLSSessionVerifyFunc verify_func, gpointer verify_data, GDestroyNotify verify_data_destroy)
Definition: tls-verifier.c:33
TLSVerifier * tls_verifier_ref(TLSVerifier *self)
Definition: tls-verifier.c:46
void tls_verifier_unref(TLSVerifier *self)
Definition: tls-verifier.c:70
gboolean tls_verify_certificate_name(X509 *cert, const gchar *hostname)
Definition: tls-verifier.c:176