Initial Commit
- initial default booting image
This commit is contained in:
59
package/sslh/0001-Makefile-add-USE_LIBEV.patch
Normal file
59
package/sslh/0001-Makefile-add-USE_LIBEV.patch
Normal file
@@ -0,0 +1,59 @@
|
||||
From 3e93c1d43de8a662e402127462f28ef0bebf8997 Mon Sep 17 00:00:00 2001
|
||||
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Date: Sun, 1 Oct 2023 18:45:53 +0200
|
||||
Subject: [PATCH] Makefile: add USE_LIBEV
|
||||
|
||||
Add USE_LIBEV to avoid the following build failure without libev raised
|
||||
since version 2.0 and
|
||||
https://github.com/yrutschle/sslh/commit/711c11c820f8be4f1399024bcaa1d7072de33217:
|
||||
|
||||
sslh-ev.c:24:10: fatal error: ev.h: Aucun fichier ou dossier de ce type
|
||||
24 | #include <ev.h>
|
||||
| ^~~~~~
|
||||
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Upstream: https://github.com/yrutschle/sslh/commit/3e93c1d43de8a662e402127462f28ef0bebf8997
|
||||
---
|
||||
Makefile | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index a4425c3..aa2689e 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -6,6 +6,7 @@ VERSION=$(shell ./genver.sh -r)
|
||||
ENABLE_SANITIZER= # Enable ASAN/LSAN/UBSAN
|
||||
ENABLE_REGEX=1 # Enable regex probes
|
||||
USELIBCONFIG=1 # Use libconfig? (necessary to use configuration files)
|
||||
+USELIBEV=1 # Use libev?
|
||||
USELIBWRAP?= # Use libwrap?
|
||||
USELIBCAP= # Use libcap?
|
||||
USESYSTEMD= # Make use of systemd socket activation
|
||||
@@ -72,6 +73,9 @@ ifneq ($(strip $(USELIBBSD)),)
|
||||
CPPFLAGS+=-DLIBBSD
|
||||
endif
|
||||
|
||||
+ifneq ($(strip $(USELIBEV)),)
|
||||
+ CONDITIONAL_TARGETS+=sslh-ev
|
||||
+endif
|
||||
|
||||
all: sslh $(MAN) echosrv $(CONDITIONAL_TARGETS)
|
||||
|
||||
@@ -84,7 +88,7 @@ $(OBJS_A): $(OBJS)
|
||||
version.h:
|
||||
./genver.sh >version.h
|
||||
|
||||
-sslh: sslh-fork sslh-select sslh-ev
|
||||
+sslh: sslh-fork sslh-select
|
||||
|
||||
$(OBJS) $(FORK_OBJS) $(SELECT_OBJS) $(EV_OBJS): argtable3.h collection.h common.h gap.h hash.h log.h probe.h processes.h sslh-conf.h tcp-listener.h tcp-probe.h tls.h udp-listener.h version.h
|
||||
|
||||
@@ -153,7 +157,7 @@ distclean: clean
|
||||
rm -f tags sslh-conf.[ch] echosrv-conf.[ch] cscope.*
|
||||
|
||||
clean:
|
||||
- rm -f sslh-fork sslh-select sslh-ev echosrv version.h $(MAN) systemd-sslh-generator *.o *.gcov *.gcno *.gcda *.png *.html *.css *.info
|
||||
+ rm -f sslh-fork sslh-select $(CONDITIONAL_TARGETS) echosrv version.h $(MAN) systemd-sslh-generator *.o *.gcov *.gcno *.gcda *.png *.html *.css *.info
|
||||
|
||||
tags:
|
||||
ctags --globals -T *.[ch]
|
||||
56
package/sslh/0002-fix-warnings-on-sockaddr-storage.patch
Normal file
56
package/sslh/0002-fix-warnings-on-sockaddr-storage.patch
Normal file
@@ -0,0 +1,56 @@
|
||||
From 402ca5219b5dcf7a502cd3f75906423527837a7a Mon Sep 17 00:00:00 2001
|
||||
From: Yves Rutschle <git1@rutschle.net>
|
||||
Date: Thu, 4 Jan 2024 23:22:44 +0100
|
||||
Subject: [PATCH] fix warnings on sockaddr storage
|
||||
|
||||
Upstream: https://github.com/yrutschle/sslh/commit/402ca5219b5dcf7a502cd3f75906423527837a7a
|
||||
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
|
||||
---
|
||||
udp-listener.c | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/udp-listener.c b/udp-listener.c
|
||||
index 570e480..bc7a3f4 100644
|
||||
--- a/udp-listener.c
|
||||
+++ b/udp-listener.c
|
||||
@@ -36,10 +36,10 @@
|
||||
|
||||
static int cnx_cmp(struct connection* cnx1, struct connection* cnx2)
|
||||
{
|
||||
- struct sockaddr* addr1 = &cnx1->client_addr;
|
||||
+ struct sockaddr_storage* addr1 = &cnx1->client_addr;
|
||||
socklen_t addrlen1 = cnx1->addrlen;
|
||||
|
||||
- struct sockaddr* addr2 = &cnx2->client_addr;
|
||||
+ struct sockaddr_storage* addr2 = &cnx2->client_addr;
|
||||
socklen_t addrlen2 = cnx2->addrlen;
|
||||
|
||||
if (addrlen1 != addrlen2) return -1;
|
||||
@@ -52,13 +52,13 @@ static int cnx_cmp(struct connection* cnx1, struct connection* cnx2)
|
||||
* lowest bytes of remote port */
|
||||
static int hash_make_key(hash_item new)
|
||||
{
|
||||
- struct sockaddr* addr = &new->client_addr;
|
||||
+ struct sockaddr_storage* addr = &new->client_addr;
|
||||
//socklen_t addrlen = new->addrlen;
|
||||
struct sockaddr_in* addr4;
|
||||
struct sockaddr_in6* addr6;
|
||||
int out;
|
||||
|
||||
- switch (addr->sa_family) {
|
||||
+ switch (((struct sockaddr*)addr)->sa_family) {
|
||||
case AF_INET:
|
||||
addr4 = (struct sockaddr_in*)addr;
|
||||
out = addr4->sin_port;
|
||||
@@ -327,7 +327,7 @@ void udp_s2c_forward(struct connection* cnx)
|
||||
if ((res == -1) && ((errno == EAGAIN) || (errno == EWOULDBLOCK))) return;
|
||||
CHECK_RES_DIE(res, "udp_listener/recvfrom");
|
||||
res = sendto(cnx->local_endpoint, data, res, 0,
|
||||
- &cnx->client_addr, cnx->addrlen);
|
||||
+ (struct sockaddr*)&cnx->client_addr, cnx->addrlen);
|
||||
mark_active(cnx);
|
||||
}
|
||||
|
||||
--
|
||||
2.39.5
|
||||
|
||||
9
package/sslh/Config.in
Normal file
9
package/sslh/Config.in
Normal file
@@ -0,0 +1,9 @@
|
||||
config BR2_PACKAGE_SSLH
|
||||
bool "sslh"
|
||||
depends on BR2_USE_MMU # fork()
|
||||
select BR2_PACKAGE_LIBCONFIG if BR2_PACKAGE_SYSTEMD
|
||||
select BR2_PACKAGE_PCRE2
|
||||
help
|
||||
Applicative protocol multiplexer
|
||||
|
||||
http://www.rutschle.net/tech/sslh.shtml
|
||||
48
package/sslh/S35sslh
Normal file
48
package/sslh/S35sslh
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Starts the SSLH server
|
||||
#
|
||||
|
||||
# default setup : listen on port 8090 forward ssh traffic to
|
||||
# localhost:22 and http traffic to localhost:80
|
||||
SSLH_ARGS="--listen 0.0.0.0:8090 --ssh 127.0.0.1:22 --http 127.0.0.1:80"
|
||||
|
||||
# Allow a few customizations from a config file (overrides
|
||||
# default setup)
|
||||
test -r /etc/default/sslh && . /etc/default/sslh
|
||||
|
||||
start() {
|
||||
SSLH_ARGS="$SSLH_ARGS --user root"
|
||||
echo -n "Starting sslh: "
|
||||
start-stop-daemon -S -q -p /var/run/sslh.pid \
|
||||
--exec /usr/sbin/sslh -- $SSLH_ARGS
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf "Stopping sslh: "
|
||||
start-stop-daemon -K -q -p /var/run/sslh.pid
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|reload)
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
||||
3
package/sslh/sslh.hash
Normal file
3
package/sslh/sslh.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# Locally calculated
|
||||
sha256 d88d43ee11cf1324983c196c894b41766c33d957b6af53b62c8479703bbbd26c sslh-v2.0.1.tar.gz
|
||||
sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING
|
||||
65
package/sslh/sslh.mk
Normal file
65
package/sslh/sslh.mk
Normal file
@@ -0,0 +1,65 @@
|
||||
################################################################################
|
||||
#
|
||||
# sslh
|
||||
#
|
||||
################################################################################
|
||||
|
||||
SSLH_VERSION = 2.0.1
|
||||
SSLH_SOURCE = sslh-v$(SSLH_VERSION).tar.gz
|
||||
SSLH_SITE = http://www.rutschle.net/tech/sslh
|
||||
SSLH_LICENSE = GPL-2.0+
|
||||
SSLH_LICENSE_FILES = COPYING
|
||||
SSLH_CPE_ID_VALID = YES
|
||||
SSLH_DEPENDENCIES = pcre2
|
||||
|
||||
SSLH_MAKE_OPTS = $(TARGET_CONFIGURE_OPTS) CFLAGS="$(TARGET_CFLAGS) -std=gnu99"
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBBSD),y)
|
||||
SSLH_DEPENDENCIES += libbsd
|
||||
SSLH_MAKE_OPTS += USELIBBSD=1
|
||||
else
|
||||
SSLH_MAKE_OPTS += USELIBBSD=
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBCAP),y)
|
||||
SSLH_DEPENDENCIES += libcap
|
||||
SSLH_MAKE_OPTS += USELIBCAP=1
|
||||
else
|
||||
SSLH_MAKE_OPTS += USELIBCAP=
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBCONFIG),y)
|
||||
SSLH_DEPENDENCIES += libconfig
|
||||
SSLH_MAKE_OPTS += USELIBCONFIG=1
|
||||
else
|
||||
SSLH_MAKE_OPTS += USELIBCONFIG=
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBEV),y)
|
||||
SSLH_DEPENDENCIES += libev
|
||||
SSLH_MAKE_OPTS += USELIBEV=1
|
||||
else
|
||||
SSLH_MAKE_OPTS += USELIBEV=
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD),y)
|
||||
SSLH_DEPENDENCIES += systemd
|
||||
SSLH_MAKE_OPTS += USESYSTEMD=1
|
||||
else
|
||||
SSLH_MAKE_OPTS += USESYSTEMD=
|
||||
endif
|
||||
|
||||
define SSLH_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) $(SSLH_MAKE_OPTS) -C $(@D)
|
||||
endef
|
||||
|
||||
define SSLH_INSTALL_TARGET_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) $(SSLH_MAKE_OPTS) -C $(@D) \
|
||||
DESTDIR=$(TARGET_DIR) install
|
||||
endef
|
||||
|
||||
define SSLH_INSTALL_INIT_SYSV
|
||||
$(INSTALL) -m 755 -D package/sslh/S35sslh $(TARGET_DIR)/etc/init.d/S35sslh
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
Reference in New Issue
Block a user