Rebase patches on top of Kea 1.4
Ondřej Surý
5 years ago
0 | Index: isc-kea/dns++.pc.in | |
1 | =================================================================== | |
2 | --- isc-kea.orig/dns++.pc.in 2016-01-27 19:39:30.021264872 -0600 | |
3 | +++ isc-kea/dns++.pc.in 2016-01-27 19:39:30.021264872 -0600 | |
4 | @@ -8,4 +8,4 @@ | |
0 | From: Adam Majer <adamm@zombino.com> | |
1 | Date: Fri, 13 Jul 2018 17:06:51 +0000 | |
2 | Subject: fix_pc_paths | |
3 | ||
4 | --- | |
5 | dns++.pc.in | 2 +- | |
6 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
7 | ||
8 | diff --git a/dns++.pc.in b/dns++.pc.in | |
9 | index ef65c7e..399a0eb 100644 | |
10 | --- a/dns++.pc.in | |
11 | +++ b/dns++.pc.in | |
12 | @@ -8,4 +8,4 @@ Description: BIND 10 DNS library | |
5 | 13 | Version: @PACKAGE_VERSION@ |
6 | 14 | Requires: @CRYPTO_PACKAGE@ |
7 | 15 | Cflags: -I${includedir}/@PACKAGE_NAME@ |
0 | Index: isc-kea/src/bin/keactrl/keactrl.in | |
1 | =================================================================== | |
2 | --- isc-kea.orig/src/bin/keactrl/keactrl.in 2016-01-27 19:39:23.949193220 -0600 | |
3 | +++ isc-kea/src/bin/keactrl/keactrl.in 2016-01-27 19:39:23.945193172 -0600 | |
4 | @@ -423,4 +423,3 @@ | |
0 | From: Adam Majer <adamm@zombino.com> | |
1 | Date: Fri, 13 Jul 2018 17:06:51 +0000 | |
2 | Subject: fix_typo | |
3 | ||
4 | --- | |
5 | src/bin/keactrl/keactrl.in | 1 - | |
6 | 1 file changed, 1 deletion(-) | |
7 | ||
8 | diff --git a/src/bin/keactrl/keactrl.in b/src/bin/keactrl/keactrl.in | |
9 | index 3510282..6474910 100644 | |
10 | --- a/src/bin/keactrl/keactrl.in | |
11 | +++ b/src/bin/keactrl/keactrl.in | |
12 | @@ -461,4 +461,3 @@ ${args}" 1 | |
5 | 13 | log_error "Invalid command: ${command}." |
6 | 14 | exit 1 ;; |
7 | 15 | esac |
0 | Author: Adam Majer <adamm@zombino.com> | |
1 | Summary: Add OpenSSL 1.1 support. | |
2 | PR: https://github.com/isc-projects/kea/pull/34 | |
3 | ||
4 | --- a/src/lib/cryptolink/openssl_hash.cc | |
5 | +++ b/src/lib/cryptolink/openssl_hash.cc | |
6 | @@ -5,11 +5,11 @@ | |
7 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
8 | ||
9 | #include <cryptolink.h> | |
10 | #include <cryptolink/crypto_hash.h> | |
11 | ||
12 | -#include <boost/scoped_ptr.hpp> | |
13 | +#include <boost/move/unique_ptr.hpp> | |
14 | ||
15 | #include <openssl/evp.h> | |
16 | ||
17 | #include <cryptolink/openssl_common.h> | |
18 | ||
19 | @@ -60,24 +60,17 @@ public: | |
20 | isc_throw(isc::cryptolink::UnsupportedAlgorithm, | |
21 | "Unknown hash algorithm: " << | |
22 | static_cast<int>(hash_algorithm)); | |
23 | } | |
24 | ||
25 | - md_.reset(new EVP_MD_CTX); | |
26 | + md_.reset(EVP_MD_CTX_new()); | |
27 | ||
28 | EVP_MD_CTX_init(md_.get()); | |
29 | ||
30 | EVP_DigestInit_ex(md_.get(), algo, NULL); | |
31 | } | |
32 | ||
33 | - /// @brief Destructor | |
34 | - ~HashImpl() { | |
35 | - if (md_) { | |
36 | - EVP_MD_CTX_cleanup(md_.get()); | |
37 | - } | |
38 | - } | |
39 | - | |
40 | /// @brief Returns the output size of the digest | |
41 | /// | |
42 | /// @return output size of the digest | |
43 | size_t getOutputLength() const { | |
44 | return (EVP_MD_CTX_size(md_.get())); | |
45 | @@ -128,12 +121,25 @@ public: | |
46 | } | |
47 | return (std::vector<uint8_t>(digest.begin(), digest.end())); | |
48 | } | |
49 | ||
50 | private: | |
51 | + class EvpDeleter { | |
52 | + public: | |
53 | + void operator()(EVP_MD_CTX *ptr) {EVP_MD_CTX_free(ptr);} | |
54 | + }; | |
55 | + | |
56 | +#if OPENSSL_VERSION_NUMBER < 0x10100000L | |
57 | + static EVP_MD_CTX* EVP_MD_CTX_new() { return new EVP_MD_CTX; } | |
58 | + static void EVP_MD_CTX_free(EVP_MD_CTX *ptr) { | |
59 | + EVP_MD_CTX_cleanup(ptr); | |
60 | + delete ptr; | |
61 | + } | |
62 | +#endif | |
63 | + | |
64 | /// @brief The protected pointer to the OpenSSL EVP_MD_CTX structure | |
65 | - boost::scoped_ptr<EVP_MD_CTX> md_; | |
66 | + boost::movelib::unique_ptr<EVP_MD_CTX, EvpDeleter> md_; | |
67 | }; | |
68 | ||
69 | Hash::Hash(const HashAlgorithm hash_algorithm) | |
70 | { | |
71 | impl_ = new HashImpl(hash_algorithm); | |
72 | --- a/src/lib/cryptolink/openssl_hmac.cc | |
73 | +++ b/src/lib/cryptolink/openssl_hmac.cc | |
74 | @@ -5,11 +5,11 @@ | |
75 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
76 | ||
77 | #include <cryptolink.h> | |
78 | #include <cryptolink/crypto_hmac.h> | |
79 | ||
80 | -#include <boost/scoped_ptr.hpp> | |
81 | +#include <boost/move/unique_ptr.hpp> | |
82 | ||
83 | #include <openssl/hmac.h> | |
84 | ||
85 | #include <cryptolink/openssl_common.h> | |
86 | ||
87 | @@ -39,25 +39,16 @@ public: | |
88 | } | |
89 | if (secret_len == 0) { | |
90 | isc_throw(BadKey, "Bad HMAC secret length: 0"); | |
91 | } | |
92 | ||
93 | - md_.reset(new HMAC_CTX); | |
94 | - HMAC_CTX_init(md_.get()); | |
95 | - | |
96 | + md_.reset(HMAC_CTX_new()); | |
97 | HMAC_Init_ex(md_.get(), secret, | |
98 | static_cast<int>(secret_len), | |
99 | algo, NULL); | |
100 | } | |
101 | ||
102 | - /// @brief Destructor | |
103 | - ~HMACImpl() { | |
104 | - if (md_) { | |
105 | - HMAC_CTX_cleanup(md_.get()); | |
106 | - } | |
107 | - } | |
108 | - | |
109 | /// @brief Returns the output size of the digest | |
110 | /// | |
111 | /// @return output size of the digest | |
112 | size_t getOutputLength() const { | |
113 | int size = HMAC_size(md_.get()); | |
114 | @@ -128,13 +119,29 @@ public: | |
115 | } | |
116 | return (digest.same(sig, len)); | |
117 | } | |
118 | ||
119 | private: | |
120 | + class HMAC_Deleter { | |
121 | + public: | |
122 | + void operator()(HMAC_CTX *ptr) { HMAC_CTX_free(ptr); } | |
123 | + }; | |
124 | + | |
125 | +#if OPENSSL_VERSION_NUMBER < 0x10100000L | |
126 | + static HMAC_CTX* HMAC_CTX_new() { | |
127 | + HMAC_CTX *ptr = new HMAC_CTX; | |
128 | + HMAC_CTX_init(ptr); | |
129 | + return ptr; | |
130 | + } | |
131 | + static void HMAC_CTX_free(HMAC_CTX *ptr) { | |
132 | + HMAC_CTX_cleanup(ptr); | |
133 | + delete ptr; | |
134 | + } | |
135 | +#endif | |
136 | ||
137 | /// @brief The protected pointer to the OpenSSL HMAC_CTX structure | |
138 | - boost::scoped_ptr<HMAC_CTX> md_; | |
139 | + boost::movelib::unique_ptr<HMAC_CTX, HMAC_Deleter> md_; | |
140 | }; | |
141 | ||
142 | HMAC::HMAC(const void* secret, size_t secret_length, | |
143 | const HashAlgorithm hash_algorithm) | |
144 | { |
0 | Index: isc-kea/src/lib/dhcpsrv/Makefile.in | |
1 | =================================================================== | |
2 | --- isc-kea.orig/src/lib/dhcpsrv/Makefile.in 2016-01-28 00:42:00.765652681 -0600 | |
3 | +++ isc-kea/src/lib/dhcpsrv/Makefile.in 2016-01-28 00:42:00.761652719 -0600 | |
4 | @@ -544,7 +544,7 @@ | |
0 | From: Adam Majer <adamm@zombino.com> | |
1 | Date: Fri, 13 Jul 2018 17:06:51 +0000 | |
2 | Subject: path_fixes | |
3 | ||
4 | --- | |
5 | src/lib/dhcpsrv/Makefile.in | 2 +- | |
6 | src/lib/dhcpsrv/daemon.cc | 2 +- | |
7 | src/lib/log/interprocess/Makefile.in | 2 +- | |
8 | src/lib/log/interprocess/interprocess_sync_file.cc | 2 +- | |
9 | 4 files changed, 4 insertions(+), 4 deletions(-) | |
10 | ||
11 | diff --git a/src/lib/dhcpsrv/Makefile.in b/src/lib/dhcpsrv/Makefile.in | |
12 | index d58f48f..ef8c1f6 100644 | |
13 | --- a/src/lib/dhcpsrv/Makefile.in | |
14 | +++ b/src/lib/dhcpsrv/Makefile.in | |
15 | @@ -657,7 +657,7 @@ top_builddir = @top_builddir@ | |
5 | 16 | top_srcdir = @top_srcdir@ |
6 | 17 | AUTOMAKE_OPTIONS = subdir-objects |
7 | SUBDIRS = . testutils tests | |
18 | SUBDIRS = . testutils tests benchmarks | |
8 | 19 | -dhcp_data_dir = @localstatedir@/@PACKAGE@ |
9 | 20 | +dhcp_data_dir = @localstatedir@/lib/@PACKAGE@ |
10 | 21 | kea_lfc_location = @prefix@/sbin/kea-lfc |
11 | 22 | # Set location of the kea-lfc binary. |
12 | 23 | AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib \ |
13 | Index: isc-kea/src/lib/log/interprocess/Makefile.in | |
14 | =================================================================== | |
15 | --- isc-kea.orig/src/lib/log/interprocess/Makefile.in 2016-01-28 00:42:00.765652681 -0600 | |
16 | +++ isc-kea/src/lib/log/interprocess/Makefile.in 2016-01-28 00:42:00.761652719 -0600 | |
17 | @@ -401,7 +401,7 @@ | |
24 | diff --git a/src/lib/dhcpsrv/daemon.cc b/src/lib/dhcpsrv/daemon.cc | |
25 | index fd06e8b..c621479 100644 | |
26 | --- a/src/lib/dhcpsrv/daemon.cc | |
27 | +++ b/src/lib/dhcpsrv/daemon.cc | |
28 | @@ -29,7 +29,7 @@ namespace dhcp { | |
29 | ||
30 | Daemon::Daemon() | |
31 | : signal_set_(), signal_handler_(), config_file_(""), proc_name_(""), | |
32 | - pid_file_dir_(DHCP_DATA_DIR), pid_file_(), am_file_author_(false) { | |
33 | + pid_file_dir_("/var/run"), pid_file_(), am_file_author_(false) { | |
34 | ||
35 | // The pid_file_dir can be overridden via environment variable | |
36 | // This is primarily intended to simplify testing | |
37 | diff --git a/src/lib/log/interprocess/Makefile.in b/src/lib/log/interprocess/Makefile.in | |
38 | index 1fe5608..fc9e30b 100644 | |
39 | --- a/src/lib/log/interprocess/Makefile.in | |
40 | +++ b/src/lib/log/interprocess/Makefile.in | |
41 | @@ -418,7 +418,7 @@ top_builddir = @top_builddir@ | |
18 | 42 | top_srcdir = @top_srcdir@ |
19 | 43 | SUBDIRS = . tests |
20 | 44 | AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib \ |
23 | 47 | $(BOOST_INCLUDES) |
24 | 48 | AM_CXXFLAGS = $(KEA_CXXFLAGS) |
25 | 49 | CLEANFILES = *.gcno *.gcda |
26 | Index: isc-kea/src/lib/log/interprocess/interprocess_sync_file.cc | |
27 | =================================================================== | |
28 | --- isc-kea.orig/src/lib/log/interprocess/interprocess_sync_file.cc 2016-01-28 00:42:00.765652681 -0600 | |
29 | +++ isc-kea/src/lib/log/interprocess/interprocess_sync_file.cc 2016-01-28 00:42:00.761652719 -0600 | |
30 | @@ -48,7 +48,7 @@ | |
50 | diff --git a/src/lib/log/interprocess/interprocess_sync_file.cc b/src/lib/log/interprocess/interprocess_sync_file.cc | |
51 | index ed6a5b7..b89cc3a 100644 | |
52 | --- a/src/lib/log/interprocess/interprocess_sync_file.cc | |
53 | +++ b/src/lib/log/interprocess/interprocess_sync_file.cc | |
54 | @@ -50,7 +50,7 @@ InterprocessSyncFile::do_lock(int cmd, short l_type) { | |
31 | 55 | lockfile_path = env; |
32 | 56 | } |
33 | 57 | |
36 | 60 | |
37 | 61 | // Open the lockfile in the constructor so it doesn't do the access |
38 | 62 | // checks every time a message is logged. |
39 | Index: isc-kea/src/lib/dhcpsrv/daemon.cc | |
40 | =================================================================== | |
41 | --- isc-kea.orig/src/lib/dhcpsrv/daemon.cc 2016-01-28 00:42:00.765652681 -0600 | |
42 | +++ isc-kea/src/lib/dhcpsrv/daemon.cc 2016-01-28 00:42:00.761652719 -0600 | |
43 | @@ -28,7 +28,7 @@ | |
44 | ||
45 | Daemon::Daemon() | |
46 | : signal_set_(), signal_handler_(), config_file_(""), proc_name_(""), | |
47 | - pid_file_dir_(DHCP_DATA_DIR), pid_file_(), am_file_author_(false) { | |
48 | + pid_file_dir_("/var/run"), pid_file_(), am_file_author_(false) { | |
49 | ||
50 | // The pid_file_dir can be overridden via environment variable | |
51 | // This is primarily intended to simplify testing | |
52 | Index: isc-kea/src/bin/d2/spec_config.h.pre.in | |
53 | =================================================================== | |
54 | --- isc-kea.orig/src/bin/d2/spec_config.h.pre.in 2016-01-28 00:42:00.765652681 -0600 | |
55 | +++ isc-kea/src/bin/d2/spec_config.h.pre.in 2016-01-28 00:42:00.761652719 -0600 | |
56 | @@ -4,4 +4,4 @@ | |
57 | // License, v. 2.0. If a copy of the MPL was not distributed with this | |
58 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
59 | ||
60 | -#define D2_SPECFILE_LOCATION "@prefix@/share/@PACKAGE@/dhcp-ddns.spec" | |
61 | +#define D2_SPECFILE_LOCATION "@prefix@/share/kea-dhcp-ddns-server/dhcp-ddns.spec" | |
62 | Index: isc-kea/src/bin/dhcp4/spec_config.h.pre.in | |
63 | =================================================================== | |
64 | --- isc-kea.orig/src/bin/dhcp4/spec_config.h.pre.in 2016-01-28 00:42:00.765652681 -0600 | |
65 | +++ isc-kea/src/bin/dhcp4/spec_config.h.pre.in 2016-01-28 00:42:00.761652719 -0600 | |
66 | @@ -4,4 +4,4 @@ | |
67 | // License, v. 2.0. If a copy of the MPL was not distributed with this | |
68 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
69 | ||
70 | -#define DHCP4_SPECFILE_LOCATION "@prefix@/share/@PACKAGE@/dhcp4.spec" | |
71 | +#define DHCP4_SPECFILE_LOCATION "@prefix@/share/kea-dhcp4-server/dhcp4.spec" | |
72 | Index: isc-kea/src/bin/dhcp6/spec_config.h.pre.in | |
73 | =================================================================== | |
74 | --- isc-kea.orig/src/bin/dhcp6/spec_config.h.pre.in 2016-01-28 00:42:00.765652681 -0600 | |
75 | +++ isc-kea/src/bin/dhcp6/spec_config.h.pre.in 2016-01-28 00:42:00.761652719 -0600 | |
76 | @@ -4,4 +4,4 @@ | |
77 | // License, v. 2.0. If a copy of the MPL was not distributed with this | |
78 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
79 | ||
80 | -#define DHCP6_SPECFILE_LOCATION "@prefix@/share/@PACKAGE@/dhcp6.spec" | |
81 | +#define DHCP6_SPECFILE_LOCATION "@prefix@/share/kea-dhcp6/dhcp6.spec" | |
82 | Index: isc-kea/doc/guide/Makefile.in | |
83 | =================================================================== | |
84 | --- isc-kea.orig/doc/guide/Makefile.in 2015-12-28 14:25:52.000000000 -0600 | |
85 | +++ isc-kea/doc/guide/Makefile.in 2016-01-28 00:43:22.584887938 -0600 | |
86 | @@ -576,7 +576,7 @@ | |
87 | ||
88 | ||
89 | kea-messages.xml: | |
90 | - $(top_srcdir)/tools/system_messages -o $@ \ | |
91 | + ../../tools/system_messages -o $@ \ | |
92 | `find $(top_srcdir) -name "*.mes" -print` | |
93 | ||
94 | # This is not a "man" manual, but reuse this for now for docbook. |
0 | Index: isc-kea/configure | |
1 | =================================================================== | |
2 | --- isc-kea.orig/configure 2016-03-01 00:18:59.277551067 -0600 | |
3 | +++ isc-kea/configure 2016-03-01 00:18:59.273551106 -0600 | |
4 | @@ -16008,7 +16008,7 @@ | |
0 | From: Adam Majer <adamm@zombino.com> | |
1 | Date: Fri, 13 Jul 2018 17:06:51 +0000 | |
2 | Subject: support_kfreebsd | |
3 | ||
4 | --- | |
5 | configure | 4 ++-- | |
6 | configure.ac | 2 +- | |
7 | 2 files changed, 3 insertions(+), 3 deletions(-) | |
8 | ||
9 | diff --git a/configure b/configure | |
10 | index b25623b..155a76e 100755 | |
11 | --- a/configure | |
12 | +++ b/configure | |
13 | @@ -16588,7 +16588,7 @@ $as_echo "OS X >= 10.9" >&6; } | |
5 | 14 | fi |
6 | 15 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
7 | ;; | |
16 | ;; | |
8 | 17 | -*-freebsd*) |
9 | 18 | +*-freebsd*|*-kfreebsd*) |
10 | # On FreeBSD10.1 pthread_cond_destroy doesn't work as documented, which | |
11 | # causes the CondVarTest.destroyWhileWait test to fail. According to the | |
12 | # pthread_cond_destroy documentation for FreeBSD, this function should | |
13 | @@ -16707,7 +16707,7 @@ | |
19 | # On FreeBSD10.1 pthread_cond_destroy doesn't work as documented, which | |
20 | # causes the CondVarTest.destroyWhileWait test to fail. According to the | |
21 | # pthread_cond_destroy documentation for FreeBSD, this function should | |
22 | @@ -17328,7 +17328,7 @@ $as_echo "#define OS_OSX 1" >>confdefs.h | |
14 | 23 | BSD_TYPE="OSX" |
15 | 24 | CPPFLAGS="$CPPFLAGS -DOS_BSD" |
16 | 25 | ;; |
19 | 28 | |
20 | 29 | $as_echo "#define OS_BSD 1" >>confdefs.h |
21 | 30 | |
31 | diff --git a/configure.ac b/configure.ac | |
32 | index fb434e9..d607a6c 100644 | |
33 | --- a/configure.ac | |
34 | +++ b/configure.ac | |
35 | @@ -396,7 +396,7 @@ case "$host" in | |
36 | [AC_MSG_RESULT([OS X >= 10.9]) | |
37 | kea_undefined_pthread_behavior=yes]) | |
38 | ;; | |
39 | -*-freebsd*) | |
40 | +*-freebsd*|*-kfreebsd*) | |
41 | # On FreeBSD10.1 pthread_cond_destroy doesn't work as documented, which | |
42 | # causes the CondVarTest.destroyWhileWait test to fail. According to the | |
43 | # pthread_cond_destroy documentation for FreeBSD, this function should |