Date: Tue, 14 Mar 2017 06:10:41 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315226 - in stable/11: lib/libc/gen sys/libkern Message-ID: <201703140610.v2E6Af2N071535@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: delphij Date: Tue Mar 14 06:10:40 2017 New Revision: 315226 URL: https://svnweb.freebsd.org/changeset/base/315226 Log: 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 Modified: stable/11/lib/libc/gen/arc4random.c stable/11/sys/libkern/arc4random.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/arc4random.c ============================================================================== --- stable/11/lib/libc/gen/arc4random.c Tue Mar 14 06:00:44 2017 (r315225) +++ stable/11/lib/libc/gen/arc4random.c Tue Mar 14 06:10:40 2017 (r315226) @@ -171,7 +171,7 @@ arc4_stir(void) * Discard early keystream, as per recommendations in: * "(Not So) Random Shuffles of RC4" by Ilya Mironov. */ - for (i = 0; i < 1024; i++) + for (i = 0; i < 3072; i++) (void)arc4_getbyte(); arc4_count = 1600000; } Modified: stable/11/sys/libkern/arc4random.c ============================================================================== --- stable/11/sys/libkern/arc4random.c Tue Mar 14 06:00:44 2017 (r315225) +++ stable/11/sys/libkern/arc4random.c Tue Mar 14 06:10:40 2017 (r315226) @@ -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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703140610.v2E6Af2N071535>