View | Details | Raw Unified | Return to bug 198504 | Differences between
and this patch

Collapse All | Expand All

(-)irc/charybdis/files/patch-remove-RB_PRNG_EGD (+74 lines)
Line 0 Link Here
1
From e861902fd9610229bc7327ea057152f66c8b374d Mon Sep 17 00:00:00 2001
2
From: William Pitcock <nenolod@dereferenced.org>
3
Date: Sun, 1 Mar 2015 01:05:14 -0600
4
Subject: [PATCH] libratbox: remove RB_PRNG_EGD in its entirety (closes #85)
5
6
---
7
 libratbox/include/rb_commio.h | 1 -
8
 libratbox/src/openssl.c       | 4 ----
9
 src/ircd.c                    | 6 +-----
10
 src/sslproc.c                 | 7 +------
11
 4 files changed, 2 insertions(+), 16 deletions(-)
12
13
diff --git a/libratbox/include/rb_commio.h b/libratbox/include/rb_commio.h
14
index 70eea34..df6110d 100644
15
--- libratbox/include/rb_commio.h.orig
16
+++ libratbox/include/rb_commio.h
17
@@ -157,7 +157,6 @@ const char *rb_get_iotype(void);
18
 
19
 typedef enum
20
 {
21
-	RB_PRNG_EGD,
22
 	RB_PRNG_FILE,
23
 #ifdef _WIN32
24
 	RB_PRNGWIN32,
25
diff --git a/libratbox/src/openssl.c b/libratbox/src/openssl.c
26
index bd9df62..817f225 100644
27
--- libratbox/src/openssl.c.orig
28
+++ libratbox/src/openssl.c
29
@@ -603,10 +603,6 @@ rb_init_prng(const char *path, prng_seed_t seed_type)
30
 
31
 	switch (seed_type)
32
 	{
33
-	case RB_PRNG_EGD:
34
-		if(RAND_egd(path) == -1)
35
-			return -1;
36
-		break;
37
 	case RB_PRNG_FILE:
38
 		if(RAND_load_file(path, -1) == -1)
39
 			return -1;
40
diff --git a/src/ircd.c b/src/ircd.c
41
index 253bf13..923180f 100644
42
--- src/ircd.c.orig
43
+++ src/ircd.c
44
@@ -630,11 +630,7 @@ main(int argc, char *argv[])
45
 	rb_lib_init(ircd_log_cb, ircd_restart_cb, ircd_die_cb, !server_state_foreground, maxconnections, DNODE_HEAP_SIZE, FD_HEAP_SIZE);
46
 	rb_linebuf_init(LINEBUF_HEAP_SIZE);
47
 
48
-	if(ConfigFileEntry.use_egd && (ConfigFileEntry.egdpool_path != NULL))
49
-	{
50
-		rb_init_prng(ConfigFileEntry.egdpool_path, RB_PRNG_EGD);
51
-	} else
52
-		rb_init_prng(NULL, RB_PRNG_DEFAULT);
53
+	rb_init_prng(NULL, RB_PRNG_DEFAULT);
54
 
55
 	seed_random(NULL);
56
 
57
diff --git a/src/sslproc.c b/src/sslproc.c
58
index c62f8e6..9d523e0 100644
59
--- src/sslproc.c.orig
60
+++ src/sslproc.c
61
@@ -323,12 +323,7 @@ start_ssldaemon(int count, const char *ssl_cert, const char *ssl_private_key, co
62
 		rb_close(P1);
63
 		ctl = allocate_ssl_daemon(F1, P2, pid);
64
 		if(ssl_ok)
65
-		{
66
-			if(ConfigFileEntry.use_egd && (ConfigFileEntry.egdpool_path != NULL))
67
-				send_init_prng(ctl, RB_PRNG_EGD, ConfigFileEntry.egdpool_path);
68
-			else
69
-				send_init_prng(ctl, RB_PRNG_DEFAULT, NULL);
70
-		}
71
+			send_init_prng(ctl, RB_PRNG_DEFAULT, NULL);
72
 		if(ssl_ok && ssl_cert != NULL && ssl_private_key != NULL)
73
 			send_new_ssl_certs_one(ctl, ssl_cert, ssl_private_key,
74
 					       ssl_dh_params != NULL ? ssl_dh_params : "");

Return to bug 198504