ircd: do not shadow internal openssl symbol "ssl_ok" (yeah, i know)
This commit is contained in:
parent
7cc67225cb
commit
bfc44622c8
8 changed files with 18 additions and 18 deletions
|
@ -99,8 +99,8 @@ extern int testing_conf;
|
||||||
|
|
||||||
extern struct ev_entry *check_splitmode_ev;
|
extern struct ev_entry *check_splitmode_ev;
|
||||||
|
|
||||||
extern bool ssl_ok;
|
extern bool ircd_ssl_ok;
|
||||||
extern bool zlib_ok;
|
extern bool ircd_zlib_ok;
|
||||||
extern int maxconnections;
|
extern int maxconnections;
|
||||||
|
|
||||||
void ircd_shutdown(const char *reason);
|
void ircd_shutdown(const char *reason);
|
||||||
|
|
|
@ -105,8 +105,8 @@ bool doremotd = false;
|
||||||
bool kline_queued = false;
|
bool kline_queued = false;
|
||||||
bool server_state_foreground = false;
|
bool server_state_foreground = false;
|
||||||
bool opers_see_all_users = false;
|
bool opers_see_all_users = false;
|
||||||
bool ssl_ok = false;
|
bool ircd_ssl_ok = false;
|
||||||
bool zlib_ok = true;
|
bool ircd_zlib_ok = true;
|
||||||
|
|
||||||
int testing_conf = 0;
|
int testing_conf = 0;
|
||||||
time_t startup_time;
|
time_t startup_time;
|
||||||
|
@ -721,10 +721,10 @@ charybdis_main(int argc, char *argv[])
|
||||||
if(!rb_setup_ssl_server(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params, ServerInfo.ssl_cipher_list))
|
if(!rb_setup_ssl_server(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params, ServerInfo.ssl_cipher_list))
|
||||||
{
|
{
|
||||||
ilog(L_MAIN, "WARNING: Unable to setup SSL.");
|
ilog(L_MAIN, "WARNING: Unable to setup SSL.");
|
||||||
ssl_ok = false;
|
ircd_ssl_ok = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ssl_ok = true;
|
ircd_ssl_ok = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (testing_conf)
|
if (testing_conf)
|
||||||
|
|
|
@ -523,7 +523,7 @@ accept_precallback(rb_fde_t *F, struct sockaddr *addr, rb_socklen_t addrlen, voi
|
||||||
static time_t last_oper_notice = 0;
|
static time_t last_oper_notice = 0;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
if(listener->ssl && (!ssl_ok || !get_ssld_count()))
|
if(listener->ssl && (!ircd_ssl_ok || !get_ssld_count()))
|
||||||
{
|
{
|
||||||
rb_close(F);
|
rb_close(F);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -868,9 +868,9 @@ validate_conf(void)
|
||||||
if(!rb_setup_ssl_server(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params, ServerInfo.ssl_cipher_list))
|
if(!rb_setup_ssl_server(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params, ServerInfo.ssl_cipher_list))
|
||||||
{
|
{
|
||||||
ilog(L_MAIN, "WARNING: Unable to setup SSL.");
|
ilog(L_MAIN, "WARNING: Unable to setup SSL.");
|
||||||
ssl_ok = false;
|
ircd_ssl_ok = false;
|
||||||
} else {
|
} else {
|
||||||
ssl_ok = true;
|
ircd_ssl_ok = true;
|
||||||
send_new_ssl_certs(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params, ServerInfo.ssl_cipher_list);
|
send_new_ssl_certs(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params, ServerInfo.ssl_cipher_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -273,7 +273,7 @@ try_connections(void *unused)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* don't allow ssl connections if ssl isn't setup */
|
/* don't allow ssl connections if ssl isn't setup */
|
||||||
if(ServerConfSSL(tmp_p) && (!ssl_ok || !get_ssld_count()))
|
if(ServerConfSSL(tmp_p) && (!ircd_ssl_ok || !get_ssld_count()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
cltmp = tmp_p->class;
|
cltmp = tmp_p->class;
|
||||||
|
|
|
@ -339,7 +339,7 @@ start_ssldaemon(int count, const char *ssl_cert, const char *ssl_private_key, co
|
||||||
rb_close(F2);
|
rb_close(F2);
|
||||||
rb_close(P1);
|
rb_close(P1);
|
||||||
ctl = allocate_ssl_daemon(F1, P2, pid);
|
ctl = allocate_ssl_daemon(F1, P2, pid);
|
||||||
if(ssl_ok)
|
if(ircd_ssl_ok)
|
||||||
{
|
{
|
||||||
send_init_prng(ctl, RB_PRNG_DEFAULT, NULL);
|
send_init_prng(ctl, RB_PRNG_DEFAULT, NULL);
|
||||||
send_certfp_method(ctl, ConfigFileEntry.certfp_method);
|
send_certfp_method(ctl, ConfigFileEntry.certfp_method);
|
||||||
|
@ -489,7 +489,7 @@ ssl_process_cmd_recv(ssl_ctl_t * ctl)
|
||||||
switch (*ctl_buf->buf)
|
switch (*ctl_buf->buf)
|
||||||
{
|
{
|
||||||
case 'N':
|
case 'N':
|
||||||
ssl_ok = false; /* ssld says it can't do ssl/tls */
|
ircd_ssl_ok = false; /* ssld says it can't do ssl/tls */
|
||||||
break;
|
break;
|
||||||
case 'D':
|
case 'D':
|
||||||
ssl_process_dead_fd(ctl, ctl_buf);
|
ssl_process_dead_fd(ctl, ctl_buf);
|
||||||
|
@ -504,13 +504,13 @@ ssl_process_cmd_recv(ssl_ctl_t * ctl)
|
||||||
ssl_process_zipstats(ctl, ctl_buf);
|
ssl_process_zipstats(ctl, ctl_buf);
|
||||||
break;
|
break;
|
||||||
case 'I':
|
case 'I':
|
||||||
ssl_ok = false;
|
ircd_ssl_ok = false;
|
||||||
ilog(L_MAIN, "%s", cannot_setup_ssl);
|
ilog(L_MAIN, "%s", cannot_setup_ssl);
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s", cannot_setup_ssl);
|
sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s", cannot_setup_ssl);
|
||||||
break;
|
break;
|
||||||
case 'U':
|
case 'U':
|
||||||
zlib_ok = 0;
|
zlib_ok = 0;
|
||||||
ssl_ok = false;
|
ircd_ssl_ok = false;
|
||||||
ilog(L_MAIN, "%s", no_ssl_or_zlib);
|
ilog(L_MAIN, "%s", no_ssl_or_zlib);
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s", no_ssl_or_zlib);
|
sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s", no_ssl_or_zlib);
|
||||||
ssl_killall();
|
ssl_killall();
|
||||||
|
@ -722,7 +722,7 @@ send_new_ssl_certs(const char *ssl_cert, const char *ssl_private_key, const char
|
||||||
rb_dlink_node *ptr;
|
rb_dlink_node *ptr;
|
||||||
if(ssl_cert == NULL || ssl_private_key == NULL || ssl_dh_params == NULL)
|
if(ssl_cert == NULL || ssl_private_key == NULL || ssl_dh_params == NULL)
|
||||||
{
|
{
|
||||||
ssl_ok = false;
|
ircd_ssl_ok = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RB_DLINK_FOREACH(ptr, ssl_daemons.head)
|
RB_DLINK_FOREACH(ptr, ssl_daemons.head)
|
||||||
|
|
|
@ -99,7 +99,7 @@ mo_connect(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sour
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ServerConfSSL(server_p) && (!ssl_ok || !get_ssld_count()))
|
if(ServerConfSSL(server_p) && (!ircd_ssl_ok || !get_ssld_count()))
|
||||||
{
|
{
|
||||||
sendto_one_notice(source_p,
|
sendto_one_notice(source_p,
|
||||||
":Connect: Server %s is set to use SSL/TLS but SSL/TLS is not configured.",
|
":Connect: Server %s is set to use SSL/TLS but SSL/TLS is not configured.",
|
||||||
|
@ -192,7 +192,7 @@ ms_connect(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sour
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ServerConfSSL(server_p) && (!ssl_ok || !get_ssld_count()))
|
if(ServerConfSSL(server_p) && (!ircd_ssl_ok || !get_ssld_count()))
|
||||||
{
|
{
|
||||||
sendto_one_notice(source_p,
|
sendto_one_notice(source_p,
|
||||||
":Connect: Server %s is set to use SSL/TLS but SSL/TLS is not configured.",
|
":Connect: Server %s is set to use SSL/TLS but SSL/TLS is not configured.",
|
||||||
|
|
|
@ -75,7 +75,7 @@ mr_starttls(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ssl_ok || !get_ssld_count())
|
if (!ircd_ssl_ok || !get_ssld_count())
|
||||||
{
|
{
|
||||||
sendto_one_numeric(client_p, ERR_STARTTLS, form_str(ERR_STARTTLS), "TLS is not configured");
|
sendto_one_numeric(client_p, ERR_STARTTLS, form_str(ERR_STARTTLS), "TLS is not configured");
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue