From b0663f0b292d5361855eda217eb0bc4eac46ab5f Mon Sep 17 00:00:00 2001 From: Esa Korhonen Date: Tue, 15 Jan 2019 17:12:32 +0200 Subject: [PATCH] Convert maxscale/ssl.h to .hh --- include/maxscale/dcb.hh | 2 +- include/maxscale/listener.hh | 2 +- include/maxscale/server.hh | 2 +- include/maxscale/{ssl.h => ssl.hh} | 42 +++++++++---------- server/core/internal/config.hh | 2 +- server/core/listener.cc | 2 +- server/core/server.cc | 2 +- .../MySQL/mariadbclient/mysql_client.cc | 2 +- 8 files changed, 26 insertions(+), 30 deletions(-) rename include/maxscale/{ssl.h => ssl.hh} (63%) diff --git a/include/maxscale/dcb.hh b/include/maxscale/dcb.hh index 9a684b0e6..21be8a0a9 100644 --- a/include/maxscale/dcb.hh +++ b/include/maxscale/dcb.hh @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include diff --git a/include/maxscale/listener.hh b/include/maxscale/listener.hh index 283c3658b..52bac51c3 100644 --- a/include/maxscale/listener.hh +++ b/include/maxscale/listener.hh @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include diff --git a/include/maxscale/server.hh b/include/maxscale/server.hh index d20c1d980..26992c6ae 100644 --- a/include/maxscale/server.hh +++ b/include/maxscale/server.hh @@ -18,7 +18,7 @@ #include #include #include -#include +#include // A mapping from a path to a percentage, e.g.: "/disk" -> 80. typedef std::unordered_map MxsDiskSpaceThreshold; diff --git a/include/maxscale/ssl.h b/include/maxscale/ssl.hh similarity index 63% rename from include/maxscale/ssl.h rename to include/maxscale/ssl.hh index 35623446d..a20a3da3a 100644 --- a/include/maxscale/ssl.h +++ b/include/maxscale/ssl.hh @@ -13,23 +13,21 @@ #pragma once /** - * @file ssl.h + * @file ssl.hh * * The SSL definitions for MaxScale */ -#include +#include #include #include #include #include #include -MXS_BEGIN_DECLS - struct DCB; -typedef enum ssl_method_type +enum ssl_method_type_t { #ifndef OPENSSL_1_1 SERVICE_TLS10, @@ -42,7 +40,7 @@ typedef enum ssl_method_type SERVICE_TLS_MAX, SERVICE_SSL_TLS_MAX, SERVICE_SSL_UNKNOWN -} ssl_method_type_t; +}; /** * Return codes for SSL authentication checks @@ -55,23 +53,23 @@ typedef enum ssl_method_type * The ssl_listener structure is used to aggregate the SSL configuration items * and data for a particular listener */ -typedef struct ssl_listener +struct SSL_LISTENER { SSL_CTX* ctx; - SSL_METHOD* method; /*< SSLv3 or TLS1.0/1.1/1.2 methods - * see: https://www.openssl.org/docs/ssl/SSL_CTX_new.html - **/ - int ssl_cert_verify_depth;/*< SSL certificate verification depth */ - ssl_method_type_t ssl_method_type; /*< Which of the SSLv3 or TLS1.0/1.1/1.2 methods to use */ - char* ssl_cert; /*< SSL certificate */ - char* ssl_key; /*< SSL private key */ - char* ssl_ca_cert; /*< SSL CA certificate */ - bool ssl_init_done; /*< If SSL has already been initialized for this service - * */ - bool ssl_verify_peer_certificate; /*< Enable peer certificate verification */ - struct ssl_listener - * next; /*< Next SSL configuration, currently used to store obsolete configurations */ -} SSL_LISTENER; + SSL_METHOD* method; /**< SSLv3 or TLS1.0/1.1/1.2 methods + * see: https://www.openssl.org/docs/ssl/SSL_CTX_new.html */ + + int ssl_cert_verify_depth;/**< SSL certificate verification depth */ + ssl_method_type_t ssl_method_type; /**< Which of the SSLv3 or TLS1.0/1.1/1.2 methods to use */ + + char* ssl_cert; /**< SSL certificate */ + char* ssl_key; /**< SSL private key */ + char* ssl_ca_cert; /**< SSL CA certificate */ + bool ssl_init_done; /**< If SSL has already been initialized for this service */ + bool ssl_verify_peer_certificate; /**< Enable peer certificate verification */ + + SSL_LISTENER* next; /**< Next SSL configuration, currently used to store obsolete configurations */ +}; int ssl_authenticate_client(DCB* dcb, bool is_capable); bool ssl_is_connection_healthy(DCB* dcb); @@ -95,5 +93,3 @@ int ssl_authenticate_check_status(DCB* dcb); // TODO: Move this to an internal ssl.h header void write_ssl_config(int fd, SSL_LISTENER* ssl); - -MXS_END_DECLS diff --git a/server/core/internal/config.hh b/server/core/internal/config.hh index 2f0451151..3ea4ef876 100644 --- a/server/core/internal/config.hh +++ b/server/core/internal/config.hh @@ -23,7 +23,7 @@ #include #include -#include +#include #define DEFAULT_NBPOLLS 3 /**< Default number of non block polls before we block */ #define DEFAULT_POLLSLEEP 1000 /**< Default poll wait time (milliseconds) */ diff --git a/server/core/listener.cc b/server/core/listener.cc index f37c53286..f9f30e302 100644 --- a/server/core/listener.cc +++ b/server/core/listener.cc @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include diff --git a/server/core/server.cc b/server/core/server.cc index 9d88c8319..7fcc59fe0 100644 --- a/server/core/server.cc +++ b/server/core/server.cc @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc b/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc index 2561a11a3..8f5d7b717 100644 --- a/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc +++ b/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include "setparser.hh"