From 964f0935048a2e7024c0c1f99b1b725aa34b7b9d Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Thu, 2 May 2024 15:54:31 +0200 Subject: [PATCH] CLEANUP: ssl: rename new_ckch_store_load_files_path() to ckch_store_new_load_files_path() Rename the new_ckch_store_load_files_path() function to ckch_store_new_load_files_path(), in order to be more consistent. --- include/haproxy/ssl_ckch.h | 2 +- src/ssl_ckch.c | 2 +- src/ssl_crtlist.c | 6 +++--- src/ssl_sock.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/haproxy/ssl_ckch.h b/include/haproxy/ssl_ckch.h index 10c52d215..37cb4710f 100644 --- a/include/haproxy/ssl_ckch.h +++ b/include/haproxy/ssl_ckch.h @@ -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 *new_ckch_store_load_files_path(char *path, char **err); +struct ckch_store *ckch_store_new_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); diff --git a/src/ssl_ckch.c b/src/ssl_ckch.c index 1ac35adff..b7e7ae1d4 100644 --- a/src/ssl_ckch.c +++ b/src/ssl_ckch.c @@ -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 *new_ckch_store_load_files_path(char *path, char **err) +struct ckch_store *ckch_store_new_load_files_path(char *path, char **err) { struct ckch_store *ckchs; diff --git a/src/ssl_crtlist.c b/src/ssl_crtlist.c index 7a7721593..528db099d 100644 --- a/src/ssl_crtlist.c +++ b/src/ssl_crtlist.c @@ -592,7 +592,7 @@ int crtlist_parse_file(char *file, struct bind_conf *bind_conf, struct proxy *cu if (stat(crt_path, &buf) == 0) { found++; - ckchs = new_ckch_store_load_files_path(crt_path, err); + ckchs = ckch_store_new_load_files_path(crt_path, err); if (ckchs == NULL) { cfgerr |= ERR_ALERT | ERR_FATAL; goto error; @@ -629,7 +629,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 = new_ckch_store_load_files_path(fp, err); + ckchs = ckch_store_new_load_files_path(fp, err); if (!ckchs) { cfgerr |= ERR_ALERT | ERR_FATAL; goto error; @@ -782,7 +782,7 @@ int crtlist_load_cert_dir(char *path, struct bind_conf *bind_conf, struct crtlis ckchs = ckchs_lookup(fp); if (ckchs == NULL) - ckchs = new_ckch_store_load_files_path(fp, err); + ckchs = ckch_store_new_load_files_path(fp, err); if (ckchs == NULL) { free(de); free(entry); diff --git a/src/ssl_sock.c b/src/ssl_sock.c index 3288641ed..11fb908d5 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -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 = new_ckch_store_load_files_path(path, err); + ckchs = ckch_store_new_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 = new_ckch_store_load_files_path(fp, err); + ckchs = ckch_store_new_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 = new_ckch_store_load_files_path(path, err); + ckchs = ckch_store_new_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);