mirror of https://github.com/getdnsapi/getdns.git
arc4random in secret generation
This commit is contained in:
parent
d06d94a0c7
commit
19547536ac
|
@ -58,13 +58,13 @@ rollover_secret()
|
||||||
* boundry with old cookie.
|
* boundry with old cookie.
|
||||||
*/
|
*/
|
||||||
prev_secret = secret;
|
prev_secret = secret;
|
||||||
secret = (ldns_get_random() << 16) | ldns_get_random();
|
secret = arc4random();
|
||||||
|
|
||||||
/* Next rollover over EDNS_COOKIE_ROLLOVER_TIME with 30% jitter,
|
/* Next rollover over EDNS_COOKIE_ROLLOVER_TIME with 30% jitter,
|
||||||
* I.e. some offset + or - 15% of the future point in time.
|
* I.e. some offset + or - 15% of the future point in time.
|
||||||
*/
|
*/
|
||||||
secret_rollover_time = now + (EDNS_COOKIE_ROLLOVER_TIME / 20 * 17)
|
secret_rollover_time = now + (EDNS_COOKIE_ROLLOVER_TIME / 20 * 17)
|
||||||
+ (ldns_get_random()%(EDNS_COOKIE_ROLLOVER_TIME / 10 * 3));
|
+ arc4random_uniform(EDNS_COOKIE_ROLLOVER_TIME / 10 * 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue