William Lallemand | be21b66 | 2020-05-12 14:17:23 +0200 | [diff] [blame] | 1 | /* |
| 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 | |
Willy Tarreau | 8d2b777 | 2020-05-27 10:58:19 +0200 | [diff] [blame] | 26 | #include <import/ebmbtree.h> |
William Lallemand | c1c50b4 | 2020-05-13 08:24:41 +0200 | [diff] [blame] | 27 | |
Willy Tarreau | 853b297 | 2020-05-27 18:01:47 +0200 | [diff] [blame] | 28 | #include <haproxy/list-t.h> |
William Lallemand | be21b66 | 2020-05-12 14:17:23 +0200 | [diff] [blame] | 29 | |
William Lallemand | c1c50b4 | 2020-05-13 08:24:41 +0200 | [diff] [blame] | 30 | /* forward declarations for structures below */ |
| 31 | struct bind_conf; |
| 32 | struct ssl_bind_conf; |
| 33 | struct proxy; |
William Lallemand | be21b66 | 2020-05-12 14:17:23 +0200 | [diff] [blame] | 34 | |
| 35 | /* list of bind conf used by struct crtlist */ |
| 36 | struct bind_conf_list { |
| 37 | struct bind_conf *bind_conf; |
| 38 | struct bind_conf_list *next; |
| 39 | }; |
| 40 | |
| 41 | /* This structure is basically a crt-list or a directory */ |
| 42 | struct crtlist { |
| 43 | struct bind_conf_list *bind_conf; /* list of bind_conf which use this crtlist */ |
| 44 | unsigned int linecount; /* number of lines */ |
| 45 | struct eb_root entries; |
| 46 | struct list ord_entries; /* list to keep the line order of the crt-list file */ |
| 47 | struct ebmb_node node; /* key is the filename or directory */ |
| 48 | }; |
| 49 | |
| 50 | /* a file in a directory or a line in a crt-list */ |
| 51 | struct crtlist_entry { |
| 52 | struct ssl_bind_conf *ssl_conf; /* SSL conf in crt-list */ |
| 53 | unsigned int linenum; |
| 54 | unsigned int fcount; /* filters count */ |
| 55 | char **filters; |
| 56 | struct crtlist *crtlist; /* ptr to the parent crtlist */ |
| 57 | struct list ckch_inst; /* list of instances of this entry, there is 1 ckch_inst per instance of the crt-list */ |
| 58 | struct list by_crtlist; /* ordered entries */ |
| 59 | struct list by_ckch_store; /* linked in ckch_store list of crtlist_entries */ |
| 60 | struct ebpt_node node; /* key is a ptr to a ckch_store */ |
| 61 | }; |
| 62 | |
| 63 | #endif /* USE_OPENSSL */ |
| 64 | #endif /* _TYPES_SSL_CRTLIST_H */ |