blob: bcece4ecfa18054c989b9f693de92725cf737df2 [file] [log] [blame]
William Lallemandbe21b662020-05-12 14:17:23 +02001/*
2 * include/types/ssl_crtlist.h
3 * crt-list structures
4 *
5 * Copyright (C) 2020 HAProxy Technologies, William Lallemand <wlallemand@haproxy.com>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation, version 2.1
10 * exclusively.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef _TYPES_SSL_CRTLIST_H
23#define _TYPES_SSL_CRTLIST_H
24#ifdef USE_OPENSSL
25
26#include <common/mini-clist.h>
27
28#include <types/listener.h>
29
30/* list of bind conf used by struct crtlist */
31struct bind_conf_list {
32 struct bind_conf *bind_conf;
33 struct bind_conf_list *next;
34};
35
36/* This structure is basically a crt-list or a directory */
37struct crtlist {
38 struct bind_conf_list *bind_conf; /* list of bind_conf which use this crtlist */
39 unsigned int linecount; /* number of lines */
40 struct eb_root entries;
41 struct list ord_entries; /* list to keep the line order of the crt-list file */
42 struct ebmb_node node; /* key is the filename or directory */
43};
44
45/* a file in a directory or a line in a crt-list */
46struct crtlist_entry {
47 struct ssl_bind_conf *ssl_conf; /* SSL conf in crt-list */
48 unsigned int linenum;
49 unsigned int fcount; /* filters count */
50 char **filters;
51 struct crtlist *crtlist; /* ptr to the parent crtlist */
52 struct list ckch_inst; /* list of instances of this entry, there is 1 ckch_inst per instance of the crt-list */
53 struct list by_crtlist; /* ordered entries */
54 struct list by_ckch_store; /* linked in ckch_store list of crtlist_entries */
55 struct ebpt_node node; /* key is a ptr to a ckch_store */
56};
57
58#endif /* USE_OPENSSL */
59#endif /* _TYPES_SSL_CRTLIST_H */