Comparison

plugins/mod_s2s/mod_s2s.lua @ 6378:3cec0eef0b70

mod_s2s: Close offending s2s streams missing an 'id' attribute with a stream error instead of throwing an unhandled error
author Kim Alvefur <zash@zash.se>
date Tue, 02 Sep 2014 17:24:25 +0200
parent 6364:4e93e8768c36
child 6380:4220ffb87b22
comparison
equal deleted inserted replaced
6369:84c50a9addbc 6378:3cec0eef0b70
363 send(features); 363 send(features);
364 end 364 end
365 session.notopen = nil; 365 session.notopen = nil;
366 elseif session.direction == "outgoing" then 366 elseif session.direction == "outgoing" then
367 session.notopen = nil; 367 session.notopen = nil;
368 -- If we are just using the connection for verifying dialback keys, we won't try and auth it 368 if not attr.id then
369 if not attr.id then error("stream response did not give us a streamid!!!"); end 369 log("error", "Stream response did not give us a stream id!");
370 session:close({ condition = "undefined-condition", text = "Missing stream ID" });
371 return;
372 end
370 session.streamid = attr.id; 373 session.streamid = attr.id;
371 374
372 if session.secure and not session.cert_chain_status then 375 if session.secure and not session.cert_chain_status then
373 if check_cert_status(session) == false then 376 if check_cert_status(session) == false then
374 return; 377 return;