summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/ntp/files/ntp-keygen_no_openssl.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-support/ntp/files/ntp-keygen_no_openssl.patch')
-rw-r--r--meta-networking/recipes-support/ntp/files/ntp-keygen_no_openssl.patch108
1 files changed, 108 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/ntp/files/ntp-keygen_no_openssl.patch b/meta-networking/recipes-support/ntp/files/ntp-keygen_no_openssl.patch
new file mode 100644
index 000000000..f576e2ee8
--- /dev/null
+++ b/meta-networking/recipes-support/ntp/files/ntp-keygen_no_openssl.patch
@@ -0,0 +1,108 @@
1Fix ntp-keygen build without OpenSSL
2
3Patch borrowed from Gentoo, originally from upstream
4Added --enable-libenvent to config since this version
5does not have local libevent support but we need the
6functions from the lib.
7
8Signed-off-by: Armin Kuster <akuster808@gmail.com>
9
10Upstream-Status: Backport
11
12Upstream commit:
13http://bk1.ntp.org/ntp-stable/?PAGE=patch&REV=5497b345z5MNTuNvJWuqPSje25NQTg
14Gentoo bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=533238
15
16Signed-off-by: Markos Chandras <hwoarang@gentoo.org>
17
18Index: ntp-4.2.6p5/libntp/ntp_random.c
19===================================================================
20--- ntp-4.2.6p5.orig/libntp/ntp_random.c
21+++ ntp-4.2.6p5/libntp/ntp_random.c
22@@ -498,6 +498,21 @@ ntp_random( void )
23 int crypto_rand_init = 0;
24 #endif
25
26+#ifndef HAVE_ARC4RANDOM_BUF
27+static void
28+arc4random_buf(void *buf, size_t nbytes);
29+
30+void
31+evutil_secure_rng_get_bytes(void *buf, size_t nbytes);
32+
33+static void
34+arc4random_buf(void *buf, size_t nbytes)
35+{
36+ evutil_secure_rng_get_bytes(buf, nbytes);
37+ return;
38+}
39+#endif
40+
41 /*
42 * ntp_crypto_srandom:
43 *
44Index: ntp-4.2.6p5/util/Makefile.am
45===================================================================
46--- ntp-4.2.6p5.orig/util/Makefile.am
47+++ ntp-4.2.6p5/util/Makefile.am
48@@ -21,6 +21,7 @@ AM_CPPFLAGS= -I$(top_srcdir)/include -I$
49 LDADD= ../libntp/libntp.a
50 ntp_keygen_SOURCES = ntp-keygen.c ntp-keygen-opts.c ntp-keygen-opts.h
51 ntp_keygen_LDADD= version.o $(LIBOPTS_LDADD) ../libntp/libntp.a @LCRYPTO@
52+ntp_keygen_LDADD += $(LDADD_LIBEVENT)
53
54 ETAGS_ARGS= Makefile.am
55 #EXTRA_DIST= README TAGS
56Index: ntp-4.2.6p5/configure.ac
57===================================================================
58--- ntp-4.2.6p5.orig/configure.ac
59+++ ntp-4.2.6p5/configure.ac
60@@ -376,6 +376,8 @@ AC_CHECK_FUNC([openlog], ,
61 AC_SEARCH_LIBS([MD5Init], [md5 md])
62 AC_CHECK_FUNCS(MD5Init)
63
64+AC_CHECK_FUNC([arc4random_buf])
65+
66 NTP_LINEEDITLIBS
67
68 dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
69@@ -5205,6 +5207,39 @@ AC_MSG_RESULT([$ntp_use_dev_clockctl])
70
71 AC_CHECK_HEADERS([sys/capability.h sys/prctl.h])
72
73+AC_MSG_CHECKING([if we have libevent capabilities (libevent)])
74+
75+case "$ac_cv_header_event2_event-config_h" in
76+ yes)
77+ case "$host" in
78+ *) ntp_have_linuxcaps=yes
79+ ;;
80+ esac
81+ ;;
82+ *)
83+ ntp_have_linuxcaps=no
84+ ;;
85+esac
86+
87+AC_ARG_ENABLE(
88+ [libevent],
89+ [AS_HELP_STRING(
90+ [--enable-libevent],
91+ [+ Use libevent capabilities for arc4random]
92+ )],
93+ [ntp_have_libevent=$enableval]
94+)
95+
96+AC_MSG_RESULT([$ntp_have_libevent])
97+
98+case "$ntp_have_libevent" in
99+ yes)
100+ AC_DEFINE([HAVE_LIBEVENT], [1],
101+ [Do we have libevent capabilities?])
102+ LIBS="$LIBS -levent"
103+esac
104+
105+
106 AC_MSG_CHECKING([if we have linux capabilities (libcap)])
107
108 case "$ac_cv_header_sys_capability_h$ac_cv_header_sys_prctl_h" in