aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/authsae
diff options
context:
space:
mode:
Diffstat (limited to 'package/network/services/authsae')
-rw-r--r--package/network/services/authsae/Makefile47
-rw-r--r--package/network/services/authsae/files/lib/wifi/authsae.sh57
-rw-r--r--package/network/services/authsae/patches/100-musl_fix.patch20
3 files changed, 124 insertions, 0 deletions
diff --git a/package/network/services/authsae/Makefile b/package/network/services/authsae/Makefile
new file mode 100644
index 0000000..2955021
--- /dev/null
+++ b/package/network/services/authsae/Makefile
@@ -0,0 +1,47 @@
+
+# Copyright (C) 2007-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=authsae
+PKG_VERSION:=2014-06-09
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=git://github.com/cozybit/authsae.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=8531ab158910a525d4bcbb3ad02c08342f6987f2
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_BUILD_PARALLEL:=1
+CMAKE_INSTALL:=1
+
+CMAKE_OPTIONS += -DSYSCONF_INSTALL_DIR=/etc
+
+PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
+PKG_LICENSE:=BSD-4-Clause
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/authsae
+ SECTION:=net
+ CATEGORY:=Network
+ TITLE:=80211s mesh security
+ DEPENDS:=+libopenssl +libconfig +libnl-tiny +@OPENSSL_WITH_EC
+endef
+
+TARGET_CFLAGS += -D_GNU_SOURCE
+
+define Package/authsae/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
+ $(INSTALL_DIR) $(1)/lib/wifi
+ $(INSTALL_DATA) ./files/lib/wifi/authsae.sh $(1)/lib/wifi/
+endef
+
+$(eval $(call BuildPackage,authsae))
diff --git a/package/network/services/authsae/files/lib/wifi/authsae.sh b/package/network/services/authsae/files/lib/wifi/authsae.sh
new file mode 100644
index 0000000..d8c5598
--- /dev/null
+++ b/package/network/services/authsae/files/lib/wifi/authsae.sh
@@ -0,0 +1,57 @@
+authsae_start_interface() {
+ local mcast_rate
+ local mesh_htmode
+ local mesh_band
+ local authsae_conf_file="/var/run/authsae-$ifname.cfg"
+ local ret=1
+
+ json_get_vars mcast_rate
+ set_default mcast_rate "12"
+
+ case "$htmode" in
+ HT20|HT40+|HT40-) mesh_htmode="$htmode";;
+ *) mesh_htmode="none";;
+ esac
+
+ case "$hwmode" in
+ *g*) mesh_band=11g;;
+ *a*) mesh_band=11a;;
+ esac
+
+ cat > "$authsae_conf_file" <<EOF
+authsae:
+{
+ sae:
+ {
+ debug = 0;
+ password = "$key";
+ group = [19, 26, 21, 25, 20];
+ blacklist = 5;
+ thresh = 5;
+ lifetime = 3600;
+ };
+ meshd:
+ {
+ meshid = "$mesh_id";
+ interface = "$ifname";
+ passive = 0;
+ debug = 0;
+ mediaopt = 1;
+ band = "$mesh_band";
+ channel = $channel;
+ htmode = "$mesh_htmode";
+ mcast-rate = $mcast_rate;
+ };
+};
+EOF
+
+ /usr/bin/meshd-nl80211 -i "$ifname" -s "$mesh_id" -c "$authsae_conf_file" </dev/null >/dev/null 2>/dev/null &
+ authsae_pid="$!"
+ ret="$?"
+
+ echo $authsae_pid > /var/run/authsae-$ifname.pid
+ wireless_add_process "$authsae_pid" "/usr/bin/meshd-nl80211" 1
+
+ [ "$ret" != 0 ] && wireless_setup_vif_failed AUTHSAE_FAILED
+ return $ret
+}
diff --git a/package/network/services/authsae/patches/100-musl_fix.patch b/package/network/services/authsae/patches/100-musl_fix.patch
new file mode 100644
index 0000000..19d2d9b
--- /dev/null
+++ b/package/network/services/authsae/patches/100-musl_fix.patch
@@ -0,0 +1,20 @@
+--- a/linux/mon.c
++++ b/linux/mon.c
+@@ -44,7 +44,6 @@
+ #include <signal.h>
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+-#include <sys/sysctl.h>
+ #include <sys/queue.h>
+ #include <netinet/in.h>
+ #include <net/if.h>
+--- a/linux/meshd.c
++++ b/linux/meshd.c
+@@ -44,7 +44,6 @@
+ #include <signal.h>
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+-#include <sys/sysctl.h>
+ #include <sys/queue.h>
+ #include <netinet/in.h>
+ #include <net/if.h>