]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl: rename ckchs_load_cert_file to new_ckch_store_load_files_path
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 11 Apr 2024 13:55:16 +0000 (15:55 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Fri, 12 Apr 2024 13:38:54 +0000 (15:38 +0200)
Remove the ambiguous "ckchs" name and reflect the fact that its loaded
from a path.

include/haproxy/ssl_ckch.h
src/ssl_ckch.c
src/ssl_crtlist.c
src/ssl_sock.c

index 809ad8f08fba63b91a92784d411441dbd6fc381e..10c52d215d5a986a97523d59d429e0c5a36a52a3 100644 (file)
@@ -37,7 +37,7 @@ int ssl_sock_load_sctl_from_file(const char *sctl_path, char *buf, struct ckch_d
 int ssl_sock_load_issuer_file_into_ckch(const char *path, char *buf, struct ckch_data *data, char **err);
 
 /* ckch_store functions */
-struct ckch_store *ckchs_load_cert_file(char *path, char **err);
+struct ckch_store *new_ckch_store_load_files_path(char *path, char **err);
 struct ckch_store *ckchs_lookup(char *path);
 struct ckch_store *ckchs_dup(const struct ckch_store *src);
 struct ckch_store *ckch_store_new(const char *filename);
index 7a33765692a23537effed6229b0af53ece7e2252..0ac5b5ecc9ca5a4dc1d61f1a4060afa55f05ce84 100644 (file)
@@ -995,7 +995,7 @@ struct ckch_store *ckchs_lookup(char *path)
 /*
  * This function allocate a ckch_store and populate it with certificates from files.
  */
-struct ckch_store *ckchs_load_cert_file(char *path, char **err)
+struct ckch_store *new_ckch_store_load_files_path(char *path, char **err)
 {
        struct ckch_store *ckchs;
 
index beb3398029994db57211c1c3656e6c21bea54aa9..ff7f279854da9ffb1b20099cc85371f5b57e7b3e 100644 (file)
@@ -590,7 +590,7 @@ int crtlist_parse_file(char *file, struct bind_conf *bind_conf, struct proxy *cu
                        if (stat(crt_path, &buf) == 0) {
                                found++;
 
-                               ckchs = ckchs_load_cert_file(crt_path, err);
+                               ckchs = new_ckch_store_load_files_path(crt_path, err);
                                if (ckchs == NULL) {
                                        cfgerr |= ERR_ALERT | ERR_FATAL;
                                        goto error;
@@ -627,7 +627,7 @@ int crtlist_parse_file(char *file, struct bind_conf *bind_conf, struct proxy *cu
                                        ckchs = ckchs_lookup(fp);
                                        if (!ckchs) {
                                                if (stat(fp, &buf) == 0) {
-                                                       ckchs = ckchs_load_cert_file(fp, err);
+                                                       ckchs = new_ckch_store_load_files_path(fp, err);
                                                        if (!ckchs) {
                                                                cfgerr |= ERR_ALERT | ERR_FATAL;
                                                                goto error;
@@ -780,7 +780,7 @@ int crtlist_load_cert_dir(char *path, struct bind_conf *bind_conf, struct crtlis
 
                        ckchs = ckchs_lookup(fp);
                        if (ckchs == NULL)
-                               ckchs = ckchs_load_cert_file(fp, err);
+                               ckchs = new_ckch_store_load_files_path(fp, err);
                        if (ckchs == NULL) {
                                free(de);
                                free(entry);
index 824bdaa721ba35d69860cbcf4e9a2cb5a720e162..c44c9e7e38b112005f0683bb73f6b9e4ebadffbd 100644 (file)
@@ -3858,7 +3858,7 @@ int ssl_sock_load_cert(char *path, struct bind_conf *bind_conf, int is_default,
        } else if (stat(path, &buf) == 0) {
                found++;
                if (S_ISDIR(buf.st_mode) == 0) {
-                       ckchs =  ckchs_load_cert_file(path, err);
+                       ckchs = new_ckch_store_load_files_path(path, err);
                        if (!ckchs)
                                cfgerr |= ERR_ALERT | ERR_FATAL;
                        cfgerr |= ssl_sock_load_ckchs(path, ckchs, bind_conf, NULL, NULL, 0, is_default, &ckch_inst, err);
@@ -3886,7 +3886,7 @@ int ssl_sock_load_cert(char *path, struct bind_conf *bind_conf, int is_default,
                                } else {
                                        if (stat(fp, &buf) == 0) {
                                                found++;
-                                               ckchs =  ckchs_load_cert_file(fp, err);
+                                               ckchs =  new_ckch_store_load_files_path(fp, err);
                                                if (!ckchs)
                                                        cfgerr |= ERR_ALERT | ERR_FATAL;
                                                cfgerr |= ssl_sock_load_ckchs(fp, ckchs, bind_conf, NULL, NULL, 0, is_default, &ckch_inst, err);
@@ -3939,7 +3939,7 @@ int ssl_sock_load_srv_cert(char *path, struct server *server, int create_if_none
                        /* We do not manage directories on backend side. */
                        if (S_ISDIR(buf.st_mode) == 0) {
                                ++found;
-                               ckchs =  ckchs_load_cert_file(path, err);
+                               ckchs = new_ckch_store_load_files_path(path, err);
                                if (!ckchs)
                                        cfgerr |= ERR_ALERT | ERR_FATAL;
                                cfgerr |= ssl_sock_load_srv_ckchs(path, ckchs, server, &server->ssl_ctx.inst, err);