Merging in the changes from 0.41-0.43 main Dropbear tree

--HG--
extra : convert_revision : 4c3428781bc8faf0fd7cadd7099fbd7f4ea386e7
This commit is contained in:
Matt Johnston
2004-08-12 16:41:58 +00:00
parent 538bc5a09e
commit 8e1ec24f55
37 changed files with 548 additions and 230 deletions

View File

@@ -60,7 +60,7 @@ static void readrand(unsigned char* buf, unsigned int buflen) {
#ifdef DROPBEAR_DEV_URANDOM
readfd = open(DEV_URANDOM, O_RDONLY);
if (!readfd) {
if (readfd < 0) {
dropbear_exit("couldn't open random device");
}
#endif
@@ -71,7 +71,8 @@ static void readrand(unsigned char* buf, unsigned int buflen) {
strlcpy(egdsock.sun_path, DROPBEAR_EGD_SOCKET,
sizeof(egdsock.sun_path));
if ((readfd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) {
readfd = socket(PF_UNIX, SOCK_STREAM, 0);
if (readfd < 0) {
dropbear_exit("couldn't open random device");
}
/* todo - try various common locations */