diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | ssh-rand-helper.c | 14 |
2 files changed, 16 insertions, 2 deletions
@@ -1,6 +1,8 @@ | |||
1 | 20050216 | 1 | 20050216 |
2 | - (djm) write seed to temporary file and atomically rename into place; | 2 | - (djm) write seed to temporary file and atomically rename into place; |
3 | ok dtucker@ | 3 | ok dtucker@ |
4 | - (dtucker) [ssh-rand-helper.c] Provide seed_rng since it may be called | ||
5 | via mkstemp in some configurations. ok djm@ | ||
4 | 6 | ||
5 | 20050215 | 7 | 20050215 |
6 | - (dtucker) [config.sh.in] Collect oslevel -r too. | 8 | - (dtucker) [config.sh.in] Collect oslevel -r too. |
@@ -2135,4 +2137,4 @@ | |||
2135 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM | 2137 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM |
2136 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu | 2138 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu |
2137 | 2139 | ||
2138 | $Id: ChangeLog,v 1.3654 2005/02/16 02:02:45 djm Exp $ | 2140 | $Id: ChangeLog,v 1.3655 2005/02/16 02:20:07 dtucker Exp $ |
diff --git a/ssh-rand-helper.c b/ssh-rand-helper.c index 6412d44e2..4da62a724 100644 --- a/ssh-rand-helper.c +++ b/ssh-rand-helper.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #include "pathnames.h" | 39 | #include "pathnames.h" |
40 | #include "log.h" | 40 | #include "log.h" |
41 | 41 | ||
42 | RCSID("$Id: ssh-rand-helper.c,v 1.21 2005/02/16 02:02:45 djm Exp $"); | 42 | RCSID("$Id: ssh-rand-helper.c,v 1.22 2005/02/16 02:20:07 dtucker Exp $"); |
43 | 43 | ||
44 | /* Number of bytes we write out */ | 44 | /* Number of bytes we write out */ |
45 | #define OUTPUT_SEED_SIZE 48 | 45 | #define OUTPUT_SEED_SIZE 48 |
@@ -888,3 +888,15 @@ main(int argc, char **argv) | |||
888 | 888 | ||
889 | return ret == bytes ? 0 : 1; | 889 | return ret == bytes ? 0 : 1; |
890 | } | 890 | } |
891 | |||
892 | /* | ||
893 | * We may attempt to re-seed during mkstemp if we are using the one in the | ||
894 | * compat library (via mkstemp -> arc4random -> seed_rng) so we need | ||
895 | * our own seed_rng(). We must also check that we have enough entropy. | ||
896 | */ | ||
897 | void | ||
898 | seed_rng(void) | ||
899 | { | ||
900 | if (!RAND_status()) | ||
901 | fatal("Not enough entropy in RNG"); | ||
902 | } | ||