]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl: rename confusing ssl_bind_kws
authorWilliam Lallemand <wlallemand@haproxy.org>
Mon, 13 Feb 2023 09:58:13 +0000 (10:58 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Thu, 16 Feb 2023 15:03:45 +0000 (16:03 +0100)
The ssl_bind_kw structure is exclusively used for crt-list keyword, it
must be named otherwise to remove the confusion.

The structure was renamed ssl_crtlist_kws.

include/haproxy/listener-t.h
include/haproxy/ssl_sock.h
src/cfgparse-ssl.c
src/cfgparse.c
src/ssl_crtlist.c

index 899c8492474d969e302b8354449ffd1c05b59a7b..1fe25f59deee3e52306e90b90ef490d2267efcb0 100644 (file)
@@ -262,7 +262,9 @@ struct bind_kw {
        int (*parse)(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err);
        int skip; /* nb of args to skip */
 };
-struct ssl_bind_kw {
+
+/* same as bind_kw but for crtlist keywords */
+struct ssl_crtlist_kw {
        const char *kw;
        int (*parse)(char **args, int cur_arg, struct proxy *px, struct ssl_bind_conf *conf, int from_cli, char **err);
        int skip; /* nb of args to skip */
index db93d96a2273a440b0d7e2e2f01a06a5e96a52be..d118331f9e663a0e603ea2ec2680ca034ac40fab 100644 (file)
@@ -37,7 +37,7 @@ extern struct eb_root crtlists_tree;
 extern struct eb_root cafile_tree;
 extern int sctl_ex_index;
 extern struct global_ssl global_ssl;
-extern struct ssl_bind_kw ssl_bind_kws[];
+extern struct ssl_crtlist_kw ssl_crtlist_kws[];
 extern struct methodVersions methodVersions[];
 __decl_thread(extern HA_SPINLOCK_T ckch_lock);
 extern struct pool_head *pool_head_ssl_capture;
index 75af0e838bd0db06146e87584578e527c462fe24..655115f52580d5bdd77d7c69dc1bdafffd404a4a 100644 (file)
@@ -1917,9 +1917,9 @@ static int ssl_parse_skip_self_issued_ca(char **args, int section_type, struct p
  * not enabled.
  */
 
-/* the <ssl_bind_kws> keywords are used for crt-list parsing, they *MUST* be safe
+/* the <ssl_crtlist_kws> keywords are used for crt-list parsing, they *MUST* be safe
  * with their proxy argument NULL and must only fill the ssl_bind_conf */
-struct ssl_bind_kw ssl_bind_kws[] = {
+struct ssl_crtlist_kw ssl_crtlist_kws[] = {
        { "allow-0rtt",            ssl_bind_parse_allow_0rtt,       0 }, /* allow 0-RTT */
        { "alpn",                  ssl_bind_parse_alpn,             1 }, /* set ALPN supported protocols */
        { "ca-file",               ssl_bind_parse_ca_file,          1 }, /* set CAfile to process ca-names and verify on client cert */
index 60d007b4789454a835c9230b76ce35f99f052b36..f4041157f68fcc33c7dda48ea44f2c3c41759946 100644 (file)
@@ -4742,13 +4742,13 @@ void cfg_dump_registered_keywords()
                        extern struct list tcp_req_conn_keywords, tcp_req_sess_keywords,
                                tcp_req_cont_keywords, tcp_res_cont_keywords;
                        extern struct bind_kw_list bind_keywords;
-                       extern struct ssl_bind_kw ssl_bind_kws[] __maybe_unused;
+                       extern struct ssl_crtlist_kw ssl_crtlist_kws[] __maybe_unused;
                        extern struct srv_kw_list srv_keywords;
                        struct bind_kw_list *bkwl;
                        struct srv_kw_list *skwl;
                        const struct bind_kw *bkwp, *bkwn;
                        const struct srv_kw *skwp, *skwn;
-                       const struct ssl_bind_kw *sbkwp __maybe_unused, *sbkwn __maybe_unused;
+                       const struct ssl_crtlist_kw *sbkwp __maybe_unused, *sbkwn __maybe_unused;
                        const struct cfg_opt *coptp, *coptn;
 
                        for (bkwn = bkwp = NULL;; bkwp = bkwn) {
@@ -4770,11 +4770,11 @@ void cfg_dump_registered_keywords()
 
 #if defined(USE_OPENSSL)
                        for (sbkwn = sbkwp = NULL;; sbkwp = sbkwn) {
-                               for (index = 0; ssl_bind_kws[index].kw != NULL; index++) {
+                               for (index = 0; ssl_crtlist_kws[index].kw != NULL; index++) {
                                        if (strordered(sbkwp ? sbkwp->kw : NULL,
-                                                      ssl_bind_kws[index].kw,
+                                                      ssl_crtlist_kws[index].kw,
                                                       sbkwn != sbkwp ? sbkwn->kw : NULL))
-                                               sbkwn = &ssl_bind_kws[index];
+                                               sbkwn = &ssl_crtlist_kws[index];
                                }
                                if (sbkwn == sbkwp)
                                        break;
index 2675703a4122e9e576ce6b43b197be35ace77d7b..aa7fdb2edb281071d18b910ec876477df219a61d 100644 (file)
@@ -420,17 +420,17 @@ int crtlist_parse_line(char *line, char **crt_path, struct crtlist_entry *entry,
        cur_arg = ssl_b ? ssl_b : 1;
        while (cur_arg < ssl_e) {
                newarg = 0;
-               for (i = 0; ssl_bind_kws[i].kw != NULL; i++) {
-                       if (strcmp(ssl_bind_kws[i].kw, args[cur_arg]) == 0) {
+               for (i = 0; ssl_crtlist_kws[i].kw != NULL; i++) {
+                       if (strcmp(ssl_crtlist_kws[i].kw, args[cur_arg]) == 0) {
                                newarg = 1;
-                               cfgerr |= ssl_bind_kws[i].parse(args, cur_arg, NULL, ssl_conf, from_cli, err);
-                               if (cur_arg + 1 + ssl_bind_kws[i].skip > ssl_e) {
+                               cfgerr |= ssl_crtlist_kws[i].parse(args, cur_arg, NULL, ssl_conf, from_cli, err);
+                               if (cur_arg + 1 + ssl_crtlist_kws[i].skip > ssl_e) {
                                        memprintf(err, "parsing [%s:%d]: ssl args out of '[]' for %s",
                                                  file, linenum, args[cur_arg]);
                                        cfgerr |= ERR_ALERT | ERR_FATAL;
                                        goto error;
                                }
-                               cur_arg += 1 + ssl_bind_kws[i].skip;
+                               cur_arg += 1 + ssl_crtlist_kws[i].skip;
                                break;
                        }
                }