diff options
author | delphij <delphij@FreeBSD.org> | 2017-03-14 06:10:40 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2017-03-14 06:10:40 +0000 |
commit | 01f2515b04c5ea1eca6a0d15a31abc0f7d6137c4 (patch) | |
tree | bca8a05d35931fb61db6c4230d4164a9ea192ece /sys/libkern | |
parent | e06e586c2f3b8d707fe016b3a038e1148080fa0a (diff) | |
download | FreeBSD-src-01f2515b04c5ea1eca6a0d15a31abc0f7d6137c4.zip FreeBSD-src-01f2515b04c5ea1eca6a0d15a31abc0f7d6137c4.tar.gz |
MFC r315225:
Discard first 3072 bytes of RC4 keystream, this is a bandaid
that allows us to work on switching to a more modern PRNG.
Submitted by: Steven Chamberlain <steven pyro eu org>
Approved by: so
Diffstat (limited to 'sys/libkern')
-rw-r--r-- | sys/libkern/arc4random.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/libkern/arc4random.c b/sys/libkern/arc4random.c index 9de5a84..d230aa2 100644 --- a/sys/libkern/arc4random.c +++ b/sys/libkern/arc4random.c @@ -72,11 +72,11 @@ arc4_randomstir(void) /* * Throw away the first N words of output, as suggested in the * paper "Weaknesses in the Key Scheduling Algorithm of RC4" - * by Fluher, Mantin, and Shamir. (N = 256 in our case.) + * by Fluher, Mantin, and Shamir. (N = 768 in our case.) * * http://dl.acm.org/citation.cfm?id=646557.694759 */ - for (n = 0; n < 256*4; n++) + for (n = 0; n < 768*4; n++) arc4_randbyte(); mtx_unlock(&arc4_mtx); } |