Comparison

core/s2smanager.lua @ 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
parent 4493:cad62a675b60
child 4512:eb97612bf42b
child 4513:23b540ab346a
comparison
equal deleted inserted replaced
4508:b9e0bd59d817 4511:92597f6223de
408 session.cert_chain_status = "invalid"; 408 session.cert_chain_status = "invalid";
409 else 409 else
410 (session.log or log)("debug", "certificate chain validation result: valid"); 410 (session.log or log)("debug", "certificate chain validation result: valid");
411 session.cert_chain_status = "valid"; 411 session.cert_chain_status = "valid";
412 412
413 local host = session.direction == "incoming" and session.from_host or session.to_host 413 local host;
414 if session.direction == "incoming" then
415 host = session.from_host;
416 else
417 host = session.to_host;
418 end
414 419
415 -- We'll go ahead and verify the asserted identity if the 420 -- We'll go ahead and verify the asserted identity if the
416 -- connecting server specified one. 421 -- connecting server specified one.
417 if host then 422 if host then
418 if cert_verify_identity(host, "xmpp-server", cert) then 423 if cert_verify_identity(host, "xmpp-server", cert) then