From a43385b8dbb9a467314fb42b2276daad45c2844b Mon Sep 17 00:00:00 2001 From: yrutschle Date: Fri, 13 Aug 2021 18:03:59 +0200 Subject: [PATCH] remove hardcoded quick50 and teamspeak. to be replaced with a generalised regex setup to come in next version --- echosrv-conf.c | 4 ++-- echosrv-conf.h | 4 ++-- probe.c | 14 -------------- sslh-conf.c | 48 +----------------------------------------------- sslh-conf.h | 2 +- sslhconf.cfg | 24 ------------------------ 6 files changed, 6 insertions(+), 90 deletions(-) diff --git a/echosrv-conf.c b/echosrv-conf.c index d7c0877..38ddc3b 100644 --- a/echosrv-conf.c +++ b/echosrv-conf.c @@ -1,8 +1,8 @@ /* Generated by conf2struct (https://www.rutschle.net/tech/conf2struct/README) - * on Fri Jul 23 22:34:02 2021. + * on Fri Aug 13 18:03:20 2021. # conf2struct: generate libconf parsers that read to structs -# Copyright (C) 2018-2019 Yves Rutschle +# Copyright (C) 2018-2021 Yves Rutschle # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/echosrv-conf.h b/echosrv-conf.h index 21fd453..4f49e9e 100644 --- a/echosrv-conf.h +++ b/echosrv-conf.h @@ -1,8 +1,8 @@ /* Generated by conf2struct (https://www.rutschle.net/tech/conf2struct/README) - * on Fri Jul 23 22:34:02 2021. + * on Fri Aug 13 18:03:20 2021. # conf2struct: generate libconf parsers that read to structs -# Copyright (C) 2018-2019 Yves Rutschle +# Copyright (C) 2018-2021 Yves Rutschle # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/probe.c b/probe.c index 28e58fe..f3d4529 100644 --- a/probe.c +++ b/probe.c @@ -38,8 +38,6 @@ static int is_http_protocol(const char *p, ssize_t len, struct sslhcfg_protocols static int is_tls_protocol(const char *p, ssize_t len, struct sslhcfg_protocols_item*); static int is_adb_protocol(const char *p, ssize_t len, struct sslhcfg_protocols_item*); static int is_socks5_protocol(const char *p, ssize_t len, struct sslhcfg_protocols_item*); -static int is_quick_protocol(const char *p, ssize_t len, struct sslhcfg_protocols_item*); -static int is_teamspeak_protocol(const char *p, ssize_t len, struct sslhcfg_protocols_item*); static int is_syslog_protocol(const char *p, ssize_t len, struct sslhcfg_protocols_item*); static int is_true(const char *p, ssize_t len, struct sslhcfg_protocols_item* proto) { return 1; } @@ -55,8 +53,6 @@ static struct protocol_probe_desc builtins[] = { { "tls", is_tls_protocol }, { "adb", is_adb_protocol }, { "socks5", is_socks5_protocol }, - { "quick50", is_quick_protocol }, - { "teamspeak", is_teamspeak_protocol }, { "syslog", is_syslog_protocol }, { "anyprot", is_true } }; @@ -303,16 +299,6 @@ static int is_socks5_protocol(const char *p_in, ssize_t len, struct sslhcfg_prot return PROBE_MATCH; } -static int is_quick_protocol(const char *p, ssize_t len, struct sslhcfg_protocols_item* proto) -{ - return memmem(p, len, "Q050", 4) ? 1 : 0; -} - -static int is_teamspeak_protocol(const char *p, ssize_t len, struct sslhcfg_protocols_item* proto) -{ - return memmem(p, len, "TS3INIT1", 8) ? 1 : 0; -} - static int is_syslog_protocol(const char *p, ssize_t len, struct sslhcfg_protocols_item* proto) { int res, i, j; diff --git a/sslh-conf.c b/sslh-conf.c index cf255a8..750a641 100644 --- a/sslh-conf.c +++ b/sslh-conf.c @@ -1,5 +1,5 @@ /* Generated by conf2struct (https://www.rutschle.net/tech/conf2struct/README) - * on Wed Aug 4 09:40:03 2021. + * on Fri Aug 13 18:03:18 2021. # conf2struct: generate libconf parsers that read to structs # Copyright (C) 2018-2021 Yves Rutschle @@ -464,8 +464,6 @@ struct arg_file* sslhcfg_conffile; struct arg_str* sslhcfg_http; struct arg_str* sslhcfg_adb; struct arg_str* sslhcfg_socks5; - struct arg_str* sslhcfg_quick50; - struct arg_str* sslhcfg_teamspeak; struct arg_str* sslhcfg_syslog; struct arg_str* sslhcfg_anyprot; struct arg_end* sslhcfg_end; @@ -1029,24 +1027,6 @@ static struct compound_cl_target sslhcfg_syslog_targets [] = { { 0 } }; -static struct compound_cl_target sslhcfg_teamspeak_targets [] = { - { & table_sslhcfg_protocols[0], 0, .value.def_string = "teamspeak" }, - { & table_sslhcfg_protocols[1], 1, .value.def_string = "0" }, - { & table_sslhcfg_protocols[2], 2, .value.def_string = "0" }, - { & table_sslhcfg_protocols[4], 0, .value.def_bool = 1 }, - { & table_sslhcfg_protocols[9], 0, .value.def_int = 1 }, - { 0 } -}; - -static struct compound_cl_target sslhcfg_quick50_targets [] = { - { & table_sslhcfg_protocols[0], 0, .value.def_string = "quick50" }, - { & table_sslhcfg_protocols[1], 1, .value.def_string = "0" }, - { & table_sslhcfg_protocols[2], 2, .value.def_string = "0" }, - { & table_sslhcfg_protocols[4], 0, .value.def_bool = 1 }, - { & table_sslhcfg_protocols[9], 0, .value.def_int = 1 }, - { 0 } -}; - static struct compound_cl_target sslhcfg_socks5_targets [] = { { & table_sslhcfg_protocols[0], 0, .value.def_string = "socks5" }, { & table_sslhcfg_protocols[1], 1, .value.def_string = "0" }, @@ -1231,30 +1211,6 @@ static struct compound_cl_arg compound_cl_args[] = { .override_const = "socks5", }, - { /* arg: quick50 */ - .regex = "(.+):(\\w+)", - .arg_cl = & sslhcfg_quick50, - .base_entry = & table_sslhcfg [13], - .targets = sslhcfg_quick50_targets, - - - .override_desc = & table_sslhcfg_protocols [0], - .override_matchindex = 0, - .override_const = "quick50", - }, - - { /* arg: teamspeak */ - .regex = "(.+):(\\w+)", - .arg_cl = & sslhcfg_teamspeak, - .base_entry = & table_sslhcfg [13], - .targets = sslhcfg_teamspeak_targets, - - - .override_desc = & table_sslhcfg_protocols [0], - .override_matchindex = 0, - .override_const = "teamspeak", - }, - { /* arg: syslog */ .regex = "(.+):(\\w+)", .arg_cl = & sslhcfg_syslog, @@ -1956,8 +1912,6 @@ int sslhcfg_cl_parse(int argc, char* argv[], struct sslhcfg_item* cfg) sslhcfg_http = arg_strn(NULL, "http", "", 0, 10, "Set up HTTP (plain) target"), sslhcfg_adb = arg_strn(NULL, "adb", "", 0, 10, "Set up ADB (Android Debug) target"), sslhcfg_socks5 = arg_strn(NULL, "socks5", "", 0, 10, "Set up socks5 target"), - sslhcfg_quick50 = arg_strn(NULL, "quick50", "", 0, 10, "Set up QUICK-50 target"), - sslhcfg_teamspeak = arg_strn(NULL, "teamspeak", "", 0, 10, "Set up Teamspeak3 target"), sslhcfg_syslog = arg_strn(NULL, "syslog", "", 0, 10, "Set up syslog target"), sslhcfg_anyprot = arg_strn(NULL, "anyprot", "", 0, 10, "Set up default target"), sslhcfg_end = arg_end(10) diff --git a/sslh-conf.h b/sslh-conf.h index c94c41d..9f23178 100644 --- a/sslh-conf.h +++ b/sslh-conf.h @@ -1,5 +1,5 @@ /* Generated by conf2struct (https://www.rutschle.net/tech/conf2struct/README) - * on Wed Aug 4 09:40:03 2021. + * on Fri Aug 13 18:03:18 2021. # conf2struct: generate libconf parsers that read to structs # Copyright (C) 2018-2021 Yves Rutschle diff --git a/sslhconf.cfg b/sslhconf.cfg index 6881b2d..9884199 100644 --- a/sslhconf.cfg +++ b/sslhconf.cfg @@ -220,30 +220,6 @@ cl_groups: ( { path: "log_level"; value: 1 } ); }, - { name: "quick50"; pattern: "(.+):(\w+)"; description: "Set up QUICK-50 target"; - list: "protocols"; - override: "name"; - argdesc: ""; - targets: ( - { path: "name"; value: "quick50" }, - { path: "host"; value: "$1" }, - { path: "port"; value: "$2" }, - { path: "is_udp"; value: "1" }, - { path: "log_level"; value: 1 } - ); - }, - { name: "teamspeak"; pattern: "(.+):(\w+)"; description: "Set up Teamspeak3 target"; - list: "protocols"; - override: "name"; - argdesc: ""; - targets: ( - { path: "name"; value: "teamspeak" }, - { path: "host"; value: "$1" }, - { path: "port"; value: "$2" }, - { path: "is_udp"; value: "1" }, - { path: "log_level"; value: 1 } - ); - }, { name: "syslog"; pattern: "(.+):(\w+)"; description: "Set up syslog target"; list: "protocols"; override: "name";