Software /
code /
verse
Comparison
util/sasl/scram.lua @ 365:48bf6993b4c4
util.sasl.scram: Only indicate channel binding support when TLS is used
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 05 Oct 2014 13:20:29 +0200 |
parent | 363:056ccefa6acf |
child | 390:7f535a1d5827 |
comparison
equal
deleted
inserted
replaced
364:69fc23b44819 | 365:48bf6993b4c4 |
---|---|
45 local username = "n=" .. value_safe(stream.username); | 45 local username = "n=" .. value_safe(stream.username); |
46 local c_nonce = base64(crypto.rand.bytes(15)); | 46 local c_nonce = base64(crypto.rand.bytes(15)); |
47 local our_nonce = "r=" .. c_nonce; | 47 local our_nonce = "r=" .. c_nonce; |
48 local client_first_message_bare = username .. "," .. our_nonce; | 48 local client_first_message_bare = username .. "," .. our_nonce; |
49 local cbind_data = ""; | 49 local cbind_data = ""; |
50 local gs2_cbind_flag = "y"; | 50 local gs2_cbind_flag = stream.conn:ssl() and "y" or "n"; |
51 if name == "SCRAM-SHA-1-PLUS" then | 51 if name == "SCRAM-SHA-1-PLUS" then |
52 cbind_data = stream.conn:socket():getfinished(); | 52 cbind_data = stream.conn:socket():getfinished(); |
53 gs2_cbind_flag = "p=tls-unique"; | 53 gs2_cbind_flag = "p=tls-unique"; |
54 end | 54 end |
55 local gs2_header = gs2_cbind_flag .. ",,"; | 55 local gs2_header = gs2_cbind_flag .. ",,"; |