Changeset

4511:92597f6223de

core.s2smanager: Fix check_cert_status() for when the stream has no from attr
author Kim Alvefur <zash@zash.se>
date Tue, 21 Feb 2012 21:13:13 +0100
parents 4508:b9e0bd59d817
children 4512:eb97612bf42b 4513:23b540ab346a
files core/s2smanager.lua
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/core/s2smanager.lua	Sun Feb 12 17:53:50 2012 +0000
+++ b/core/s2smanager.lua	Tue Feb 21 21:13:13 2012 +0100
@@ -410,7 +410,12 @@
 			(session.log or log)("debug", "certificate chain validation result: valid");
 			session.cert_chain_status = "valid";
 
-			local host = session.direction == "incoming" and session.from_host or session.to_host
+			local host;
+			if session.direction == "incoming" then
+				host = session.from_host;
+			else
+				host = session.to_host;
+			end
 
 			-- We'll go ahead and verify the asserted identity if the
 			-- connecting server specified one.