diff options
author | markm <markm@FreeBSD.org> | 2000-12-02 16:23:54 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2000-12-02 16:23:54 +0000 |
commit | 5a9b5f7c13b9e66c51e945e9e98f9e3163445047 (patch) | |
tree | 59b70eb740f980c6ed8bb4d5debffe44ebf7f888 /sys/libkern | |
parent | 0bade0c2305334e18603cda7f57c438309fe8bcc (diff) | |
download | FreeBSD-src-5a9b5f7c13b9e66c51e945e9e98f9e3163445047.zip FreeBSD-src-5a9b5f7c13b9e66c51e945e9e98f9e3163445047.tar.gz |
Recouple arc4random(9) to the entropy device. This works whether the
entropy device is loaded or not.
If the entropy device is NOT loaded, the the quality of perturbations
supplied by this will suffer.
Diffstat (limited to 'sys/libkern')
-rw-r--r-- | sys/libkern/arc4random.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/libkern/arc4random.c b/sys/libkern/arc4random.c index 9abba83..477c742 100644 --- a/sys/libkern/arc4random.c +++ b/sys/libkern/arc4random.c @@ -40,8 +40,10 @@ arc4_randomstir (void) u_int8_t key[256]; int r, n; - /* r = read_random(key, sizeof(key)); */ - r = 0; /* XXX MarkM - revisit this when /dev/random is done */ + /* XXX read_random() returns unsafe numbers if the entropy + * devce is not loaded - MarkM + */ + r = read_random(key, sizeof(key)); /* if r == 0 || -1, just use what was on the stack */ if (r > 0) { |