mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 13:34:38 +08:00
PPP: magic: don't truncate sys_jiffies() return value
It used to be this way because the original implementation was close to the hardware and used a free running 16 bits timer so it was necessary. Currently what it is only doing is removing potential entropy we might get from upper bits, that's a bad idea.
This commit is contained in:
parent
b589864144
commit
d39f929675
@ -117,7 +117,7 @@ static void magic_churnrand(char *rand_data, u32_t rand_len) {
|
|||||||
u32_t rand;
|
u32_t rand;
|
||||||
#endif /* LWIP_RAND */
|
#endif /* LWIP_RAND */
|
||||||
} sys_data;
|
} sys_data;
|
||||||
magic_randomseed += sys_jiffies() & 0xffff;
|
magic_randomseed += sys_jiffies();
|
||||||
sys_data.jiffies = magic_randomseed;
|
sys_data.jiffies = magic_randomseed;
|
||||||
#ifdef LWIP_RAND
|
#ifdef LWIP_RAND
|
||||||
sys_data.rand = LWIP_RAND();
|
sys_data.rand = LWIP_RAND();
|
||||||
@ -244,8 +244,7 @@ void magic_randomize(void) {
|
|||||||
/* The initialization function also updates the seed. */
|
/* The initialization function also updates the seed. */
|
||||||
} else {
|
} else {
|
||||||
#endif /* LWIP_RAND */
|
#endif /* LWIP_RAND */
|
||||||
/* magic_randomseed += (magic_randomseed << 16) + TM1; */
|
magic_randomseed += sys_jiffies();
|
||||||
magic_randomseed += sys_jiffies() & 0xffff; /* XXX */
|
|
||||||
#ifndef LWIP_RAND
|
#ifndef LWIP_RAND
|
||||||
}
|
}
|
||||||
#endif /* LWIP_RAND */
|
#endif /* LWIP_RAND */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user