1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

Eino Tuominen improved the code when a file is used to seed the randomizer

This commit is contained in:
Daniel Stenberg 2008-04-04 20:05:23 +00:00
parent aa2a54c10a
commit b50a96982e
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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