From fa8cf0c476259407cae97b15aa02e0e61550668f Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Mon, 30 Mar 2020 19:59:57 +0200 Subject: [PATCH] MINOR: ssl: store a ptr to crtlist in crtlist_entry 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 | 1 + src/ssl_sock.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/types/ssl_sock.h b/include/types/ssl_sock.h index 9f3e93a..f3d851d 100644 --- a/include/types/ssl_sock.h +++ b/include/types/ssl_sock.h @@ -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 */ diff --git a/src/ssl_sock.c b/src/ssl_sock.c index 39e6315..d6f8e67 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -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; -- 1.7.10.4