X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/7511f4b4df521656d422010b06e2b5b96b21eb84..c3b5b5f648d953307672a4b30e9222787668f708:/filters/gentoo-ldap-authentication.lua diff --git a/filters/gentoo-ldap-authentication.lua b/filters/gentoo-ldap-authentication.lua index fce5632..c1e382f 100644 --- a/filters/gentoo-ldap-authentication.lua +++ b/filters/gentoo-ldap-authentication.lua @@ -4,7 +4,7 @@ -- luacrypto >= 0.3 -- -- lualdap >= 1.2 --- +-- -- @@ -271,7 +271,7 @@ function validate_value(expected_field, cookie) end -- Lua hashes strings, so these comparisons are time invariant. - if hmac ~= crypto.hmac.digest("sha1", field .. "|" .. value .. "|" .. tostring(expiration) .. "|" .. salt, secret) then + if hmac ~= crypto.hmac.digest("sha256", field .. "|" .. value .. "|" .. tostring(expiration) .. "|" .. salt, secret) then return nil end @@ -296,7 +296,7 @@ function secure_value(field, value, expiration) value = url_encode(value) field = url_encode(field) authstr = field .. "|" .. value .. "|" .. tostring(expiration) .. "|" .. salt - authstr = authstr .. "|" .. crypto.hmac.digest("sha1", authstr, secret) + authstr = authstr .. "|" .. crypto.hmac.digest("sha256", authstr, secret) return authstr end