AC_CHECK_FUNC(openlog, ,
AC_CHECK_LIB(gen, openlog, ,
AC_CHECK_LIB(syslog, openlog, , , -lsocket)))
+AC_CHECK_LIB(md5, MD5Init, ,
+ AC_CHECK_LIB(md, MD5Init))
+AC_CHECK_FUNCS(MD5Init)
dnl HMS: What a hack...
AC_CHECK_HEADERS(readline/history.h readline/readline.h)
case "$ac_cv_header_readline_history_h$ac_cv_header_readline_readline_h" in
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
AC_HEADER_STDC
-AC_CHECK_HEADERS(bstring.h errno.h fcntl.h ieeefp.h math.h memory.h netdb.h)
-AC_CHECK_HEADERS(poll.h)
+AC_CHECK_HEADERS(bstring.h errno.h fcntl.h ieeefp.h math.h)
+AC_CHECK_HEADERS(md5.h)
+AC_CHECK_HEADERS(memory.h netdb.h poll.h)
AC_CHECK_HEADERS(sched.h sgtty.h stdlib.h string.h termio.h)
AC_CHECK_HEADERS(termios.h timepps.h timex.h unistd.h)
case "$host" in
ntp_io.h \
ntp_machine.h \
ntp_malloc.h \
+ ntp_md5.h \
ntp_proto.h \
ntp_refclock.h \
ntp_request.h \
--- /dev/null
+/*
+ * ntp_md5.h: deal with md5.h headers
+ */
+
+#ifdef HAVE_MD5_H
+# include <md5.h>
+#else
+# include "rsa_md5.h"
+#endif
UINT4 state[4]; /* state (ABCD) */
UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
unsigned char buffer[64]; /* input buffer */
-} ntp_MD5_CTX;
+} MD5_CTX;
-void MD5Init PROTO_LIST ((ntp_MD5_CTX *));
+void MD5Init PROTO_LIST ((MD5_CTX *));
void MD5Update PROTO_LIST
- ((ntp_MD5_CTX *, unsigned char *, unsigned int));
-void MD5Final PROTO_LIST ((unsigned char [16], ntp_MD5_CTX *));
+ ((MD5_CTX *, unsigned char *, unsigned int));
+void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *));
#ifdef __cplusplus
}
#include "ntp_stdlib.h"
#include "ntp.h"
#include "global.h"
-#include "rsa_md5.h"
+#include "ntp_md5.h"
/*
* MD5authencrypt - generate MD5 message authenticator
int length /* packet length */
)
{
- ntp_MD5_CTX md5;
+ MD5_CTX md5;
u_char digest[16];
/*
int size /* MAC size */
)
{
- ntp_MD5_CTX md5;
+ MD5_CTX md5;
u_char digest[16];
/*
u_int32
addr2refid(struct sockaddr_storage *addr)
{
- ntp_MD5_CTX md5;
+ MD5_CTX md5;
u_char digest[16];
u_int32 addr_refid;
*/
#include "global.h"
-#include "rsa_md5.h"
+#ifndef HAVE_MD5INIT
+#include "ntp_md5.h"
/* Constants for MD5Transform routine.
*/
*/
void
MD5Init(
- ntp_MD5_CTX *context /* context */
+ MD5_CTX *context /* context */
)
{
context->count[0] = context->count[1] = 0;
*/
void
MD5Update (
- ntp_MD5_CTX *context, /* context */
+ MD5_CTX *context, /* context */
unsigned char *input, /* input block */
unsigned int inputLen /* length of input block */
)
void
MD5Final (
unsigned char digest[16], /* message digest */
- ntp_MD5_CTX *context /* context */
+ MD5_CTX *context /* context */
)
{
unsigned char bits[8];
for (i = 0; i < len; i++)
((char *)output)[i] = (char)value;
}
+#else
+int md5_bs;
+#endif