From: William Lallemand Date: Mon, 30 Mar 2020 17:59:57 +0000 (+0200) Subject: MINOR: ssl: store a ptr to crtlist in crtlist_entry X-Git-Tag: v2.2-dev6~65 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fa8cf0c476259407cae97b15aa02e0e61550668f;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/include/types/ssl_sock.h b/include/types/ssl_sock.h index 9f3e93a6d0..f3d851d233 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 39e63151e4..d6f8e67725 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;