-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from max0y/dev
merge dev, add support for PEAP and MSCHAPV2
- Loading branch information
Showing
8 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
.vscode | ||
# Windows thumbnail cache files | ||
Thumbs.db | ||
ehthumbs.db | ||
ehthumbs_vista.db | ||
|
||
# Folder config file | ||
[Dd]esktop.ini | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
include $(TOPDIR)/rules.mk | ||
|
||
PKG_NAME:=luci-app-cd8021x | ||
PKG_VERSION=1.1 | ||
PKG_VERSION=1.2.0 | ||
PKG_RELEASE:=1 | ||
|
||
PKG_LICENSE:=GPLv3 | ||
PKG_LICENSE_FILES:=LICENSE | ||
PKG_MAINTAINER:=max0y <[email protected]> | ||
|
||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) | ||
|
||
include $(INCLUDE_DIR)/package.mk | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ config login | |
option username '' | ||
option password '' | ||
option ifname 'eth0' | ||
option eap 'MD5' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
#!/bin/sh /etc/rc.common | ||
|
||
# Copyright (C) 2018 max0y <[email protected]> | ||
# Licensed to the public under the GNU General Public License v3. | ||
|
||
START=50 | ||
|
||
run_cd8021x() | ||
|
@@ -10,13 +14,28 @@ run_cd8021x() | |
local username | ||
local password | ||
local ifname | ||
local eap | ||
|
||
config_get username $1 username | ||
config_get password $1 password | ||
config_get ifname $1 ifname | ||
config_get eap $1 eap | ||
|
||
killall wpa_supplicant | ||
echo -e "ctrl_interface=/var/run/wpa_supplicant\nap_scan=0\nnetwork={\nkey_mgmt=IEEE8021X\neap=MD5\nidentity=\"$username\"\npassword=\"$password\"\neapol_flags=0\n}" > /tmp/cd8021x.conf | ||
echo -e "ctrl_interface=/var/run/wpa_supplicant\nctrl_interface_group=root\nap_scan=0\nnetwork={\nkey_mgmt=IEEE8021X\neap=$eap\nidentity=\"$username\"\npassword=\"$password\"" > /tmp/cd8021x.conf | ||
case "$eap" in | ||
"MD5") | ||
echo -e "eapol_flags=0\n}" >> /tmp/cd8021x.conf | ||
;; | ||
"PEAP") | ||
echo -e "anonymous_identity=\"$username\"\npairwise=CCMP TKIP\nphase2=\"auth=MSCHAPV2\"\npriority=2\n}" >> /tmp/cd8021x.conf | ||
;; | ||
"MSCHAPV2") | ||
echo -e "eapol_flags=0\nphase1=\"peaplabel=1\"\nphase2=\"auth=MSCHAPV2\"\n}" >> /tmp/cd8021x.conf | ||
;; | ||
*) | ||
esac | ||
|
||
wpa_supplicant -B -c /tmp/cd8021x.conf -i$ifname -Dwired | ||
|
||
echo "cd802.1x client has started." | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
-- Copyright (C) 2018 max0y <[email protected]> | ||
-- Licensed to the public under the GNU General Public License v3. | ||
|
||
module("luci.controller.cd8021x", package.seeall) | ||
|
||
function index() | ||
entry({"admin", "network", "cd8021x"}, cbi("cd8021x"), _("cd802.1x client"), 100) | ||
entry({"admin", "network", "cd8021x"}, cbi("cd8021x"), _("cd802.1x client"), 100).dependent = true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
-- Copyright (C) 2018 max0y <[email protected]> | ||
-- Licensed to the public under the GNU General Public License v3. | ||
|
||
require("luci.sys") | ||
|
||
local eap_list = { | ||
"MD5", | ||
"PEAP", | ||
"MSCHAPV2", | ||
} | ||
|
||
m = Map("cd8021x", translate("cd802.1x client"), | ||
translate("Configure IEEE 802.1x wired authentication, you may need to edit your WAN interface protocol as <i>DHCP client</i> <a href=\"network\">here</a>.")) | ||
|
||
|
@@ -19,6 +28,11 @@ for k, v in ipairs(luci.sys.net.devices()) do | |
end | ||
end | ||
|
||
eap = s:option(ListValue, "eap", translate("EAP")) | ||
for k, v in ipairs(eap_list) do | ||
eap:value(v) | ||
end | ||
|
||
local apply = luci.http.formvalue("cbi.apply") | ||
if apply then | ||
io.popen("/etc/init.d/cd8021x restart") | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.