summaryrefslogtreecommitdiffstats
path: root/sys/dev/randomdev/yarrow.c
Commit message (Collapse)AuthorAgeFilesLines
* - Use RFHIGHPID when creating the kthread to get a more sensible pid.jhb2000-09-111-2/+3
| | | | | - Don't fake walking a tailq. Instead, use a while loop that pulls items off the head of the queue while the queue is not empty.
* Large upgrade to the entropy device; mainly inspired by feedbackmarkm2000-09-101-161/+283
| | | | | | | | | | | | | | | | 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-13/+30
| | | | | | | | 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")
* Clean this up with some BDE-inspired fixes.markm2000-07-231-18/+23
| | | | | | | | | | | o Make the comments KNF-compliant. o Use nanotime instead of getnanotime; the manpage lies about the kern.timecounter.method - it has been removed. o Fix the ENTROPYSOURCE const permanently. o Make variable names more consistent. o Make function prototypes more consistent. Some more needs to be done; to follow.
* Add randomness write functionality. This does absolutely nothing formarkm2000-07-171-0/+19
| | | | | | | | | | | | | 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.
* Storing to a pointer is (effectively) atomic; no need to protect thismarkm2000-07-111-2/+2
| | | | | | | with splhigh(). However, the entropy-harvesting routine needs pretty serious irq-protection, as it is called out of irq handlers etc. Clues given by: bde
* I think I need to move the newly static variables to the random_statemarkm2000-07-111-6/+5
| | | | | | structure; remind myself in the cooments. Also regroup all the Yarrow variables at the top of the variable list; they are "special". (no functional change).
* One should never allocate 4-kilobyte structs and such on the interruptgreen2000-07-111-2/+6
| | | | | | | | | | stack. It's bad for your machine's health. Make the two huge structs in reseed() static to prevent crashes. This is the bug that people have been running into and panic()ing on for the past few days. Reviewed by: phk
* Provide more splsofttq() protection for the reseed task (running out ofmarkm2000-07-101-1/+14
| | | | taskqueue_swi).
* Make sure that tasks (running out of taskqueue_swi at splsofttq)markm2000-07-091-0/+5
| | | | are not interfered with by the harvester.
* Yarrow tweaks; separate the fast and slow reseed tasks so that they don'tmarkm2000-07-091-10/+13
| | | | | stomp on each other; provide constant names (as enums) for the harvester to use (makes it more self-documenting).
* Add entropy gathering code. This will work whether the module ismarkm2000-07-071-80/+208
| | | | compiled in or loaded.
* style(9) fixes from BDE.markm2000-06-261-1/+1
| | | | We shouldn't use '#include ""', rather '#include<>'.
* Fix include for non-module case.markm2000-06-251-1/+1
| | | | Thanks-to: SOS
* New machine-independant /dev/random driver.markm2000-06-251-0/+213
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