summaryrefslogtreecommitdiffstats
path: root/lib/authenticator.lua
diff options
context:
space:
mode:
authorNatanael Copa <natanael.copa@gmail.com>2009-01-23 12:45:12 +0000
committerNatanael Copa <natanael.copa@gmail.com>2009-01-23 12:45:12 +0000
commit6e0459aa4284fb6fd411a40025982b9d5a3c0460 (patch)
tree2e7475610333fef6943199e53c7754ea7ecffa5f /lib/authenticator.lua
parente4951a983b6edd3aa0ee1a3db4cd586907fb6455 (diff)
downloadacf-core-6e0459aa4284fb6fd411a40025982b9d5a3c0460.tar.bz2
acf-core-6e0459aa4284fb6fd411a40025982b9d5a3c0460.tar.xz
use the lua module md5 rather than call external prog md5sum
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1690 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lib/authenticator.lua')
-rw-r--r--lib/authenticator.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/authenticator.lua b/lib/authenticator.lua
index 92f3a10..578959b 100644
--- a/lib/authenticator.lua
+++ b/lib/authenticator.lua
@@ -5,6 +5,7 @@ module (..., package.seeall)
require("modelfunctions")
require("format")
+require("md5")
-- This is the sub-authenticator
-- In the future, this will be set based upon configuration
@@ -76,7 +77,7 @@ local write_settings = function(self, settings, id)
-- Password, password_confirm, roles are allowed to not exist, just leave the same
id.userid = settings.value.userid.value
id.username = settings.value.username.value
- if settings.value.password then id.password = format.md5sum_string(settings.value.password.value) end
+ if settings.value.password then id.password = md5.sumhexa(settings.value.password.value) end
if settings.value.roles then id.roles = table.concat(settings.value.roles.value, ",") end
return auth.write_entry(self, usertable, "", id.userid, (id.password or "")..":"..(id.username or "")..":"..(id.roles or ""))
@@ -129,7 +130,7 @@ authenticate = function(self, userid, password)
local id = get_id(userid)
if not id then
errtxt = "Userid not found"
- elseif id.password ~= format.md5sum_string(password) then
+ elseif id.password ~= md5.sumhexa(password) then
errtxt = "Invalid password"
end
end