summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-06-18 14:07:04 +1000
committerDamien Miller <djm@mindrot.org>2000-06-18 14:07:04 +1000
commit7b22d65034ac280e0b4eaa857c71b17ee3ad7d99 (patch)
treeb4fd3f622d95a30394908bc7e9aa30a3658e7b4f
parent1a13225d877ffdd035659bf5577d5aff388bb317 (diff)
- (djm) Add summary of configure options to end of ./configure run
- (djm) Not all systems define RUSAGE_SELF & RUSAGE_CHILDREN. Report from Michael Stone <mstone@cs.loyola.edu> - (djm) rusage is a privileged operation on some Unices (incl. Solaris 2.5.1). Report from Paul D. Smith <pausmith@nortelnetworks.com> - (djm) Avoid PAM failures when running without a TTY. Report from Martin Petrak <petrak@spsknm.schools.sk> - (djm) Include sys/types.h when including netinet/in.h in configure tests. Patch from Jun-ichiro itojun Hagino <itojun@iijlab.net>
-rw-r--r--ChangeLog11
-rw-r--r--auth-pam.c8
-rw-r--r--configure.in95
-rw-r--r--entropy.c19
4 files changed, 118 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 1baf23475..9ca8e55ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
120000618
2 - (djm) Add summary of configure options to end of ./configure run
3 - (djm) Not all systems define RUSAGE_SELF & RUSAGE_CHILDREN. Report from
4 Michael Stone <mstone@cs.loyola.edu>
5 - (djm) rusage is a privileged operation on some Unices (incl.
6 Solaris 2.5.1). Report from Paul D. Smith <pausmith@nortelnetworks.com>
7 - (djm) Avoid PAM failures when running without a TTY. Report from
8 Martin Petrak <petrak@spsknm.schools.sk>
9 - (djm) Include sys/types.h when including netinet/in.h in configure tests.
10 Patch from Jun-ichiro itojun Hagino <itojun@iijlab.net>
11
120000613 1220000613
2 - (djm) Fixes from Andrew McGill <andrewm@datrix.co.za>: 13 - (djm) Fixes from Andrew McGill <andrewm@datrix.co.za>:
3 - Platform define for SCO 3.x which breaks on /dev/ptmx 14 - Platform define for SCO 3.x which breaks on /dev/ptmx
diff --git a/auth-pam.c b/auth-pam.c
index 67a851d1b..8ceb26917 100644
--- a/auth-pam.c
+++ b/auth-pam.c
@@ -34,7 +34,7 @@
34#include "xmalloc.h" 34#include "xmalloc.h"
35#include "servconf.h" 35#include "servconf.h"
36 36
37RCSID("$Id: auth-pam.c,v 1.6 2000/06/12 06:38:54 djm Exp $"); 37RCSID("$Id: auth-pam.c,v 1.7 2000/06/18 04:07:04 djm Exp $");
38 38
39#define NEW_AUTHTOK_MSG \ 39#define NEW_AUTHTOK_MSG \
40 "Warning: You password has expired, please change it now" 40 "Warning: You password has expired, please change it now"
@@ -246,6 +246,12 @@ void start_pam(struct passwd *pw)
246 PAM_STRERROR((pam_handle_t *)pamh, pam_retval)); 246 PAM_STRERROR((pam_handle_t *)pamh, pam_retval));
247 } 247 }
248 248
249 pam_retval = pam_set_item((pam_handle_t *)pamh, PAM_TTY, "ssh");
250 if (pam_retval != PAM_SUCCESS) {
251 fatal("PAM set tty failed: %.200s",
252 PAM_STRERROR((pam_handle_t *)pamh, pam_retval));
253 }
254
249 fatal_add_cleanup(&pam_cleanup_proc, NULL); 255 fatal_add_cleanup(&pam_cleanup_proc, NULL);
250} 256}
251 257
diff --git a/configure.in b/configure.in
index 0e755e4b7..f0edebacc 100644
--- a/configure.in
+++ b/configure.in
@@ -208,12 +208,14 @@ AC_CHECK_FUNC(getpagesize,
208 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])] 208 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
209) 209)
210 210
211PAM_MSG="no"
211AC_ARG_WITH(pam, 212AC_ARG_WITH(pam,
212 [ --without-pam Disable PAM support ], 213 [ --without-pam Disable PAM support ],
213 [ 214 [
214 if test "x$withval" = "xno" ; then 215 if test "x$withval" = "xno" ; then
215 no_pam=1 216 no_pam=1
216 AC_DEFINE(DISABLE_PAM) 217 AC_DEFINE(DISABLE_PAM)
218 PAM_MSG="disabled"
217 fi 219 fi
218 ] 220 ]
219) 221)
@@ -223,6 +225,8 @@ if test -z "$no_pam" -a "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then
223 225
224 AC_CHECK_FUNCS(pam_getenvlist) 226 AC_CHECK_FUNCS(pam_getenvlist)
225 227
228 PAM_MSG="yes"
229
226 # Check PAM strerror arguments (old PAM) 230 # Check PAM strerror arguments (old PAM)
227 AC_MSG_CHECKING([whether pam_strerror takes only one argument]) 231 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
228 AC_TRY_COMPILE( 232 AC_TRY_COMPILE(
@@ -235,6 +239,7 @@ if test -z "$no_pam" -a "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then
235 [ 239 [
236 AC_DEFINE(HAVE_OLD_PAM) 240 AC_DEFINE(HAVE_OLD_PAM)
237 AC_MSG_RESULT(yes) 241 AC_MSG_RESULT(yes)
242 PAM_MSG="yes (old library)"
238 ] 243 ]
239 ) 244 )
240fi 245fi
@@ -353,13 +358,17 @@ done
353 358
354if test ! -z "$no_rsa" ; then 359if test ! -z "$no_rsa" ; then
355 AC_MSG_RESULT(disabled) 360 AC_MSG_RESULT(disabled)
361 RSA_MSG="disabled"
356else 362else
357 if test -z "$rsa_works" ; then 363 if test -z "$rsa_works" ; then
358 AC_MSG_WARN([*** No RSA support found *** ]) 364 AC_MSG_WARN([*** No RSA support found *** ])
365 RSA_MSG="no"
359 else 366 else
360 if test -z "$WANTS_RSAREF" ; then 367 if test -z "$WANTS_RSAREF" ; then
361 AC_MSG_RESULT(yes) 368 AC_MSG_RESULT(yes)
369 RSA_MSG="yes"
362 else 370 else
371 RSA_MSG="yes (using RSAref)"
363 AC_MSG_RESULT(using RSAref) 372 AC_MSG_RESULT(using RSAref)
364 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref" 373 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
365 fi 374 fi
@@ -501,6 +510,7 @@ fi
501AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [ 510AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
502 AC_TRY_COMPILE( 511 AC_TRY_COMPILE(
503 [ 512 [
513#include <sys/types.h>
504#include <netinet/in.h> 514#include <netinet/in.h>
505 ], 515 ],
506 [ struct sockaddr_in6 s; s.sin6_family = 0; ], 516 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
@@ -515,6 +525,7 @@ fi
515AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [ 525AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
516 AC_TRY_COMPILE( 526 AC_TRY_COMPILE(
517 [ 527 [
528#include <sys/types.h>
518#include <netinet/in.h> 529#include <netinet/in.h>
519 ], 530 ],
520 [ struct in6_addr s; s.s6_addr[0] = 0; ], 531 [ struct in6_addr s; s.s6_addr[0] = 0; ],
@@ -562,8 +573,6 @@ OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
562OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX) 573OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
563OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX) 574OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
564 575
565
566
567AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], 576AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
568 ac_cv_have_ss_family_in_struct_ss, [ 577 ac_cv_have_ss_family_in_struct_ss, [
569 AC_TRY_COMPILE( 578 AC_TRY_COMPILE(
@@ -580,7 +589,6 @@ if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
580 AC_DEFINE(HAVE_SS_FAMILY_IN_SS) 589 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
581fi 590fi
582 591
583
584AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage], 592AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
585 ac_cv_have___ss_family_in_struct_ss, [ 593 ac_cv_have___ss_family_in_struct_ss, [
586 AC_TRY_COMPILE( 594 AC_TRY_COMPILE(
@@ -615,7 +623,7 @@ AC_ARG_WITH(rsh,
615 [ --with-rsh=PATH Specify path to remote shell program ], 623 [ --with-rsh=PATH Specify path to remote shell program ],
616 [ 624 [
617 if test "x$withval" != "$no" ; then 625 if test "x$withval" != "$no" ; then
618 AC_DEFINE_UNQUOTED(RSH_PATH, "$withval") 626 rsa_path=$withval
619 fi 627 fi
620 ], 628 ],
621 [ 629 [
@@ -627,7 +635,7 @@ AC_ARG_WITH(xauth,
627 [ --with-xauth=PATH Specify path to xauth program ], 635 [ --with-xauth=PATH Specify path to xauth program ],
628 [ 636 [
629 if test "x$withval" != "$xno" ; then 637 if test "x$withval" != "$xno" ; then
630 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$withval") 638 xauth_path=$withval
631 fi 639 fi
632 ], 640 ],
633 [ 641 [
@@ -746,6 +754,7 @@ AC_SUBST(MANTYPE)
746AC_SUBST(mansubdir) 754AC_SUBST(mansubdir)
747 755
748# Check whether user wants Kerberos support 756# Check whether user wants Kerberos support
757KRB4_MSG="no"
749AC_ARG_WITH(kerberos4, 758AC_ARG_WITH(kerberos4,
750 [ --with-kerberos4=PATH Enable Kerberos 4 support], 759 [ --with-kerberos4=PATH Enable Kerberos 4 support],
751 [ 760 [
@@ -778,12 +787,14 @@ AC_ARG_WITH(kerberos4,
778 KLIBS="-lkrb -ldes" 787 KLIBS="-lkrb -ldes"
779 AC_CHECK_LIB(resolv, dn_expand, , ) 788 AC_CHECK_LIB(resolv, dn_expand, , )
780 KRB4=yes 789 KRB4=yes
790 KRB4_MSG="yes"
781 AC_DEFINE(KRB4) 791 AC_DEFINE(KRB4)
782 fi 792 fi
783 ] 793 ]
784) 794)
785 795
786# Check whether user wants AFS support 796# Check whether user wants AFS support
797AFS_MSG="no"
787AC_ARG_WITH(afs, 798AC_ARG_WITH(afs,
788 [ --with-afs=PATH Enable AFS support], 799 [ --with-afs=PATH Enable AFS support],
789 [ 800 [
@@ -803,23 +814,27 @@ AC_ARG_WITH(afs,
803 LIBS="$LIBS $AFS_LIBS" 814 LIBS="$LIBS $AFS_LIBS"
804 fi 815 fi
805 AC_DEFINE(AFS) 816 AC_DEFINE(AFS)
817 AFS_MSG="yes"
806 fi 818 fi
807 ] 819 ]
808) 820)
809LIBS="$LIBS $KLIBS" 821LIBS="$LIBS $KLIBS"
810 822
811# Check whether user wants S/Key support 823# Check whether user wants S/Key support
824SKEY_MSG="no"
812AC_ARG_WITH(skey, 825AC_ARG_WITH(skey,
813 [ --with-skey Enable S/Key support], 826 [ --with-skey Enable S/Key support],
814 [ 827 [
815 if test "x$withval" != "xno" ; then 828 if test "x$withval" != "xno" ; then
816 AC_DEFINE(SKEY) 829 AC_DEFINE(SKEY)
817 LIBS="$LIBS -lskey" 830 LIBS="$LIBS -lskey"
831 SKEY_MSG="yes"
818 fi 832 fi
819 ] 833 ]
820) 834)
821 835
822# Check whether user wants TCP wrappers support 836# Check whether user wants TCP wrappers support
837TCPW_MSG="no"
823AC_ARG_WITH(tcp-wrappers, 838AC_ARG_WITH(tcp-wrappers,
824 [ --with-tcp-wrappers Enable tcpwrappers support], 839 [ --with-tcp-wrappers Enable tcpwrappers support],
825 [ 840 [
@@ -836,11 +851,10 @@ AC_ARG_WITH(tcp-wrappers,
836 [ 851 [
837 AC_MSG_RESULT(yes) 852 AC_MSG_RESULT(yes)
838 AC_DEFINE(LIBWRAP) 853 AC_DEFINE(LIBWRAP)
854 TCPW_MSG="yes"
839 ], 855 ],
840 [ 856 [
841 AC_MSG_RESULT(no) 857 AC_MSG_ERROR([*** libwrap missing])
842 AC_MSG_WARN([*** libwrap missing - tcpwrapper support disabled ***])
843 LIBS="$saved_LIBS"
844 ] 858 ]
845 ) 859 )
846 fi 860 fi
@@ -848,11 +862,13 @@ AC_ARG_WITH(tcp-wrappers,
848) 862)
849 863
850# Check whether to enable MD5 passwords 864# Check whether to enable MD5 passwords
865MD5_MSG="no"
851AC_ARG_WITH(md5-passwords, 866AC_ARG_WITH(md5-passwords,
852 [ --with-md5-passwords Enable use of MD5 passwords], 867 [ --with-md5-passwords Enable use of MD5 passwords],
853 [ 868 [
854 if test "x$withval" != "xno" ; then 869 if test "x$withval" != "xno" ; then
855 AC_DEFINE(HAVE_MD5_PASSWORDS) 870 AC_DEFINE(HAVE_MD5_PASSWORDS)
871 MD5_MSG="yes"
856 fi 872 fi
857 ] 873 ]
858) 874)
@@ -868,42 +884,50 @@ AC_ARG_WITH(shadow,
868) 884)
869 885
870# Use ip address instead of hostname in $DISPLAY 886# Use ip address instead of hostname in $DISPLAY
887DISPLAY_HACK_MSG="no"
871AC_ARG_WITH(ipaddr-display, 888AC_ARG_WITH(ipaddr-display,
872 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], 889 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
873 [ 890 [
874 if test "x$withval" = "xno" ; then 891 if test "x$withval" = "xno" ; then
875 AC_DEFINE(IPADDR_IN_DISPLAY) 892 AC_DEFINE(IPADDR_IN_DISPLAY)
893 DISPLAY_HACK_MSG="yes"
876 fi 894 fi
877 ] 895 ]
878) 896)
879 897
880# Whether to mess with the default path 898# Whether to mess with the default path
899SERVER_PATH_MSG="(default)"
881AC_ARG_WITH(default-path, 900AC_ARG_WITH(default-path,
882 [ --with-default-path=PATH Specify default \$PATH environment for server], 901 [ --with-default-path=PATH Specify default \$PATH environment for server],
883 [ 902 [
884 if test "x$withval" != "xno" ; then 903 if test "x$withval" != "xno" ; then
885 AC_DEFINE_UNQUOTED(USER_PATH, "$withval") 904 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
905 SERVER_PATH_MSG="$withval"
886 fi 906 fi
887 ] 907 ]
888) 908)
889 909
890# Whether to force IPv4 by default (needed on broken glibc Linux) 910# Whether to force IPv4 by default (needed on broken glibc Linux)
911IPV4_HACK_MSG="no"
891AC_ARG_WITH(ipv4-default, 912AC_ARG_WITH(ipv4-default,
892 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified], 913 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
893 [ 914 [
894 if test "x$withval" != "xno" ; then 915 if test "x$withval" != "xno" ; then
895 AC_DEFINE(IPV4_DEFAULT) 916 AC_DEFINE(IPV4_DEFAULT)
917 IPV4_HACK_MSG="yes"
896 fi 918 fi
897 ] 919 ]
898) 920)
899 921
900AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses]) 922AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
923IPV4_IN6_HACK_MSG="no"
901AC_ARG_WITH(4in6, 924AC_ARG_WITH(4in6,
902 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], 925 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
903 [ 926 [
904 if test "x$withval" != "xno" ; then 927 if test "x$withval" != "xno" ; then
905 AC_MSG_RESULT(yes) 928 AC_MSG_RESULT(yes)
906 AC_DEFINE(IPV4_IN_IPV6) 929 AC_DEFINE(IPV4_IN_IPV6)
930 IPV4_IN6_HACK_MSG="yes"
907 else 931 else
908 AC_MSG_RESULT(no) 932 AC_MSG_RESULT(no)
909 fi 933 fi
@@ -911,6 +935,7 @@ AC_ARG_WITH(4in6,
911 if test "x$inet6_default_4in6" = "xyes"; then 935 if test "x$inet6_default_4in6" = "xyes"; then
912 AC_MSG_RESULT([yes (default)]) 936 AC_MSG_RESULT([yes (default)])
913 AC_DEFINE(IPV4_IN_IPV6) 937 AC_DEFINE(IPV4_IN_IPV6)
938 IPV4_IN6_HACK_MSG="yes"
914 else 939 else
915 AC_MSG_RESULT([no (default)]) 940 AC_MSG_RESULT([no (default)])
916 fi 941 fi
@@ -1162,3 +1187,57 @@ fi
1162 1187
1163AC_OUTPUT(Makefile ssh_prng_cmds) 1188AC_OUTPUT(Makefile ssh_prng_cmds)
1164 1189
1190# Print summary of options
1191
1192if test x$MANTYPE = x'$(CATMAN)' ; then
1193 MAN_MSG=cat
1194else
1195 MAN_MSG=man
1196fi
1197if test ! -z "$RANDOM_POOL" ; then
1198 RAND_MSG="Device ($RANDOM_POOL)"
1199else
1200 if test ! -z "$EGD_SOCKET" ; then
1201 RAND_MSG="EGD ($EGD_SOCKET)"
1202 else
1203 RAND_MSG="Builtin (timeout $entropy_timeout)"
1204 fi
1205fi
1206
1207# Someone please show me a better way :)
1208A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1209B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1210C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1211D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1212E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1213F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1214G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1215
1216echo ""
1217echo "OpenSSH configured has been configured with the following options."
1218echo " User binaries: $B"
1219echo " System binaries: $C"
1220echo " Configuration files: $D"
1221echo " Askpass program: $E"
1222echo " Manual pages: $F"
1223echo " PID file: $G"
1224echo " Random number collection: $RAND_MSG"
1225echo " Manpage format: $MAN_MSG"
1226echo " PAM support: ${PAM_MSG}"
1227echo " KerberosIV support: $KRB4_MSG"
1228echo " AFS support: $AFS_MSG"
1229echo " S/KEY support: $SKEY_MSG"
1230echo " TCP Wrappers support: $TCPW_MSG"
1231echo " MD5 password support: $MD5_MSG"
1232echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1233echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1234echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1235
1236echo ""
1237
1238echo "Compiler flags: ${CFLAGS}"
1239echo "Linker flags: ${LDFLAGS}"
1240echo "Libraries: ${LIBS}"
1241
1242echo ""
1243
diff --git a/entropy.c b/entropy.c
index cbb36fd29..09dcae3ba 100644
--- a/entropy.c
+++ b/entropy.c
@@ -35,7 +35,7 @@
35#include <openssl/rand.h> 35#include <openssl/rand.h>
36#include <openssl/sha.h> 36#include <openssl/sha.h>
37 37
38RCSID("$Id: entropy.c,v 1.13 2000/06/07 12:20:23 djm Exp $"); 38RCSID("$Id: entropy.c,v 1.14 2000/06/18 04:07:04 djm Exp $");
39 39
40#ifndef offsetof 40#ifndef offsetof
41# define offsetof(type, member) ((size_t) &((type *)0)->member) 41# define offsetof(type, member) ((size_t) &((type *)0)->member)
@@ -55,6 +55,13 @@ RCSID("$Id: entropy.c,v 1.13 2000/06/07 12:20:23 djm Exp $");
55 55
56#define WHITESPACE " \t\n" 56#define WHITESPACE " \t\n"
57 57
58#ifndef RUSAGE_SELF
59# define RUSAGE_SELF 0
60#endif
61#ifndef RUSAGE_CHILDREN
62# define RUSAGE_CHILDREN 0
63#endif
64
58#if defined(EGD_SOCKET) || defined(RANDOM_POOL) 65#if defined(EGD_SOCKET) || defined(RANDOM_POOL)
59 66
60#ifdef EGD_SOCKET 67#ifdef EGD_SOCKET
@@ -187,11 +194,11 @@ stir_from_system(void)
187 total_entropy_estimate = 0; 194 total_entropy_estimate = 0;
188 195
189 i = getpid(); 196 i = getpid();
190 RAND_add(&i, sizeof(i), 0.1); 197 RAND_add(&i, sizeof(i), 0.5);
191 total_entropy_estimate += 0.1; 198 total_entropy_estimate += 0.1;
192 199
193 i = getppid(); 200 i = getppid();
194 RAND_add(&i, sizeof(i), 0.1); 201 RAND_add(&i, sizeof(i), 0.5);
195 total_entropy_estimate += 0.1; 202 total_entropy_estimate += 0.1;
196 203
197 i = getuid(); 204 i = getuid();
@@ -200,7 +207,7 @@ stir_from_system(void)
200 RAND_add(&i, sizeof(i), 0.0); 207 RAND_add(&i, sizeof(i), 0.0);
201 208
202 total_entropy_estimate += stir_gettimeofday(1.0); 209 total_entropy_estimate += stir_gettimeofday(1.0);
203 total_entropy_estimate += stir_clock(0.2); 210 total_entropy_estimate += stir_clock(0.5);
204 total_entropy_estimate += stir_rusage(RUSAGE_SELF, 2.0); 211 total_entropy_estimate += stir_rusage(RUSAGE_SELF, 2.0);
205 212
206 return(total_entropy_estimate); 213 return(total_entropy_estimate);
@@ -301,9 +308,9 @@ stir_rusage(int who, double entropy_estimate)
301 struct rusage ru; 308 struct rusage ru;
302 309
303 if (getrusage(who, &ru) == -1) 310 if (getrusage(who, &ru) == -1)
304 fatal("Couldn't getrusage: %s", strerror(errno)); 311 return(0);
305 312
306 RAND_add(&ru, sizeof(ru), 0.1); 313 RAND_add(&ru, sizeof(ru), entropy_estimate);
307 314
308 return(entropy_estimate); 315 return(entropy_estimate);
309#else /* _HAVE_GETRUSAGE */ 316#else /* _HAVE_GETRUSAGE */