aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/random
Commit message (Collapse)AuthorAgeFilesLines
* Remove unneeded includes.Mark Murray2000-09-214-9/+0
| | | | | | | Submitted by: phk Notes: svn path=/head/; revision=66155
* Include <sys/proc.h> to silence suser() compiler warning.Robert Watson2000-09-181-0/+1
| | | | | | | Approved by: markm Notes: svn path=/head/; revision=66044
* Remove the mtx_t, witness_t, and witness_blessed_t types. Instead, justJohn Baldwin2000-09-141-2/+2
| | | | | | | | | use struct mtx, struct witness, and struct witness_blessed. Requested by: bde Notes: svn path=/head/; revision=65856
* The "struct proc" argument to read_random was ill-conceived, and aMark Murray2000-09-122-2/+2
| | | | | | | | | | | 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 Notes: svn path=/head/; revision=65775
* Move the prototypes for random_set_wakeup* from yarrow.c to yarrow.h so thatJohn Baldwin2000-09-112-2/+2
| | | | | | | | | both yarrow.c and harvest.c can use them. Approved by: markm Notes: svn path=/head/; revision=65752
* - Use RFHIGHPID when creating the kthread to get a more sensible pid.John Baldwin2000-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. Notes: svn path=/head/; revision=65712
* Large upgrade to the entropy device; mainly inspired by feedbackMark Murray2000-09-106-177/+490
| | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=65686
* o Fix a horrible bug where small reads (< 8 bytes) would return theMark Murray2000-07-254-21/+48
| | | | | | | | | | | 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") Notes: svn path=/head/; revision=63855
* Clean this up with some BDE-inspired fixes.Mark Murray2000-07-233-35/+45
| | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=63771
* Add randomness write functionality. This does absolutely nothing forMark Murray2000-07-172-1/+20
| | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=63306
* Storing to a pointer is (effectively) atomic; no need to protect thisMark Murray2000-07-112-10/+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 Notes: svn path=/head/; revision=62969
* I think I need to move the newly static variables to the random_stateMark Murray2000-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). Notes: svn path=/head/; revision=62967
* One should never allocate 4-kilobyte structs and such on the interruptBrian Feldman2000-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 Notes: svn path=/head/; revision=62936
* Provide more splsofttq() protection for the reseed task (running out ofMark Murray2000-07-101-1/+14
| | | | | | | taskqueue_swi). Notes: svn path=/head/; revision=62875
* Make sure that tasks (running out of taskqueue_swi at splsofttq)Mark Murray2000-07-091-0/+5
| | | | | | | are not interfered with by the harvester. Notes: svn path=/head/; revision=62850
* Yarrow tweaks; separate the fast and slow reseed tasks so that they don'tMark Murray2000-07-092-11/+14
| | | | | | | | stomp on each other; provide constant names (as enums) for the harvester to use (makes it more self-documenting). Notes: svn path=/head/; revision=62841
* Fix bug with a vraiable that needs to be per-process, not static;Mark Murray2000-07-091-8/+12
| | | | | | | | | fix formatting of long macros. Pointed out by: bde Notes: svn path=/head/; revision=62840
* Add entropy gathering code. This will work whether the module isMark Murray2000-07-074-121/+365
| | | | | | | compiled in or loaded. Notes: svn path=/head/; revision=62765
* Staticize a variable.Mark Murray2000-06-281-1/+1
| | | | | | | | | | This fixes the case where linking randomdev into the kernel statically can cause panics at shutdown time. Reported by: sos Notes: svn path=/head/; revision=62217
* I am guilty of an act of ommission. There is no longer a /dev/urandomMark Murray2000-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. Notes: svn path=/head/; revision=62149
* style(9) fixes from BDE.Mark Murray2000-06-262-2/+2
| | | | | | | We shouldn't use '#include ""', rather '#include<>'. Notes: svn path=/head/; revision=62117
* Fix include for non-module case.Mark Murray2000-06-251-1/+1
| | | | | | | Thanks-to: SOS Notes: svn path=/head/; revision=62090
* Fix include for the non-module case.Mark Murray2000-06-251-1/+1
| | | | | | | Thanks-to: SOS Notes: svn path=/head/; revision=62087
* New machine-independant /dev/random driver.Mark Murray2000-06-253-0/+400
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 Notes: svn path=/head/; revision=62053