util.sasl.scram: Only indicate channel binding support when TLS is used

Sun, 05 Oct 2014 13:20:29 +0200

author
Kim Alvefur <zash@zash.se>
date
Sun, 05 Oct 2014 13:20:29 +0200
changeset 365
48bf6993b4c4
parent 364
69fc23b44819
child 366
e969eca5c316

util.sasl.scram: Only indicate channel binding support when TLS is used

util/sasl/scram.lua file | annotate | diff | comparison | revisions
--- a/util/sasl/scram.lua	Tue Sep 30 12:18:28 2014 +0200
+++ b/util/sasl/scram.lua	Sun Oct 05 13:20:29 2014 +0200
@@ -47,7 +47,7 @@
 	local our_nonce = "r=" .. c_nonce;
 	local client_first_message_bare = username .. "," .. our_nonce;
 	local cbind_data = "";
-	local gs2_cbind_flag = "y";
+	local gs2_cbind_flag = stream.conn:ssl() and "y" or "n";
 	if name == "SCRAM-SHA-1-PLUS" then
 		cbind_data = stream.conn:socket():getfinished();
 		gs2_cbind_flag = "p=tls-unique";

mercurial