mod_s2s: Close offending s2s streams missing an 'id' attribute with a stream error...
authorKim Alvefur <zash@zash.se>
Tue, 2 Sep 2014 15:24:25 +0000 (17:24 +0200)
committerKim Alvefur <zash@zash.se>
Tue, 2 Sep 2014 15:24:25 +0000 (17:24 +0200)
plugins/mod_s2s/mod_s2s.lua

index 4433442852329a406988ac7f02827946360b29a3..834e6a1ca28ddbc73aeea467f3462453c1fef780 100644 (file)
@@ -365,8 +365,11 @@ function stream_callbacks.streamopened(session, attr)
                session.notopen = nil;
        elseif session.direction == "outgoing" then
                session.notopen = nil;
-               -- If we are just using the connection for verifying dialback keys, we won't try and auth it
-               if not attr.id then error("stream response did not give us a streamid!!!"); end
+               if not attr.id then
+                       log("error", "Stream response did not give us a stream id!");
+                       session:close({ condition = "undefined-condition", text = "Missing stream ID" });
+                       return;
+               end
                session.streamid = attr.id;
 
                if session.secure and not session.cert_chain_status then