]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl: move the cert_exts and the CERT_TYPE enum
authorWilliam Lallemand <wlallemand@haproxy.org>
Thu, 24 Mar 2022 16:48:40 +0000 (17:48 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 30 Mar 2022 10:18:16 +0000 (12:18 +0200)
Move the cert_exts declaration and the CERT_TYPE enum in the .h in order
to reuse them in another file.

include/haproxy/ssl_ckch-t.h
include/haproxy/ssl_ckch.h
src/ssl_ckch.c

index b5f14e5e1a06541eec032f393688432e11bbf03e..f6c7f0940dcde549291844bfb71c5eca70491cf3 100644 (file)
@@ -133,5 +133,25 @@ struct cafile_entry {
        char path[0];
 };
 
+enum {
+       CERT_TYPE_PEM = 0,
+       CERT_TYPE_KEY,
+#if ((defined SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB && !defined OPENSSL_NO_OCSP) || defined OPENSSL_IS_BORINGSSL)
+       CERT_TYPE_OCSP,
+#endif
+       CERT_TYPE_ISSUER,
+#ifdef HAVE_SSL_SCTL
+       CERT_TYPE_SCTL,
+#endif
+       CERT_TYPE_MAX,
+};
+
+struct cert_exts {
+       const char *ext;
+       int type;
+       int (*load)(const char *path, char *payload, struct cert_key_and_chain *ckch, char **err);
+       /* add a parsing callback */
+};
+
 #endif /* USE_OPENSSL */
 #endif /* _HAPROXY_SSL_CKCH_T_H */
index 2eea80750bed3e97d8720a5cd2369876ee59365b..3f2dc795b5437c0a51e9f942effcc3616df12b12 100644 (file)
@@ -65,5 +65,7 @@ void ssl_store_delete_cafile_entry(struct cafile_entry *ca_e);
 int ssl_store_load_ca_from_buf(struct cafile_entry *ca_e, char *cert_buf);
 int ssl_store_load_locations_file(char *path, int create_if_none, enum cafile_type type);
 
+extern struct cert_exts cert_exts[];
+
 #endif /* USE_OPENSSL */
 #endif /* _HAPROXY_SSL_CRTLIST_H */
index d5444dfc66e3df79cb4ef2c79c5047493e467ea7..9128e333e9293a9eb9a5feb4d726a9275f88e536 100644 (file)
@@ -1116,25 +1116,7 @@ int ssl_store_load_locations_file(char *path, int create_if_none, enum cafile_ty
 
 /* Type of SSL payloads that can be updated over the CLI */
 
-enum {
-       CERT_TYPE_PEM = 0,
-       CERT_TYPE_KEY,
-#if ((defined SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB && !defined OPENSSL_NO_OCSP) || defined OPENSSL_IS_BORINGSSL)
-       CERT_TYPE_OCSP,
-#endif
-       CERT_TYPE_ISSUER,
-#ifdef HAVE_SSL_SCTL
-       CERT_TYPE_SCTL,
-#endif
-       CERT_TYPE_MAX,
-};
-
-struct {
-       const char *ext;
-       int type;
-       int (*load)(const char *path, char *payload, struct cert_key_and_chain *ckch, char **err);
-       /* add a parsing callback */
-} cert_exts[CERT_TYPE_MAX+1] = {
+struct cert_exts cert_exts[CERT_TYPE_MAX+1] = {
        [CERT_TYPE_PEM]    = { "",        CERT_TYPE_PEM,      &ssl_sock_load_pem_into_ckch }, /* default mode, no extensions */
        [CERT_TYPE_KEY]    = { "key",     CERT_TYPE_KEY,      &ssl_sock_load_key_into_ckch },
 #if ((defined SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB && !defined OPENSSL_NO_OCSP) || defined OPENSSL_IS_BORINGSSL)