Rename redisTLSContextConfig to serverTLSContextConfig (#176)

Part of #144

Signed-off-by: 0del <bany.y0599@gmail.com>
This commit is contained in:
0del 2024-04-04 00:06:01 +07:00 committed by GitHub
parent 25122b140e
commit c413834da1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -1475,7 +1475,7 @@ struct malloc_stats {
* TLS Context Configuration * TLS Context Configuration
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
typedef struct redisTLSContextConfig { typedef struct serverTLSContextConfig {
char *cert_file; /* Server side and optionally client side cert file name */ char *cert_file; /* Server side and optionally client side cert file name */
char *key_file; /* Private key filename for cert_file */ char *key_file; /* Private key filename for cert_file */
char *key_file_pass; /* Optional password for key_file */ char *key_file_pass; /* Optional password for key_file */
@ -1492,7 +1492,7 @@ typedef struct redisTLSContextConfig {
int session_caching; int session_caching;
int session_cache_size; int session_cache_size;
int session_cache_timeout; int session_cache_timeout;
} redisTLSContextConfig; } serverTLSContextConfig;
/*----------------------------------------------------------------------------- /*-----------------------------------------------------------------------------
* AOF manifest definition * AOF manifest definition
@ -2050,7 +2050,7 @@ struct redisServer {
int tls_cluster; int tls_cluster;
int tls_replication; int tls_replication;
int tls_auth_clients; int tls_auth_clients;
redisTLSContextConfig tls_ctx_config; serverTLSContextConfig tls_ctx_config;
/* cpu affinity */ /* cpu affinity */
char *server_cpulist; /* cpu affinity list of redis server main/io thread. */ char *server_cpulist; /* cpu affinity list of redis server main/io thread. */
char *bio_cpulist; /* cpu affinity list of bio thread. */ char *bio_cpulist; /* cpu affinity list of bio thread. */

View File

@ -203,7 +203,7 @@ static int tlsPasswordCallback(char *buf, int size, int rwflag, void *u) {
/* Create a *base* SSL_CTX using the SSL configuration provided. The base context /* Create a *base* SSL_CTX using the SSL configuration provided. The base context
* includes everything that's common for both client-side and server-side connections. * includes everything that's common for both client-side and server-side connections.
*/ */
static SSL_CTX *createSSLContext(redisTLSContextConfig *ctx_config, int protocols, int client) { static SSL_CTX *createSSLContext(serverTLSContextConfig *ctx_config, int protocols, int client) {
const char *cert_file = client ? ctx_config->client_cert_file : ctx_config->cert_file; const char *cert_file = client ? ctx_config->client_cert_file : ctx_config->cert_file;
const char *key_file = client ? ctx_config->client_key_file : ctx_config->key_file; const char *key_file = client ? ctx_config->client_key_file : ctx_config->key_file;
const char *key_file_pass = client ? ctx_config->client_key_file_pass : ctx_config->key_file_pass; const char *key_file_pass = client ? ctx_config->client_key_file_pass : ctx_config->key_file_pass;
@ -282,12 +282,12 @@ error:
/* Attempt to configure/reconfigure TLS. This operation is atomic and will /* Attempt to configure/reconfigure TLS. This operation is atomic and will
* leave the SSL_CTX unchanged if fails. * leave the SSL_CTX unchanged if fails.
* @priv: config of redisTLSContextConfig. * @priv: config of serverTLSContextConfig.
* @reconfigure: if true, ignore the previous configure; if false, only * @reconfigure: if true, ignore the previous configure; if false, only
* configure from @ctx_config if redis_tls_ctx is NULL. * configure from @ctx_config if redis_tls_ctx is NULL.
*/ */
static int tlsConfigure(void *priv, int reconfigure) { static int tlsConfigure(void *priv, int reconfigure) {
redisTLSContextConfig *ctx_config = (redisTLSContextConfig *)priv; serverTLSContextConfig *ctx_config = (serverTLSContextConfig *)priv;
char errbuf[256]; char errbuf[256];
SSL_CTX *ctx = NULL; SSL_CTX *ctx = NULL;
SSL_CTX *client_ctx = NULL; SSL_CTX *client_ctx = NULL;