[10572] in Athena Bugs
athena/athena.lib/gdss/lib/crypto/algorithm/random.c
daemon@ATHENA.MIT.EDU (brlewis@Athena.MIT.EDU)
Thu Jun 24 14:49:17 1993
From: brlewis@Athena.MIT.EDU
Date: Thu, 24 Jun 93 14:49:11 -0400
To: bugs@Athena.MIT.EDU, rel-eng@Athena.MIT.EDU
Jeff tells me we don't actually use this code, but here's the patch
anyway.
*** /tmp/,RCSt1a21566 Thu Jun 24 14:47:45 1993
--- random.c Fri Jun 11 12:11:26 1993
***************
*** 84,89 ****
--- 84,95 ----
* Introduce some other uncertanity based on current time and resource usage.
*
*/
+
+ /* HP-UX doesn't have getrusage(), so it will introduce uncertainty
+ * based on current time and the contents of uninitialized memory.
+ * -brlewis 6/9/93
+ * XXX hpux malloc() returns zeroed memory -brlewis 6/11/93
+ */
void initialize_rng_state (seed,nl)
unsigned char * seed;
int nl;
***************
*** 99,105 ****
--- 105,113 ----
/* get whatever resource usage there is */
rs = (struct rusage *) malloc(sizeof(struct rusage));
+ #ifndef hpux
getrusage(0,rs);
+ #endif
rs->ru_stime.tv_sec += (long) rs ;
DES_MAC (0, rs, sizeof(struct rusage), &rng.seed, &random_key_schedule) ;
free(rs);