Deleted Added
full compact
entropy.c (181111) entropy.c (221420)
1/*
2 * Copyright (c) 2001 Damien Miller. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 86 unchanged lines hidden (view full) ---

95 fatal("Couldn't fork: %s", strerror(errno));
96 if (pid == 0) {
97 dup2(devnull, STDIN_FILENO);
98 dup2(p[1], STDOUT_FILENO);
99 /* Keep stderr open for errors */
100 close(p[0]);
101 close(p[1]);
102 close(devnull);
1/*
2 * Copyright (c) 2001 Damien Miller. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 86 unchanged lines hidden (view full) ---

95 fatal("Couldn't fork: %s", strerror(errno));
96 if (pid == 0) {
97 dup2(devnull, STDIN_FILENO);
98 dup2(p[1], STDOUT_FILENO);
99 /* Keep stderr open for errors */
100 close(p[0]);
101 close(p[1]);
102 close(devnull);
103 closefrom(STDERR_FILENO + 1);
103
104 if (original_uid != original_euid &&
105 ( seteuid(getuid()) == -1 ||
106 setuid(original_uid) == -1) ) {
107 fprintf(stderr, "(rand child) setuid(%li): %s\n",
108 (long int)original_uid, strerror(errno));
109 _exit(1);
110 }

--- 41 unchanged lines hidden (view full) ---

152init_rng(void)
153{
154 /*
155 * OpenSSL version numbers: MNNFFPPS: major minor fix patch status
156 * We match major, minor, fix and status (not patch)
157 */
158 if ((SSLeay() ^ OPENSSL_VERSION_NUMBER) & ~0xff0L)
159 fatal("OpenSSL version mismatch. Built against %lx, you "
104
105 if (original_uid != original_euid &&
106 ( seteuid(getuid()) == -1 ||
107 setuid(original_uid) == -1) ) {
108 fprintf(stderr, "(rand child) setuid(%li): %s\n",
109 (long int)original_uid, strerror(errno));
110 _exit(1);
111 }

--- 41 unchanged lines hidden (view full) ---

153init_rng(void)
154{
155 /*
156 * OpenSSL version numbers: MNNFFPPS: major minor fix patch status
157 * We match major, minor, fix and status (not patch)
158 */
159 if ((SSLeay() ^ OPENSSL_VERSION_NUMBER) & ~0xff0L)
160 fatal("OpenSSL version mismatch. Built against %lx, you "
160 "have %lx", OPENSSL_VERSION_NUMBER, SSLeay());
161 "have %lx", (u_long)OPENSSL_VERSION_NUMBER, SSLeay());
161
162#ifndef OPENSSL_PRNG_ONLY
163 original_uid = getuid();
164 original_euid = geteuid();
165#endif
166}
167
168#ifndef OPENSSL_PRNG_ONLY

--- 26 unchanged lines hidden ---
162
163#ifndef OPENSSL_PRNG_ONLY
164 original_uid = getuid();
165 original_euid = geteuid();
166#endif
167}
168
169#ifndef OPENSSL_PRNG_ONLY

--- 26 unchanged lines hidden ---