aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-04-04 20:05:23 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-04-04 20:05:23 +0000
commitb50a96982eaa4d508229883d362e6c972ade34e2 (patch)
tree736906f332e22e49697502ad95607fa3e5e7ab45
parentaa2a54c10a19bce9a9b73d92a9712a7616405e6f (diff)
Eino Tuominen improved the code when a file is used to seed the randomizer
-rw-r--r--ares/CHANGES4
-rw-r--r--ares/ares_init.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/ares/CHANGES b/ares/CHANGES
index d33eba4f6..a54ba41d4 100644
--- a/ares/CHANGES
+++ b/ares/CHANGES
@@ -1,5 +1,9 @@
Changelog for the c-ares project
+* April 4 2008 (Daniel Stenberg)
+
+- Eino Tuominen improved the code when a file is used to seed the randomizer.
+
* December 11 2007 (Gisle Vanem)
- Added another sample application; acountry.c which converts an
diff --git a/ares/ares_init.c b/ares/ares_init.c
index 0110f1279..583f98f45 100644
--- a/ares/ares_init.c
+++ b/ares/ares_init.c
@@ -1333,13 +1333,9 @@ static void randomize_key(unsigned char* key,int key_data_len)
}
#else /* !WIN32 */
#ifdef RANDOM_FILE
- char buffer[256];
FILE *f = fopen(RANDOM_FILE, "rb");
if(f) {
- size_t i;
- size_t rc = fread(buffer, key_data_len, 1, f);
- for(i=0; i<rc && counter < key_data_len; i++)
- key[counter++]=buffer[i];
+ counter = fread(key, 1, key_data_len, f);
fclose(f);
}
#endif