Add check for forbidden char sequences in validate_username().

Tue, 17 Nov 2009 11:31:59 +0100

author
Tobias Markmann <tm@ayena.de>
date
Tue, 17 Nov 2009 11:31:59 +0100
changeset 2193
1509cabb8321
parent 2192
614c839c30c5
child 2194
d18b4d22b8da

Add check for forbidden char sequences in validate_username().

util/sasl/scram.lua file | annotate | diff | comparison | revisions
--- a/util/sasl/scram.lua	Tue Nov 17 11:03:54 2009 +0100
+++ b/util/sasl/scram.lua	Tue Nov 17 11:31:59 2009 +0100
@@ -60,7 +60,8 @@
 
 local function validate_username(username)
 	-- check for forbidden char sequences
-	
+	for eq in s:gmatch("=(.?.?)") do
+		if eq ~= "2D" and eq ~= "3D" then return false end end return true;
 	-- replace =2D with , and =3D with =
 	
 	-- apply SASLprep

mercurial