util.sasl.scram: Fix bug in validate_username function. (Thanks Florob)
authorTobias Markmann <tm@ayena.de>
Thu, 24 Feb 2011 17:56:19 +0000 (18:56 +0100)
committerTobias Markmann <tm@ayena.de>
Thu, 24 Feb 2011 17:56:19 +0000 (18:56 +0100)
util/sasl/scram.lua

index a9538c37d07e46dce7aff81f5da5d6e7803872b8..aad33ebcaafd45791ecdde7466f2fb3714564543 100644 (file)
@@ -79,13 +79,13 @@ end
 local function validate_username(username)
        -- check for forbidden char sequences
        for eq in username:gmatch("=(.?.?)") do
-               if eq ~= "2D" and eq ~= "3D" then
+               if eq ~= "2C" and eq ~= "3D" then
                        return false
                end
        end
        
-       -- replace =2D with , and =3D with =
-       username = username:gsub("=2D", ",");
+       -- replace =2C with , and =3D with =
+       username = username:gsub("=2C", ",");
        username = username:gsub("=3D", "=");
        
        -- apply SASLprep