Comparison

plugins/mod_s2s/mod_s2s.lua @ 5764:969e0a054795

mod_c2s, mod_s2s: Log a message that stream encryption has been enabled with some details
author Kim Alvefur <zash@zash.se>
date Fri, 02 Aug 2013 15:12:24 +0200
parent 5713:5cf6dedf36f4
child 5770:7722372aa087
comparison
equal deleted inserted replaced
5763:0e52f1d5ca71 5764:969e0a054795
281 281
282 -- TODO: Rename session.secure to session.encrypted 282 -- TODO: Rename session.secure to session.encrypted
283 if session.secure == false then 283 if session.secure == false then
284 session.secure = true; 284 session.secure = true;
285 285
286 -- Check if TLS compression is used
287 local sock = session.conn:socket(); 286 local sock = session.conn:socket();
288 if sock.info then 287 if sock.info then
289 session.compressed = sock:info"compression"; 288 local info = sock:info();
290 elseif sock.compression then 289 (session.log or log)("info", "Stream encrypted (%s) with %s, authenticated with %s and exchanged keys with %s",
291 session.compressed = sock:compression(); --COMPAT mw/luasec-hg 290 info.protocol, info.encryption, info.authentication, info.key);
291 session.compressed = info.compression;
292 else
293 (session.log or log)("info", "Stream encrypted");
294 session.compressed = sock.compression and sock:compression(); --COMPAT mw/luasec-hg
292 end 295 end
293 end 296 end
294 297
295 if session.direction == "incoming" then 298 if session.direction == "incoming" then
296 -- Send a reply stream header 299 -- Send a reply stream header