util/sasl/plain.lua

Thu, 18 Sep 2014 18:59:34 +0200

author
Kim Alvefur <zash@zash.se>
date
Thu, 18 Sep 2014 18:59:34 +0200
changeset 354
58cd27b74ba5
child 358
a8f6fd6a70ed
permissions
-rw-r--r--

Almost a SASL framework, supports negotiation and challenge-response, mechanism code split out into util/sasl/

354
58cd27b74ba5 Almost a SASL framework, supports negotiation and challenge-response, mechanism code split out into util/sasl/
Kim Alvefur <zash@zash.se>
parents:
diff changeset
1
58cd27b74ba5 Almost a SASL framework, supports negotiation and challenge-response, mechanism code split out into util/sasl/
Kim Alvefur <zash@zash.se>
parents:
diff changeset
2 return function (stream, mechanisms, preference)
58cd27b74ba5 Almost a SASL framework, supports negotiation and challenge-response, mechanism code split out into util/sasl/
Kim Alvefur <zash@zash.se>
parents:
diff changeset
3 if stream.username and stream.password then
58cd27b74ba5 Almost a SASL framework, supports negotiation and challenge-response, mechanism code split out into util/sasl/
Kim Alvefur <zash@zash.se>
parents:
diff changeset
4 mechanisms["PLAIN"] = function (stream)
58cd27b74ba5 Almost a SASL framework, supports negotiation and challenge-response, mechanism code split out into util/sasl/
Kim Alvefur <zash@zash.se>
parents:
diff changeset
5 return "success" == coroutine.yield("\0"..stream.username.."\0"..stream.password);
58cd27b74ba5 Almost a SASL framework, supports negotiation and challenge-response, mechanism code split out into util/sasl/
Kim Alvefur <zash@zash.se>
parents:
diff changeset
6 end;
58cd27b74ba5 Almost a SASL framework, supports negotiation and challenge-response, mechanism code split out into util/sasl/
Kim Alvefur <zash@zash.se>
parents:
diff changeset
7 preference["PLAIN"] = 5;
58cd27b74ba5 Almost a SASL framework, supports negotiation and challenge-response, mechanism code split out into util/sasl/
Kim Alvefur <zash@zash.se>
parents:
diff changeset
8 end
58cd27b74ba5 Almost a SASL framework, supports negotiation and challenge-response, mechanism code split out into util/sasl/
Kim Alvefur <zash@zash.se>
parents:
diff changeset
9 end
58cd27b74ba5 Almost a SASL framework, supports negotiation and challenge-response, mechanism code split out into util/sasl/
Kim Alvefur <zash@zash.se>
parents:
diff changeset
10

mercurial