Changeset 999
- Timestamp:
- 07/07/07 13:06:35 (1 year ago)
- Files:
-
- 1.8.2/branches/devel/CHANGES.182 (modified) (1 diff)
- 1.8.2/branches/devel/src/myssl.c (modified) (4 diffs)
- 1.8.2/branches/devel/src/utils.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.8.2/branches/devel/CHANGES.182
r993 r999 28 28 * Fixed assorted small memory leaks. [SW] 29 29 * Fixed handling of telnet NOPs sent by clients. [SW] 30 * The OpenSSL random number pool wasn't getting adequately 31 initialized on systems without /dev/urandom 30 32 31 33 Version 1.8.2 patchlevel 5 June 13, 2007 1.8.2/branches/devel/src/myssl.c
r932 r999 74 74 #include <openssl/dh.h> 75 75 #include <openssl/evp.h> 76 #include <openssl/rand.h> 76 77 77 78 #include "conf.h" … … 106 107 static SSL_CTX *ctx = NULL; 107 108 109 unsigned int genrand_int32(void); 110 108 111 /** Initialize the SSL context. 109 112 * \return pointer to SSL context object. … … 115 118 unsigned char context[128]; 116 119 DH *dh; 120 unsigned int reps = 1; 117 121 118 122 if (!bio_err) { … … 123 127 bio_err = BIO_new_fp(stderr, BIO_NOCLOSE); 124 128 } 125 #ifndef HAS_DEV_URANDOM 126 /* We need to seed the RNG with RAND_seed() or RAND_egd() here. 127 * Where are we going to get an unpredictable seed? 128 */ 129 #endif 129 130 do_rawlog(LT_ERR, "Seeding OpenSSL random number pool."); 131 while (!RAND_status()) { 132 /* At this point, a system with /dev/urandom or a EGD file in the usual 133 places will have enough entropy. Otherwise, be lazy and use random numbers 134 until it's satisfied. */ 135 unsigned int gibberish[4]; 136 int n; 137 138 for (n = 0; n < 4; n++) 139 gibberish[n] = genrand_int32(); 140 141 RAND_seed(gibberish, sizeof gibberish); 142 143 reps += 1; 144 } 145 do_rawlog(LT_ERR, "Seeded after %u %s.", reps, reps > 1 ? "cycles" : "cycle"); 130 146 131 147 /* Set up SIGPIPE handler here? */ 1.8.2/branches/devel/src/utils.c
r951 r999 49 49 dbref find_entrance(dbref door); 50 50 void initialize_mt(void); 51 static unsigned longgenrand_int32(void);51 unsigned int genrand_int32(void); 52 52 static void init_genrand(unsigned long); 53 53 static void init_by_array(unsigned long *, int); … … 589 589 590 590 /* generates a random number on [0,0xffffffff]-interval */ 591 static unsigned long 591 unsigned int 592 592 genrand_int32(void) 593 593 {
