diff options
author | cy <cy@FreeBSD.org> | 2017-08-03 14:22:48 +0000 |
---|---|---|
committer | cy <cy@FreeBSD.org> | 2017-08-03 14:22:48 +0000 |
commit | deb2c537f5ca5924fc0060f8bb3f7d5ef2b0772d (patch) | |
tree | 9c3ab36ca92db85402f2520f3f145ed821e6ec05 | |
parent | 01075602daf16b8df947db27af2c5a701cb9d661 (diff) | |
download | FreeBSD-src-deb2c537f5ca5924fc0060f8bb3f7d5ef2b0772d.zip FreeBSD-src-deb2c537f5ca5924fc0060f8bb3f7d5ef2b0772d.tar.gz |
MFC r321605:
As in r315225, discard 3072 bytes of RC4 bytestream instead of 1024.
(This implementation of arc4rand(9) is used by the userland ipftest
utility as it approximates ipfilter kernelspace in userspace.)
PR: 217920
Submitted by: codarren@hackers.mu
Reviewed by: emaste, cem
Approved by: so (implicit, in r315225)
Differential Revision: D11747
Patterned after: r315225
-rw-r--r-- | contrib/ipfilter/arc4random.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/ipfilter/arc4random.c b/contrib/ipfilter/arc4random.c index 04b0797..4994287 100644 --- a/contrib/ipfilter/arc4random.c +++ b/contrib/ipfilter/arc4random.c @@ -109,9 +109,9 @@ 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.) */ - for (n = 0; n < 256*4; n++) + for (n = 0; n < 768*4; n++) arc4_randbyte(); MUTEX_EXIT(&arc4_mtx); } |