summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Kohl <jtkohl@mit.edu>1990-05-23 10:20:53 +0000
committerJohn Kohl <jtkohl@mit.edu>1990-05-23 10:20:53 +0000
commit7ef9cd7fa6ee7eba5dcb498466f61761c6aec1c7 (patch)
tree4260592ad6796a0e530bfca71a3a03d74c2e5036 /src
parent415fb82fdddf98cc0c70b2798947df0b6b7cb6d1 (diff)
downloadkrb5-7ef9cd7fa6ee7eba5dcb498466f61761c6aec1c7.tar.gz
krb5-7ef9cd7fa6ee7eba5dcb498466f61761c6aec1c7.tar.xz
krb5-7ef9cd7fa6ee7eba5dcb498466f61761c6aec1c7.zip
*** empty log message ***
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@901 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/lib/crypto/os/rnd_confoun.c40
1 files changed, 40 insertions, 0 deletions
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/copyright.h>.
+ *
+ * krb5_random_confounder()
+ */
+
+#if !defined(lint) && !defined(SABER)
+static char rcsid_rnd_counfoun_c[] =
+"$Id$";
+#endif /* !lint & !SABER */
+
+#include <krb5/copyright.h>
+#include <krb5/krb5.h>
+#include <krb5/ext-proto.h>
+
+/*
+ * 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;
+}