Software /
code /
prosody
Comparison
util/sasl/scram.lua @ 2197:1509cabb8321
Add check for forbidden char sequences in validate_username().
author | Tobias Markmann <tm@ayena.de> |
---|---|
date | Tue, 17 Nov 2009 11:31:59 +0100 |
parent | 2196:614c839c30c5 |
child | 2198:d18b4d22b8da |
comparison
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 |