From 19d1853f717db6d0497e5c28de0664e90cd2d072 Mon Sep 17 00:00:00 2001 From: Simon Arlott Date: Mon, 25 Apr 2016 19:02:03 +0100 Subject: [PATCH] ssld: remove init_prng command This is no longer configurable so it's redundant. --- ircd/sslproc.c | 30 ------------------------------ ssld/ssld.c | 16 +--------------- 2 files changed, 1 insertion(+), 45 deletions(-) diff --git a/ircd/sslproc.c b/ircd/sslproc.c index 5abd92b1..c1d39dec 100644 --- a/ircd/sslproc.c +++ b/ircd/sslproc.c @@ -72,7 +72,6 @@ struct _ssl_ctl static void send_new_ssl_certs_one(ssl_ctl_t * ctl, const char *ssl_cert, const char *ssl_private_key, const char *ssl_dh_params, const char *ssl_cipher_list); -static void send_init_prng(ssl_ctl_t * ctl, prng_seed_t seedtype, const char *path); static void send_certfp_method(ssl_ctl_t *ctl, int method); @@ -341,7 +340,6 @@ start_ssldaemon(int count, const char *ssl_cert, const char *ssl_private_key, co ctl = allocate_ssl_daemon(F1, P2, pid); if(ircd_ssl_ok) { - send_init_prng(ctl, RB_PRNG_DEFAULT, NULL); send_certfp_method(ctl, ConfigFileEntry.certfp_method); if(ssl_cert != NULL && ssl_private_key != NULL) @@ -723,34 +721,6 @@ send_new_ssl_certs_one(ssl_ctl_t * ctl, const char *ssl_cert, const char *ssl_pr ssl_cmd_write_queue(ctl, NULL, 0, tmpbuf, len); } -static void -send_init_prng(ssl_ctl_t * ctl, prng_seed_t seedtype, const char *path) -{ - size_t len; - const char *s; - uint8_t seed = (uint8_t) seedtype; - - if(path == NULL) - s = ""; - else - s = path; - - len = strlen(s) + 3; - if(len > sizeof(tmpbuf)) - { - sendto_realops_snomask(SNO_GENERAL, L_ALL, - "Parameters for send_init_prng too long (%zd > %zd) to pass to ssld, not sending...", - len, sizeof(tmpbuf)); - ilog(L_MAIN, - "Parameters for send_init_prng too long (%zd > %zd) to pass to ssld, not sending...", - len, sizeof(tmpbuf)); - return; - - } - len = snprintf(tmpbuf, sizeof(tmpbuf), "I%c%s%c", seed, s, nul); - ssl_cmd_write_queue(ctl, NULL, 0, tmpbuf, len); -} - static void send_certfp_method(ssl_ctl_t *ctl, int method) { diff --git a/ssld/ssld.c b/ssld/ssld.c index a8243a2d..e8fb5adf 100644 --- a/ssld/ssld.c +++ b/ssld/ssld.c @@ -895,18 +895,6 @@ zlib_process(mod_ctl_t * ctl, mod_ctl_buf_t * ctlb) } #endif -static void -init_prng(mod_ctl_t * ctl, mod_ctl_buf_t * ctl_buf) -{ - char *path; - prng_seed_t seed_type; - - seed_type = (prng_seed_t) ctl_buf->buf[1]; - path = (char *) &ctl_buf->buf[2]; - rb_init_prng(path, seed_type); -} - - static void ssl_new_keys(mod_ctl_t * ctl, mod_ctl_buf_t * ctl_buf) { @@ -1046,9 +1034,6 @@ mod_process_cmd_recv(mod_ctl_t * ctl) ssl_new_keys(ctl, ctl_buf); break; } - case 'I': - init_prng(ctl, ctl_buf); - break; case 'S': { process_stats(ctl, ctl_buf); @@ -1219,6 +1204,7 @@ main(int argc, char **argv) setup_signals(); rb_lib_init(NULL, NULL, NULL, 0, maxfd, 1024, 4096); rb_init_rawbuffers(1024); + rb_init_prng(NULL, RB_PRNG_DEFAULT); ssld_ssl_ok = rb_supports_ssl(); mod_ctl = rb_malloc(sizeof(mod_ctl_t)); mod_ctl->F = rb_open(ctlfd, RB_FD_SOCKET, "ircd control socket");