From 7ef9cd7fa6ee7eba5dcb498466f61761c6aec1c7 Mon Sep 17 00:00:00 2001 From: John Kohl Date: Wed, 23 May 1990 10:20:53 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@901 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/os/rnd_confoun.c | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/lib/crypto/os/rnd_confoun.c 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; +} -- 2.26.2