From: Jo-Philipp Wich Date: Tue, 10 Mar 2015 17:55:46 +0000 (+0100) Subject: Merge pull request #304 from nmav/ocserv-crypt X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=dd2b05289b40002b2e4c098abfc88052e423215f;hp=-c Merge pull request #304 from nmav/ocserv-crypt luci-app-ocserv: uclibc's crypt() doesn't support sha2crypt --- dd2b05289b40002b2e4c098abfc88052e423215f diff --combined applications/luci-app-ocserv/luasrc/model/cbi/ocserv/users.lua index 8cf35b79b,2e530c084..c4be1818f --- a/applications/luci-app-ocserv/luasrc/model/cbi/ocserv/users.lua +++ b/applications/luci-app-ocserv/luasrc/model/cbi/ocserv/users.lua @@@ -30,7 -30,7 +30,7 @@@ function pwd.write(self, section, value pass = value else local t = tonumber(nixio.getpid()*os.time()) - local salt = "$5$" .. t .. "$" + local salt = "$1$" .. t .. "$" pass = nixio.crypt(value, salt) end Value.write(self, section, pass) @@@ -47,7 -47,7 +47,7 @@@ if fd then local l if not ln then break end local id, user, group, vpn_ip, ip, device, time, cipher, status = - ln:match("^%s*(%d+)%s+([-_%w]+)%s+([%.%*-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+).*") + ln:match("^%s*(%d+)%s+([-_%w]+)%s+([%.%*-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%(%)%:%.-_%w]+)%s+([%:%.-_%w]+).*") if id then table.insert(lusers, {id, user, group, vpn_ip, ip, device, time, cipher, status}) end