Software /
code /
prosody
Comparison
util/sasl/scram.lua @ 4368:916834f22d1b
util.sasl.scram: Return proper error and don't touch datastores on empty username.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Wed, 31 Aug 2011 23:24:13 +0500 |
parent | 4204:edd7b0610c2c |
child | 5301:6279caf921f1 |
comparison
equal
deleted
inserted
replaced
4367:98b258b7d5dc | 4368:916834f22d1b |
---|---|
88 username = username:gsub("=2C", ","); | 88 username = username:gsub("=2C", ","); |
89 username = username:gsub("=3D", "="); | 89 username = username:gsub("=3D", "="); |
90 | 90 |
91 -- apply SASLprep | 91 -- apply SASLprep |
92 username = saslprep(username); | 92 username = saslprep(username); |
93 return username; | 93 return username and #username>0 and username; |
94 end | 94 end |
95 | 95 |
96 local function hashprep(hashname) | 96 local function hashprep(hashname) |
97 return hashname:lower():gsub("-", "_"); | 97 return hashname:lower():gsub("-", "_"); |
98 end | 98 end |