]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl: store a ptr to crtlist in crtlist_entry
authorWilliam Lallemand <wlallemand@haproxy.com>
Mon, 30 Mar 2020 17:59:57 +0000 (19:59 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 31 Mar 2020 10:32:17 +0000 (12:32 +0200)
Store a pointer to crtlist in crtlist_entry so we can re-insert a
crtlist_entry in its crtlist ebpt after updating its key.

include/types/ssl_sock.h
src/ssl_sock.c

index 9f3e93a6d088b2b62b4da3fd134b0e6eb183fcef..f3d851d233bd4333b5a97704de854dbb8cb6d0f9 100644 (file)
@@ -167,6 +167,7 @@ struct crtlist_entry {
        unsigned int linenum;
        unsigned int fcount; /* filters count */
        char **filters;
+       struct crtlist *crtlist; /* ptr to the parent crtlist */
        struct list ckch_inst; /* list of instances of this entry, there is 1 ckch_inst per instance of the crt-list */
        struct list by_crtlist; /* ordered entries */
        struct list by_ckch_store; /* linked in ckch_store list of crtlist_entries */
index 39e63151e4bf8f85f36da03209a11906bd99af31..d6f8e677257259005977e3bcd503748761e8e5b1 100644 (file)
@@ -4645,6 +4645,7 @@ static int crtlist_load_cert_dir(char *path, struct bind_conf *bind_conf, struct
                                                goto end;
                                        }
                                        entry->node.key = ckchs;
+                                       entry->crtlist = dir;
                                        LIST_ADDQ(&ckchs->crtlist_entry, &entry->by_ckch_store);
                                        LIST_ADDQ(&dir->ord_entries, &entry->by_crtlist);
                                        ebpt_insert(&dir->entries, &entry->node);
@@ -4665,6 +4666,7 @@ static int crtlist_load_cert_dir(char *path, struct bind_conf *bind_conf, struct
                                goto end;
                        }
                        entry->node.key = ckchs;
+                       entry->crtlist = dir;
                        LIST_ADDQ(&ckchs->crtlist_entry, &entry->by_ckch_store);
                        LIST_ADDQ(&dir->ord_entries, &entry->by_crtlist);
                        ebpt_insert(&dir->entries, &entry->node);
@@ -4859,6 +4861,7 @@ static int crtlist_parse_file(char *file, struct bind_conf *bind_conf, struct pr
                }
                entry->node.key = ckchs;
                entry->ssl_conf = ssl_conf;
+               entry->crtlist = newlist;
                /* filters */
                entry->filters = crtlist_dup_filters(&args[cur_arg], arg - cur_arg - 1);
                entry->fcount = arg - cur_arg - 1;