]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: ssl: rename ssl_sock_load_ca to ssl_sock_gencert_load_ca
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Thu, 23 Jan 2025 14:58:15 +0000 (15:58 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Fri, 24 Jan 2025 11:31:07 +0000 (12:31 +0100)
ssl_sock_load_ca is defined in ssl_gencert.c and compiled only if
SSL_NO_GENERATE_CERTIFICATES is not defined. It's name is a bit confusing, as
we may think at the first glance, that it's a generic function, which is also
used to load CA file, provided via 'ca-file' keyword.
ssl_set_verify_locations_file is used in this case.

So let's rename ssl_sock_load_ca into ssl_sock_gencert_load_ca. Same is
applied to ssl_sock_free_ca.

include/haproxy/ssl_sock.h
src/ssl_gencert.c
src/ssl_sock.c

index bd32ef2f900484b83e931934da3d971a21c057c1..fba5353f5cfc6803f1c0c2b3e736b3fa5586458d 100644 (file)
@@ -68,8 +68,8 @@ void ssl_sock_free_srv_ctx(struct server *srv);
 void ssl_sock_free_all_ctx(struct bind_conf *bind_conf);
 int ssl_sock_get_alpn(const struct connection *conn, void *xprt_ctx,
                       const char **str, int *len);
-int ssl_sock_load_ca(struct bind_conf *bind_conf);
-void ssl_sock_free_ca(struct bind_conf *bind_conf);
+int ssl_sock_gencert_load_ca(struct bind_conf *bind_conf);
+void ssl_sock_gencert_free_ca(struct bind_conf *bind_conf);
 int ssl_bio_and_sess_init(struct connection *conn, SSL_CTX *ssl_ctx,
                           SSL **ssl, BIO **bio, BIO_METHOD *bio_meth, void *ctx);
 const char *ssl_sock_get_sni(struct connection *conn);
index 44dc82c742868851dc5365e6ce40004e4314317f..fb92460ffc899a39ce934b4923dd924ff39685c4 100644 (file)
@@ -381,7 +381,7 @@ int ssl_sock_generate_certificate_from_conn(struct bind_conf *bind_conf, SSL *ss
 
 /* Load CA cert file and private key used to generate certificates */
 int
-ssl_sock_load_ca(struct bind_conf *bind_conf)
+ssl_sock_gencert_load_ca(struct bind_conf *bind_conf)
 {
        struct proxy *px = bind_conf->frontend;
        struct ckch_data *data = NULL;
@@ -446,7 +446,7 @@ ssl_sock_load_ca(struct bind_conf *bind_conf)
 
 /* Release CA cert and private key used to generate certificated */
 void
-ssl_sock_free_ca(struct bind_conf *bind_conf)
+ssl_sock_gencert_free_ca(struct bind_conf *bind_conf)
 {
        if (bind_conf->ca_sign_ckch) {
                ssl_sock_free_cert_key_and_chain_contents(bind_conf->ca_sign_ckch);
index 5d9593a812c58a9e2b5fb2f6f963d7033f452425..8e5063e5fd00cfd3b542dccf245d7b10306b3615 100644 (file)
@@ -4790,7 +4790,7 @@ int ssl_sock_prepare_bind_conf(struct bind_conf *bind_conf)
 
 #ifndef SSL_NO_GENERATE_CERTIFICATES
        /* initialize CA variables if the certificates generation is enabled */
-       err += ssl_sock_load_ca(bind_conf);
+       err += ssl_sock_gencert_load_ca(bind_conf);
 #endif
 
        return -err;
@@ -4884,7 +4884,7 @@ REGISTER_POST_DEINIT(ssl_sock_deinit);
 void ssl_sock_destroy_bind_conf(struct bind_conf *bind_conf)
 {
 #ifndef SSL_NO_GENERATE_CERTIFICATES
-       ssl_sock_free_ca(bind_conf);
+       ssl_sock_gencert_free_ca(bind_conf);
 #endif
        ssl_sock_free_all_ctx(bind_conf);
        ssl_sock_free_ssl_conf(&bind_conf->ssl_conf);