2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

[master] isc_rng_randombytes()

4807.	[cleanup]	isc_rng_randombytes() returns a specified number of
			bytes from the PRNG; this is now used instead of
			calling isc_rng_random() multiple times. [RT #46230]
This commit is contained in:
Mukund Sivaraman
2017-11-06 10:44:37 -08:00
committed by Evan Hunt
parent 72ddd51e74
commit 7e1df5182c
9 changed files with 155 additions and 67 deletions

View File

@@ -1648,8 +1648,8 @@ ns_client_addopt(ns_client_t *client, dns_message_t *message,
isc_buffer_init(&buf, cookie, sizeof(cookie));
isc_stdtime_get(&now);
nonce = ((isc_rng_random(client->sctx->rngctx) << 16) |
isc_rng_random(client->sctx->rngctx));
isc_rng_randombytes(client->sctx->rngctx,
&nonce, sizeof(nonce));
compute_cookie(client, now, nonce, client->sctx->secret, &buf);