From: John Kohl Date: Wed, 23 May 1990 10:20:53 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: krb5-1.0-alpha2~505 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7ef9cd7fa6ee7eba5dcb498466f61761c6aec1c7;p=krb5.git *** empty log message *** git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@901 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/crypto/os/rnd_confoun.c b/src/lib/crypto/os/rnd_confoun.c new file mode 100644 index 000000000..09140f588 --- /dev/null +++ b/src/lib/crypto/os/rnd_confoun.c @@ -0,0 +1,40 @@ +/* + * $Source$ + * $Author$ + * + * Copyright 1990 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * krb5_random_confounder() + */ + +#if !defined(lint) && !defined(SABER) +static char rcsid_rnd_counfoun_c[] = +"$Id$"; +#endif /* !lint & !SABER */ + +#include +#include +#include + +/* + * Generate a random confounder + */ +krb5_ui_4 +krb5_random_confounder PROTOTYPE((void)) +{ + static int seeded = 0; + long retval; + + /* XXX this needs an alternative for an X3J11 C environment, + to use srand() and rand() */ + if (!seeded) { + srandom(time(0)); + seeded = 1; + } + /* this only gives us 31 random buts, but so what ? */ + retval = random(); + return (krb5_ui_4) retval; +}