Mercurial > dropbear
comparison random.c @ 801:7dcb46da72d9 ecc
merge in HEAD
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 21 May 2013 12:09:35 +0800 |
parents | ac2158e3e403 7deb6fda1319 |
children | 4095b6d7c9fc |
comparison
equal
deleted
inserted
replaced
799:c344607b7341 | 801:7dcb46da72d9 |
---|---|
156 { | 156 { |
157 #ifndef DROPBEAR_PRNGD_SOCKET | 157 #ifndef DROPBEAR_PRNGD_SOCKET |
158 /* This is opportunistic, don't worry about failure */ | 158 /* This is opportunistic, don't worry about failure */ |
159 unsigned char buf[INIT_SEED_SIZE]; | 159 unsigned char buf[INIT_SEED_SIZE]; |
160 FILE *f = fopen(DROPBEAR_URANDOM_DEV, "w"); | 160 FILE *f = fopen(DROPBEAR_URANDOM_DEV, "w"); |
161 if (!f) { | |
162 return; | |
163 } | |
161 genrandom(buf, sizeof(buf)); | 164 genrandom(buf, sizeof(buf)); |
162 fwrite(buf, sizeof(buf), 1, f); | 165 fwrite(buf, sizeof(buf), 1, f); |
163 fclose(f); | 166 fclose(f); |
164 #endif | 167 #endif |
165 } | 168 } |