Skip to content
Snippets Groups Projects
Commit b50a9698 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

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

parent aa2a54c1
No related branches found
No related tags found
No related merge requests found
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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment