Comparison

util/sasl.lua @ 1305:37657578ea85

util.sasl: Remove some nastiness
author Waqas Hussain <waqas20@gmail.com>
date Thu, 04 Jun 2009 20:27:53 +0500
parent 1161:5bc2b7b5b81d
child 1374:e85726d084d6
comparison
equal deleted inserted replaced
1304:0a49759464e0 1305:37657578ea85
136 return message; 136 return message;
137 end 137 end
138 138
139 local object = { mechanism = "DIGEST-MD5", realm = realm, password_handler = password_handler}; 139 local object = { mechanism = "DIGEST-MD5", realm = realm, password_handler = password_handler};
140 140
141 --TODO: something better than math.random would be nice, maybe OpenSSL's random number generator
142 object.nonce = generate_uuid(); 141 object.nonce = generate_uuid();
143 object.step = 0; 142 object.step = 0;
144 object.nonce_count = {}; 143 object.nonce_count = {};
145 144
146 function object.feed(self, message) 145 function object.feed(self, message)
247 local function new_anonymous(realm, password_handler) 246 local function new_anonymous(realm, password_handler)
248 local object = { mechanism = "ANONYMOUS", realm = realm, password_handler = password_handler} 247 local object = { mechanism = "ANONYMOUS", realm = realm, password_handler = password_handler}
249 function object.feed(self, message) 248 function object.feed(self, message)
250 return "success" 249 return "success"
251 end 250 end
252 --TODO: From XEP-0175 "It is RECOMMENDED for the node identifier to be a UUID as specified in RFC 4122 [5]." So util.uuid() should (or have an option to) behave as specified in RFC 4122.
253 object["username"] = generate_uuid() 251 object["username"] = generate_uuid()
254 return object 252 return object
255 end 253 end
256 254
257 255