util/sasl/scram.lua
changeset 2197 1509cabb8321
parent 2196 614c839c30c5
child 2198 d18b4d22b8da
equal deleted inserted replaced
2196:614c839c30c5 2197:1509cabb8321
    58 	return res
    58 	return res
    59 end
    59 end
    60 
    60 
    61 local function validate_username(username)
    61 local function validate_username(username)
    62 	-- check for forbidden char sequences
    62 	-- check for forbidden char sequences
    63 	
    63 	for eq in s:gmatch("=(.?.?)") do
       
    64 		if eq ~= "2D" and eq ~= "3D" then return false end end return true;
    64 	-- replace =2D with , and =3D with =
    65 	-- replace =2D with , and =3D with =
    65 	
    66 	
    66 	-- apply SASLprep
    67 	-- apply SASLprep
    67 	return username;
    68 	return username;
    68 end
    69 end