]> andersk Git - openssh.git/blobdiff - entropy.c
- djm@cvs.openbsd.org 2003/11/21 11:57:03
[openssh.git] / entropy.c
index 2d8cec0142c3afee4f02ca06a6fdd00b3449d7c8..96dd3fe18e8be3d0c64afc4c8cc5802ebfac7d20 100644 (file)
--- a/entropy.c
+++ b/entropy.c
@@ -36,9 +36,9 @@
 
 /*
  * Portable OpenSSH PRNG seeding:
- * If OpenSSL has not "internally seeded" itself (e.g. pulled data from 
- * /dev/random), then we execute a "ssh-rand-helper" program which 
- * collects entropy and writes it to stdout. The child program must 
+ * If OpenSSL has not "internally seeded" itself (e.g. pulled data from
+ * /dev/random), then we execute a "ssh-rand-helper" program which
+ * collects entropy and writes it to stdout. The child program must
  * write at least RANDOM_SEED_SIZE bytes. The child is run with stderr
  * attached, so error/debugging output should be visible.
  *
@@ -86,16 +86,16 @@ seed_rng(void)
                close(p[1]);
                close(devnull);
 
-               if (original_uid != original_euid && 
-                   ( seteuid(getuid()) == -1 || 
+               if (original_uid != original_euid &&
+                   ( seteuid(getuid()) == -1 ||
                      setuid(original_uid) == -1) ) {
-                       fprintf(stderr, "(rand child) setuid(%li): %s\n", 
+                       fprintf(stderr, "(rand child) setuid(%li): %s\n",
                            (long int)original_uid, strerror(errno));
                        _exit(1);
                }
                
                execl(SSH_RAND_HELPER, "ssh-rand-helper", NULL);
-               fprintf(stderr, "(rand child) Couldn't exec '%s': %s\n", 
+               fprintf(stderr, "(rand child) Couldn't exec '%s': %s\n",
                    SSH_RAND_HELPER, strerror(errno));
                _exit(1);
        }
@@ -114,12 +114,12 @@ seed_rng(void)
        close(p[0]);
 
        if (waitpid(pid, &ret, 0) == -1)
-              fatal("Couldn't wait for ssh-rand-helper completion: %s", 
+              fatal("Couldn't wait for ssh-rand-helper completion: %s",
                   strerror(errno));
        signal(SIGCHLD, old_sigchld);
 
        /* We don't mind if the child exits upon a SIGPIPE */
-       if (!WIFEXITED(ret) && 
+       if (!WIFEXITED(ret) &&
            (!WIFSIGNALED(ret) || WTERMSIG(ret) != SIGPIPE))
                fatal("ssh-rand-helper terminated abnormally");
        if (WEXITSTATUS(ret) != 0)
@@ -134,7 +134,7 @@ seed_rng(void)
 }
 
 void
-init_rng(void) 
+init_rng(void)
 {
        /*
         * OpenSSL version numbers: MNNFFPPS: major minor fix patch status
This page took 0.296906 seconds and 4 git commands to generate.