PPP: Fix shadowing of global declaration

Older compilers don't like variables with the same name as
global functions. md5.h contains a function md5(), rename
md5 variable in magic.c to md5_ctx.
This commit is contained in:
Erik Ekman 2015-10-06 09:31:25 +02:00 committed by Sylvain Rochet
parent 673c6505ae
commit 7fb832aa4e

View File

@ -162,15 +162,15 @@ void magic_randomize(void) {
* it was documented.
*/
void magic_random_bytes(unsigned char *buf, u32_t buf_len) {
md5_context md5;
md5_context md5_ctx;
u_char tmp[MD5_HASH_SIZE];
u32_t n;
while (buf_len > 0) {
md5_starts(&md5);
md5_update(&md5, (u_char *)magic_randpool, sizeof(magic_randpool));
md5_update(&md5, (u_char *)&magic_randcount, sizeof(magic_randcount));
md5_finish(&md5, tmp);
md5_starts(&md5_ctx);
md5_update(&md5_ctx, (u_char *)magic_randpool, sizeof(magic_randpool));
md5_update(&md5_ctx, (u_char *)&magic_randcount, sizeof(magic_randcount));
md5_finish(&md5_ctx, tmp);
magic_randcount++;
n = LWIP_MIN(buf_len, MD5_HASH_SIZE);
MEMCPY(buf, tmp, n);