]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2693] ntp-keygen doesn't build without OpenSSL
authorHarlan Stenn <stenn@ntp.org>
Mon, 22 Dec 2014 05:59:33 +0000 (05:59 +0000)
committerHarlan Stenn <stenn@ntp.org>
Mon, 22 Dec 2014 05:59:33 +0000 (05:59 +0000)
bk: 5497b345z5MNTuNvJWuqPSje25NQTg

ChangeLog
Makefile.am
configure.ac
libntp/ntp_crypto_rnd.c
sntp/configure.ac
sntp/m4/ntp_libevent.m4
util/Makefile.am

index 43d8408152b2441e027c13a5d301573305de20bc..10b5d225ed1f341fd48ca45083ca0fc081a13923 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,8 @@
 ---
 
 * [Sec 2672] On some OSes ::1 can be spoofed, bypassing source IP ACLs.
-* [Bug 2699] IN6_IS_ADDR_LOOPBACK build problems on some OSes.
+* [Bug 2693] ntp-keygen doesn't build without OpenSSL.
+* [Bug 2697] IN6_IS_ADDR_LOOPBACK build problems on some OSes.
 * [Bug 2699] HAVE_SYS_SELECT_H is misspelled in refclock_gpsdjson.c.
 ---
 (4.2.8) 2014/12/19 Released by Harlan Stenn <stenn@ntp.org>
index 2908f96cd0375a10ee4afa053a5addf112313012..fc76719f04289b9058884144f9ef63ac35951d8c 100644 (file)
@@ -2,7 +2,10 @@ ACLOCAL_AMFLAGS = -I sntp/m4 -I sntp/libevent/m4 -I sntp/libopts/m4
 
 NULL =
 
+# moved sntp first to get libtool and libevent built.
+
 SUBDIRS =              \
+       sntp            \
        scripts         \
        include         \
        libntp          \
@@ -17,7 +20,6 @@ SUBDIRS =             \
        clockstuff      \
        kernel          \
        util            \
-       sntp            \
        tests           \
        $(NULL)
 
@@ -64,7 +66,6 @@ BUILT_SOURCES =                               \
        .gcc-warning                    \
        libtool                         \
        html/.datecheck                 \
-       sntp/built-sources-only         \
        $(srcdir)/COPYRIGHT             \
        $(srcdir)/.checkChangeLog       \
        $(NULL)
index a7d344a2156872cb0a1dd73e0998337886919ae5..dd73795fa980fe2068043243b9b727940cce255f 100644 (file)
@@ -102,7 +102,7 @@ esac
 enable_nls=no
 LIBOPTS_CHECK_NOBUILD([sntp/libopts])
 
-NTP_ENABLE_LOCAL_LIBEVENT
+NTP_LIBEVENT_CHECK_NOBUILD([2], [sntp/libevent])
 
 NTP_LIBNTP
 
@@ -771,6 +771,10 @@ esac
 
 #### 
 
+AC_CHECK_FUNCS([arc4random_buf])
+
+#### 
+
 saved_LIBS="$LIBS"
 LIBS="$LIBS $LDADD_LIBNTP"
 AC_CHECK_FUNCS([daemon])
index 62a808db3447f6947b995b3cede0f352116aa01e..6cc8f5d7e37f25574e43e1d7f927a72aff5b11aa 100644 (file)
 int crypto_rand_init = 0;
 #endif
 
+#ifndef HAVE_ARC4RANDOM_BUF
+static void
+arc4random_buf(void *buf, size_t nbytes);
+
+void
+evutil_secure_rng_get_bytes(void *buf, size_t nbytes);
+
+static void
+arc4random_buf(void *buf, size_t nbytes)
+{
+       evutil_secure_rng_get_bytes(buf, nbytes);
+       return;
+}
+#endif
+
 /*
  * As of late 2014, here's how we plan to provide cryptographic-quality
  * random numbers:
index e1034684969725bdb4c417fda7fee959d8a59ffa..172c6b1a1f7dc99cd2fb870eaba2e767adf33035 100644 (file)
@@ -97,11 +97,14 @@ esac
 enable_nls=no
 LIBOPTS_CHECK
 
-AM_COND_IF(
-    [BUILD_SNTP],
-    [NTP_LIBEVENT_CHECK],
-    [NTP_LIBEVENT_CHECK_NOBUILD]
-)
+# From when we only used libevent for sntp:
+#AM_COND_IF(
+#    [BUILD_SNTP],
+#    [NTP_LIBEVENT_CHECK],
+#    [NTP_LIBEVENT_CHECK_NOBUILD]
+#)
+
+NTP_LIBEVENT_CHECK([2])
 
 # Checks for libraries.
 
index 5f81ae90576c5ef51f558606a3615f7d5b46355b..54174f05a21a5e59d9c81f7e0d0cf4a04717690a 100644 (file)
@@ -1,4 +1,25 @@
-dnl NTP_ENABLE_LOCAL_LIBEVENT                               -*- Autoconf -*-
+# SYNOPSIS                                             -*- Autoconf -*-
+#
+#  NTP_ENABLE_LOCAL_LIBEVENT
+#  NTP_LIBEVENT_CHECK([MINVERSION [, DIR]])
+#  NTP_LIBEVENT_CHECK_NOBUILD([MINVERSION [, DIR]])
+#
+# DESCRIPTION
+#
+# AUTHOR
+#
+#  Harlan Stenn
+#
+# LICENSE
+#
+#  This file is Copyright (c) 2014 Network Time Foundation
+# 
+#  Copying and distribution of this file, with or without modification, are
+#  permitted in any medium without royalty provided the copyright notice,
+#  author attribution and this notice are preserved.  This file is offered
+#  as-is, without any warranty.
+
+dnl NTP_ENABLE_LOCAL_LIBEVENT
 dnl
 dnl Provide only the --enable-local-libevent command-line option.
 dnl
@@ -29,7 +50,7 @@ dnl If NOBUILD is provided as the 3rd argument, do all of the above,
 dnl but DO NOT invoke DIR/configure if we are going to use our bundled
 dnl version.  This may be the case for nested packages.
 dnl
-dnl provide --enable-local-libevent .
+dnl provides: --enable-local-libevent 
 dnl
 dnl Examples:
 dnl
index 4265e0b4b957f5bcb0697429e9c72c3f101f92ff..88bf7cb022be1c72e95ca1f683921b04bff687b2 100644 (file)
@@ -19,6 +19,7 @@ AM_LDFLAGS = $(LDFLAGS_NTP)
 LDADD=         ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS)
 tg2_LDADD=     ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM)
 ntp_keygen_LDADD  = version.o $(LIBOPTS_LDADD) ../libntp/libntp.a
+ntp_keygen_LDADD += $(LDADD_LIBEVENT)
 ntp_keygen_LDADD += $(LDADD_LIBNTP) $(PTHREAD_LIBS) $(LDADD_NTP) $(LIBM)
 ntp_keygen_SOURCES = ntp-keygen.c ntp-keygen-opts.c ntp-keygen-opts.h