summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-09-15 18:25:29 +0000
committerTed Trask <ttrask01@yahoo.com>2014-09-15 18:25:29 +0000
commitdb375e2520b7a79b74e8f6415f055a76e81005d7 (patch)
treea11bd33feb49c5841413ff8feafcdc354540feb0
parent2e34d7b6a7eeea84694a987606758bce3d3994ed (diff)
downloadacf-freeradius3-db375e2520b7a79b74e8f6415f055a76e81005d7.tar.bz2
acf-freeradius3-db375e2520b7a79b74e8f6415f055a76e81005d7.tar.xz
Fix password validation for DES passwords
-rw-r--r--freeradius3-model.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/freeradius3-model.lua b/freeradius3-model.lua
index 1606971..df85118 100644
--- a/freeradius3-model.lua
+++ b/freeradius3-model.lua
@@ -554,7 +554,8 @@ function mymodule.update_passwd(self, passwd)
local success = false
passwd.value.oldpassword.errtxt = "Incorrect password"
local algo_salt, hash = string.match(pwhash, "^(%$%d%$[a-zA-Z0-9./]+%$)(.*)")
- if algo_salt ~= nil and hash ~= nil then
+ if not algo_salt then algo_salt = string.sub(pwhash, 1, 3) end
+ if algo_salt ~= nil then
if (pwhash == posix.crypt(passwd.value.oldpassword.value, algo_salt)) then
success = true
passwd.value.oldpassword.errtxt = nil