mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-19 23:12:09 +00:00
PPP, magic, improved magic_randomize() for PPP_MD5_RANDM is not enabled
A disabled PPP_MD5_RANDM should not be used when challenge are used, but anyway, improved magic_randomize() so magic_randomseed is not equals to sys_jiffies() which is pretty useless because that's fully predicable.
This commit is contained in:
parent
a24f4421d6
commit
541e3b6eb4
@ -226,17 +226,14 @@ void magic_init(void) {
|
|||||||
* bits.
|
* bits.
|
||||||
*/
|
*/
|
||||||
void magic_randomize(void) {
|
void magic_randomize(void) {
|
||||||
static u32_t last_jiffies;
|
|
||||||
|
|
||||||
if (!magic_randomized) {
|
if (!magic_randomized) {
|
||||||
magic_randomized = !0;
|
magic_randomized = !0;
|
||||||
magic_init();
|
magic_init();
|
||||||
/* The initialization function also updates the seed. */
|
/* The initialization function also updates the seed. */
|
||||||
} else {
|
} else {
|
||||||
/* magic_randomseed += (magic_randomseed << 16) + TM1; */
|
/* magic_randomseed += (magic_randomseed << 16) + TM1; */
|
||||||
magic_randomseed += (sys_jiffies() - last_jiffies); /* XXX */
|
magic_randomseed += sys_jiffies() & 0xffff; /* XXX */
|
||||||
}
|
}
|
||||||
last_jiffies = sys_jiffies();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user