From 3dd7f27558fa1d6f0a11b997a6bbde5614bdbe96 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 15 Dec 2020 17:58:15 -0800 Subject: [PATCH] hnetd: update to latest commit Fixed compilation with newer libubox. libubox added a sys/stat.h include, which happens to break compilation. The reason being __unused is a variable in musl and an attribute here. Fixed by undefining right before including the headers. Clean up Makefile for consistency between packages. Refreshed patches. Signed-off-by: Rosen Penev --- hnetd/Makefile | 16 +++-- ...1-dtls.c-Update-openssl-API-to-1.1.0.patch | 71 ------------------- hnetd/patches/010-openssl-deprecated.patch | 2 +- hnetd/patches/020-unused.patch | 10 +++ 4 files changed, 20 insertions(+), 79 deletions(-) delete mode 100644 hnetd/patches/0001-dtls.c-Update-openssl-API-to-1.1.0.patch create mode 100644 hnetd/patches/020-unused.patch diff --git a/hnetd/Makefile b/hnetd/Makefile index 2d1b2cc..1335467 100644 --- a/hnetd/Makefile +++ b/hnetd/Makefile @@ -7,17 +7,19 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hnetd -PKG_SOURCE_VERSION:=606d7e904603ad8792ac1a7ba825618df97b5a4e -PKG_VERSION:=2016-06-28-$(PKG_SOURCE_VERSION) -PKG_RELEASE:=3 +PKG_SOURCE_DATE:=2018-12-21 +PKG_SOURCE_VERSION:=c43766610ed30194b048bc070a3c433aec731c40 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/sbyx/hnetd.git +PKG_SOURCE_URL:=https://github.com/sbyx/hnetd +PKG_MIRROR_HASH:=a41baa2e3d7930cc88073b0b3f6e1fa6a4abd9fd663f2577cfde1564fa07f8f2 + PKG_MAINTAINER:=Steven Barth -PKG_LICENSE:=GPL-2.0 +PKG_LICENSE:=GPL-2.0-only +PKG_LICENSE_FILES:=LICENSE -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk diff --git a/hnetd/patches/0001-dtls.c-Update-openssl-API-to-1.1.0.patch b/hnetd/patches/0001-dtls.c-Update-openssl-API-to-1.1.0.patch deleted file mode 100644 index 36cce7d..0000000 --- a/hnetd/patches/0001-dtls.c-Update-openssl-API-to-1.1.0.patch +++ /dev/null @@ -1,71 +0,0 @@ -From a9d47c87115bf69c19e9263efb90d5753456f1b9 Mon Sep 17 00:00:00 2001 -From: Eneas U de Queiroz -Date: Thu, 13 Dec 2018 00:20:57 -0200 -Subject: [PATCH] dtls.c: Update openssl API to 1.1.0 - -Use shims for compatiblity with previous versions. - -Signed-off-by: Eneas U de Queiroz ---- - src/dtls.c | 20 +++++++++++++++++--- - 1 file changed, 17 insertions(+), 3 deletions(-) - -diff --git a/src/dtls.c b/src/dtls.c -index ed5d408..511f724 100644 ---- a/src/dtls.c -+++ b/src/dtls.c -@@ -38,6 +38,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -168,6 +169,19 @@ static dtls_limits_s _default_limits = { - - static bool _ssl_initialized = false; - -+#if OPENSSL_VERSION_NUMBER < 0x10100000L \ -+ || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L) -+static inline void *X509_STORE_get_ex_data(X509_STORE *ctx, int idx) -+{ -+ return CRYPTO_get_ex_data(&ctx->ex_data, idx); -+} -+ -+static inline int X509_STORE_set_ex_data(X509_STORE *ctx, int idx, void *data) -+{ -+ return CRYPTO_set_ex_data(&ctx->ex_data, idx, data); -+} -+#endif -+ - static bool _drain_errors() - { - if (!ERR_peek_error()) -@@ -863,7 +877,7 @@ ssize_t dtls_send(dtls d, - - static int _verify_cert_cb(int ok, X509_STORE_CTX *ctx) - { -- dtls d = CRYPTO_get_ex_data(&ctx->ctx->ex_data, 0); -+ dtls d = X509_STORE_get_ex_data(X509_STORE_CTX_get0_store(ctx), 0); - - if (!d) - { -@@ -916,7 +930,7 @@ bool dtls_set_local_cert(dtls d, const char *certfile, const char *pkfile) - |SSL_VERIFY_FAIL_IF_NO_PEER_CERT - #endif /* DTLS_OPENSSL */ - , _verify_cert_cb); -- CRYPTO_set_ex_data(&d->ssl_server_ctx->cert_store->ex_data, 0, d); -+ X509_STORE_set_ex_data(SSL_CTX_get_cert_store(d->ssl_server_ctx), 0, d); - - #ifndef USE_ONE_CONTEXT - R1("client cert", -@@ -928,7 +942,7 @@ bool dtls_set_local_cert(dtls d, const char *certfile, const char *pkfile) - |SSL_VERIFY_PEER_FAIL_IF_NO_PEER_CERT - #endif /* DTLS_OPENSSL */ - , _verify_cert_cb); -- CRYPTO_set_ex_data(&d->ssl_client_ctx->cert_store->ex_data, 0, d); -+ X509_STORE_set_ex_data(SSL_CTX_get_cert_store(d->ssl_client_ctx), 0, d); - #endif /* !USE_ONE_CONTEXT */ - - return true; diff --git a/hnetd/patches/010-openssl-deprecated.patch b/hnetd/patches/010-openssl-deprecated.patch index 23bdefb..1bcfbf7 100644 --- a/hnetd/patches/010-openssl-deprecated.patch +++ b/hnetd/patches/010-openssl-deprecated.patch @@ -31,7 +31,7 @@ free(d->psk); d->psk = malloc(psk_len); if (!d->psk) -@@ -1011,6 +1014,9 @@ bool dtls_set_psk(dtls d, const char *psk, size_t psk_len) +@@ -1011,6 +1014,9 @@ bool dtls_set_psk(dtls d, const char *ps SSL_CTX_set_psk_client_callback(d->ssl_client_ctx, _client_psk); SSL_CTX_set_psk_server_callback(d->ssl_server_ctx, _server_psk); return true; diff --git a/hnetd/patches/020-unused.patch b/hnetd/patches/020-unused.patch new file mode 100644 index 0000000..28b35a4 --- /dev/null +++ b/hnetd/patches/020-unused.patch @@ -0,0 +1,10 @@ +--- a/src/hnetd.h ++++ b/src/hnetd.h +@@ -39,6 +39,7 @@ + + #endif /* __APPLE__ */ + ++#undef __unused + #include + #include + #include -- 2.30.2