summaryrefslogtreecommitdiffstats
path: root/usr.sbin/xntpd/authstuff
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/xntpd/authstuff')
-rw-r--r--usr.sbin/xntpd/authstuff/Makefile27
-rw-r--r--usr.sbin/xntpd/authstuff/md5driver.c12
2 files changed, 33 insertions, 6 deletions
diff --git a/usr.sbin/xntpd/authstuff/Makefile b/usr.sbin/xntpd/authstuff/Makefile
new file mode 100644
index 0000000..79b2d9d
--- /dev/null
+++ b/usr.sbin/xntpd/authstuff/Makefile
@@ -0,0 +1,27 @@
+#
+# $Id: Makefile,v 1.1 1993/12/21 21:06:20 wollman Exp $
+#
+# Most of the programs in this directory are completely useless for the
+# NTP configuration that we provide by default.
+# We provide the `md5' program as a public service.
+
+CFLAGS+= -I${.CURDIR}/../include
+
+.if exists(${.CURDIR}/../lib/obj)
+LDADD+= -L${.CURDIR}/../lib/obj
+DPADD+= ${.CURDIR}/../lib/obj/libntp.a
+.else
+LDADD+= -L${.CURDIR}/../lib
+DPADD+= ${.CURDIR}/../lib/libntp.a
+.endif
+
+LDADD+= -lntp
+
+PROG= md5
+
+SRCS= md5driver.c
+NOMAN=
+
+install:
+
+.include <bsd.prog.mk>
diff --git a/usr.sbin/xntpd/authstuff/md5driver.c b/usr.sbin/xntpd/authstuff/md5driver.c
index 0d7e132..a608add 100644
--- a/usr.sbin/xntpd/authstuff/md5driver.c
+++ b/usr.sbin/xntpd/authstuff/md5driver.c
@@ -1,4 +1,4 @@
-/*
+/* md5driver.c,v 3.1 1993/07/06 01:05:07 jbj Exp
***********************************************************************
** md5driver.c -- sample test routines **
** RSA Data Security, Inc. MD5 Message-Digest Algorithm **
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <sys/types.h>
#include <time.h>
-#if defined(SYS_BSDI) || defined(SYS_44BSD)
+#ifdef SYS_BSDI
#include <sys/time.h>
#endif /* SYS_BSDI */
#include "md5.h"
@@ -57,7 +57,7 @@ MD5_CTX *mdContext;
#define TEST_BLOCKS 10000
/* number of test bytes = TEST_BLOCK_SIZE * TEST_BLOCKS */
-static long TEST_BYTES = (long)TEST_BLOCK_SIZE * (long)TEST_BLOCKS;
+static LONG TEST_BYTES = (LONG)TEST_BLOCK_SIZE * (LONG)TEST_BLOCKS;
/* A time trial routine, to measure the speed of MD5.
Measures wall time required to digest TEST_BLOCKS * TEST_BLOCK_SIZE
@@ -76,7 +76,7 @@ MDTimeTrial ()
data[i] = (unsigned char)(i & 0xFF);
/* start timer */
- printf ("MD5 time trial. Processing %ld characters...\n", (long)TEST_BYTES);
+ printf ("MD5 time trial. Processing %ld characters...\n", TEST_BYTES);
time (&startTime);
/* digest data in TEST_BLOCK_SIZE byte blocks */
@@ -90,10 +90,10 @@ MDTimeTrial ()
MDPrint (&mdContext);
printf (" is digest of test input.\n");
printf
- ("Seconds to process test input: %ld\n", (long)endTime-startTime);
+ ("Seconds to process test input: %ld\n", (LONG)(endTime-startTime));
printf
("Characters processed per second: %ld\n",
- (long)(TEST_BYTES/(endTime-startTime)));
+ TEST_BYTES/(endTime-startTime));
}
/* Computes the message digest for string inString.
OpenPOWER on IntegriCloud