summaryrefslogtreecommitdiffstats
path: root/sys/dev/random/randomdev.c
Commit message (Collapse)AuthorAgeFilesLines
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-011-6/+8
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Send the remains (such as I have located) of "block major numbers" tophk2001-03-261-1/+0
| | | | the bit-bucket.
* Allow bog-standard ioctls through. There are really handled inmarkm2001-03-251-1/+9
| | | | higher layers, but there needs to be a "no-error" return here.
* Very large makeover of the /dev/random driver.markm2001-03-101-91/+244
| | | | | | | | | | | | | | | | | | | | | | | | o Separate the kernel stuff from the Yarrow algorithm. Yarrow is now well contained in one source file and one header. o Replace the Blowfish-based crypto routines with Rijndael-based ones. (Rijndael is the new AES algorithm). The huge improvement in Rijndael's key-agility over Blowfish means that this is an extremely dramatic improvement in speed, and makes a heck of a difference in its (lack of) CPU load. o Clean up the sysctl's. At BDE's prompting, I have gone back to static sysctls. o Bug fixes. The streamlining of the crypto stuff enabled me to find and fix some bugs. DES also found a bug in the reseed routine which is fixed. o Change the way reseeds clear "used" entropy. Previously, only the source(s) that caused a reseed were cleared. Now all sources in the relevant pool(s) are cleared. o Code tidy-up. Mostly to make it (nearly) 80-column compliant.
* Provide the infrastructure for sysadmins to select the broad classmarkm2001-02-181-1/+13
| | | | | of entropy harvesting they wish to perform: "ethernet" (LAN), point-to-point and interrupt.
* Remove NOBLOCKRANDOM as a compile-time option. Instead, providemarkm2001-01-141-19/+52
| | | | | | | | | | | | | | | | exactly the same functionality via a sysctl, making this feature a run-time option. The default is 1(ON), which means that /dev/random device will NOT block at startup. setting kern.random.sys.seeded to 0(OFF) will cause /dev/random to block until the next reseed, at which stage the sysctl will be changed back to 1(ON). While I'm here, clean up the sysctls, and make them dynamic. Reviewed by: des Tested on Alpha by: obrien
* select() DKI is now in <sys/selinfo.h>.wollman2001-01-091-1/+1
|
* D'uh. The explicit reseed was happening at the wrong security/priveligemarkm2000-11-251-1/+1
| | | | levels.
* Greatly improve the boot-up unblocking time of the entropy device.markm2000-11-251-1/+10
|
* Move suser() and suser_xxx() prototypes and a related #define fromphk2000-10-291-1/+0
| | | | | | | | | <sys/proc.h> to <sys/systm.h>. Correctly document the #includes needed in the manpage. Add one now needed #include of <sys/systm.h>. Remove the consequent 48 unused #includes of <sys/proc.h>.
* As the blocking model has seems to be troublesome for many, disablemarkm2000-10-271-0/+5
| | | | | | | it for now with an option. This option is already deprecated, and will be removed when the entropy-harvesting code is fast enough to warrant it.
* Attempt to fix the random read blocking. The old code slept atpeter2000-10-181-14/+13
| | | | | | | | priority "0" and without PCATCH, so it was uninterruptable. And even when it did wake up after entropy arrived, it exited after the wakeup without actually reading the freshly arrived entropy. I sent this to Mark before but it seems he is in transit. Mark: feel free to replace this if it gets in your way.
* After some complaints about the dir names, the random device ismarkm2000-10-141-9/+37
| | | | | | | | | | | | | | | | | | | | now in dirs called sys/*/random/ instead of sys/*/randomdev/*. Introduce blocking, but only at startup; the random device will block until the first reseed happens to prevent clients from using untrustworthy output. Provide a read_random() call for the rest of the kernel so that the entropy device does not need to be present. This means that things like IPX no longer need to have "device random" hardcoded into thir kernel config. The downside is that read_random() will provide very poor output until the entropy device is loaded and reseeded. It is recommended that developers do NOT use the read_random() call; instead, they should use arc4random() which internally uses read_random(). Clean up the mutex and locking code a bit; this makes it possible to unload the module again.
* Remove unneeded includes.markm2000-09-211-2/+0
| | | | Submitted by: phk
* Include <sys/proc.h> to silence suser() compiler warning.rwatson2000-09-181-0/+1
| | | | Approved by: markm
* The "struct proc" argument to read_random was ill-conceived, and amarkm2000-09-121-1/+1
| | | | | | | | hangover from previous experimentation. Remove it. This will clean up gratuitous needs for forward references and other namespace pollution. Moaned about by: bde Brought to my attention by: bp
* Large upgrade to the entropy device; mainly inspired by feedbackmarkm2000-09-101-6/+18
| | | | | | | | | | | | | | | | from many folk. o The reseed process is now a kthread. With SMPng, kthreads are pre-emptive, so the annoying jerkiness of the mouse is gone. o The data structures are protected by mutexes now, not splfoo()/splx(). o The cryptographic routines are broken out into their own subroutines. this facilitates review, and possible replacement if that is ever found necessary. Thanks to: kris, green, peter, jasone, grog, jhb Forgotten to thank: You know who you are; no offense intended.
* o Fix a horrible bug where small reads (< 8 bytes) would return themarkm2000-07-251-2/+12
| | | | | | | | wrong bytes. o Improve the public interface; use void* instead of char* or u_int64_t to pass arbitrary data around. Submitted by: kris ("horrible bug")
* Add randomness write functionality. This does absolutely nothing formarkm2000-07-171-1/+1
| | | | | | | | | | | | | entropy estimation, but causes an immediate reseed after the input (read in sizeof(u_int64_t) chunks) is "harvested". This will be used in the reboot "reseeder", coming in another commit. This can be used very effectively at any time you think your randomness is compromised; something like # (ps -gauxwww; netstat -an; dmesg; vmstat -c10 1) > /dev/random will give the attacker something to think about.
* Fix bug with a vraiable that needs to be per-process, not static;markm2000-07-091-8/+12
| | | | | | fix formatting of long macros. Pointed out by: bde
* Add entropy gathering code. This will work whether the module ismarkm2000-07-071-31/+31
| | | | compiled in or loaded.
* Staticize a variable.markm2000-06-281-1/+1
| | | | | | | This fixes the case where linking randomdev into the kernel statically can cause panics at shutdown time. Reported by: sos
* I am guilty of an act of ommission. There is no longer a /dev/urandommarkm2000-06-271-1/+6
| | | | | | | | | | device with Yarrow, and although I coded for that in dev/MAKEDEV, I forgot to _tell_ folks. This commit adds back the /dev/urandom device (as a duplicate) of /dev/random, until such time as it can be properly announced. This will help the openssl users quite a lot.
* style(9) fixes from BDE.markm2000-06-261-1/+1
| | | | We shouldn't use '#include ""', rather '#include<>'.
* Fix include for the non-module case.markm2000-06-251-1/+1
| | | | Thanks-to: SOS
* New machine-independant /dev/random driver.markm2000-06-251-0/+145
This is work-in-progress, and the entropy-gathering routines are not yet present. As such, this should be viewed as a pretty reasonable PRNG with _ABSOLUTELY_NO_ security!! Entropy gathering will be the subject of ongoing work. This is written as a module, and as such is unloadable, but there is no refcounting done. I would like to use something like device_busy(9) to achieve this (eventually). Lots of useful ideas from: bde, phk, Jeroen van Gelderen Reviewed by: dfr
OpenPOWER on IntegriCloud