Fortuna
Subsystems (3)
Ahh. Thanks Herbert.
Matt,
Any insight on how to test syn cookies and the other network stuff in random.c? My patch is attached, but I havn't tested that part yet.
JLC
----- Forwarded message from Herbert Xu <[email protected]> -----
Envelope-to: [email protected]
Delivery-date: Wed, 13 Apr 2005 17:39:54 -0400
To: Jean-Luc Cooke <[email protected]>
Subject: Re: [PATCH] API for TRNG (2.6.11) [Fortuna]
From: Herbert Xu <[email protected]>
X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on certainkey.com X-Spam-Level:
X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=unavailable
version=3.0.2
Quoted 1 line · Jean-Luc Cooke
Patch attached.
You might want to CC the current /dev/random maintainer Matt Mackall <[email protected]>.
Signature · 6 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
----- End forwarded message -----crypto/Kconfig +14 -0
@@ -9,6 +9,20 @@ help This option provides the core Cryptographic API. +config CRYPTO_RANDOM_FORTUNA + bool "The Fortuna CSRNG" + depends on CRYPTO && EXPERIMENTAL + select CRYPTO_SHA256 + select CRYPTO_AES if !(CRYPTO && (X86 && !X86_64)) + select CRYPTO_AES_586 if CRYPTO && (X86 && !X86_64) + help + Replaces the legacy Linux RNG with one using the CryptoAPI + and Fortuna designed by Ferguson and Schneier. Entropy estimation, + and a throttled /dev/random remain. Improvements include faster + /dev/urandom output and event input mixing. Entropy estimation + can be removed by changing source code. + Note: Requires AES and SHA256 to be built-in. + config CRYPTO_HMAC bool "HMAC support" depends on CRYPTO
drivers/char/random-fortuna.c +2121 -0
2,121 lines not on this page · raw message
drivers/char/Makefile +7 -1
@@ -7,7 +7,13 @@ # FONTMAPFILE = cp437.uni -obj-y += mem.o random.o tty_io.o n_tty.o tty_ioctl.o +obj-y += mem.o +ifeq ($(CONFIG_CRYPTO_RANDOM_FORTUNA),y) + obj-y += random-fortuna.o +else + obj-y += random.o +endif +obj-y += tty_io.o n_tty.o tty_ioctl.o obj-$(CONFIG_LEGACY_PTYS) += pty.o obj-$(CONFIG_UNIX98_PTYS) += pty.o
include/linux/sysctl.h +3 -1
@@ -202,7 +202,9 @@RANDOM_READ_THRESH =3 ,RANDOM_WRITE_THRESH =4 ,RANDOM_BOOT_ID =5 , - RANDOM_UUID=6 +RANDOM_UUID =6 , +RANDOM_DIGEST_ALGO =7 , + RANDOM_CIPHER_ALGO=8 };/* /proc/sys/kernel/pty */
Quoted 6 lines · Jean-Luc Cooke
Ahh. Thanks Herbert.
Matt,
Any insight on how to test syn cookies and the other network stuff in
random.c? My patch is attached, but I havn't tested that part yet.
For starters, this is not against anything like a current random.c. A great number of cleanups have been done.
Syncookies are perhaps best tested with printk of the cookie ingredients in the generation and check steps.
Signature · 1 line
Mathematics is the supreme nostalgia of our time.
Quoted 10 lines · Matt Mackall
Quoted 6 lines · Jean-Luc Cooke
Ahh. Thanks Herbert.
Matt,
Any insight on how to test syn cookies and the other network stuff in
random.c? My patch is attached, but I havn't tested that part yet.For starters, this is not against anything like a current
random.c. A great number of cleanups have been done.
You caught me. :)
Last I proposed Fortuna for /dev/random it nearly got me drawn and quarterd. So I've left it as a kenrel config option, leaving the current random.c alone. I thought this was a way to make everyone happy.
JLC
Quoted 9 lines · Jean-Luc Cooke
Quoted 8 lines · Matt Mackall
Quoted 6 lines · Jean-Luc Cooke
Ahh. Thanks Herbert.
Matt,
Any insight on how to test syn cookies and the other network stuff in
random.c? My patch is attached, but I havn't tested that part yet.
Quoted 6 lines
Quoted 2 lines
For starters, this is not against anything like a current
random.c. A great number of cleanups have been done.You caught me. :)
Last I proposed Fortuna for
/dev/randomit nearly got me drawn and quarterd.
It still might. Ted and I are as yet unconvince that the Fortuna approach is superior. While it may have some good properties, it lacks some that random.c has, particularly robustness in the face of failure of crypto primitives.
Quoted 2 lines
So I've left it as a kenrel config option, leaving the current
random.calone. I thought this was a way to make everyone happy.
Duplicated code rarely does that.
At any rate, you ought to review the changes (there've been 40+ patches recently). There are a number of bug fixes in there and quite a bit of cleanup. Syncookies in particular no longer live in random.c.
Signature · 1 line
Mathematics is the supreme nostalgia of our time.
Quoted 3 lines · Matt Mackall
While it may have some good properties, it lacks
some thatrandom.chas, particularly robustness in the face of failure of crypto primitives.
It's probably not a big deal, because I'm not worried about the failure of standard crypto primitives, but--
Do you know of any analysis to back up the claim that /dev/random will be robust in the failure of crypto primitives? I have never seen anyone try to do such an analysis, but maybe you know of something that I don't.