Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: syssrc/sys



Module Name:    syssrc
Committed By:   tls
Date:           Sun Oct  6 08:51:46 UTC 2002

Modified Files:
        syssrc/sys/lib/libkern: arc4random.c libkern.h
        syssrc/sys/netkey: key.c

Log Message:
ESP output was drawing down the entropy pool at a ferocious rate, a
particular problem on hosts with only wireless interfaces that are
definitely not safe to use as entropy sources.

Add arc4randbytes() which hands out bytes from the same source used
by arc4random().  This is intended to be a _temporary_ interface
until we can design and implement a better general PRNG interface
that is decoupled from the entropy-pool implementation.

Modify key_randomfill() (used only for initialization vectors on
SA creation and via key_sa_stir_iv(), which does not "stir",
despite its name) to use arc4randbytes() instead of pulling bits
directly from the entropy pool.  It is my hope that this change
will pose minimal integration problems for the KAME folks as the
random-pool interface is *already* different between each BSD
variant; this just simplifies the NetBSD case and solves a
fairly serious problem.

Note that it is generally considered acceptable cryptographic
practice to use a fast stream cipher to generate IVs for encryption
with stronger block ciphers.  For example, the use of "non-Approved"
PRNGs to generate IVs for "Approved" block ciphers is explicitly
sanctioned by FIPS 140-2.


To generate a diff of this commit:
cvs rdiff -r1.7 -r1.8 syssrc/sys/lib/libkern/arc4random.c
cvs rdiff -r1.45 -r1.46 syssrc/sys/lib/libkern/libkern.h
cvs rdiff -r1.77 -r1.78 syssrc/sys/netkey/key.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index