Comparison

plugins/mod_dialback.lua @ 11557:6be890ca492e 0.11

mod_dialback: Use correct host for certificate check (fixes #1381)
author Kim Alvefur <zash@zash.se>
date Sun, 23 Jun 2019 16:16:26 +0200
parent 11556:6f56170ea986
child 11558:d0e9ffccdef9
comparison
equal deleted inserted replaced
11556:6f56170ea986 11557:6be890ca492e
23 23
24 local dialback_secret = sha256_hash(module:get_option_string("dialback_secret", uuid_gen()), true); 24 local dialback_secret = sha256_hash(module:get_option_string("dialback_secret", uuid_gen()), true);
25 local dwd = module:get_option_boolean("dialback_without_dialback", false); 25 local dwd = module:get_option_boolean("dialback_without_dialback", false);
26 26
27 --- Helper to check that a session peer's certificate is valid 27 --- Helper to check that a session peer's certificate is valid
28 function check_cert_status(session) 28 function check_cert_status(session, host)
29 local host = session.direction == "outgoing" and session.to_host or session.from_host
30 local conn = session.conn:socket() 29 local conn = session.conn:socket()
31 local cert 30 local cert
32 if conn.getpeercertificate then 31 if conn.getpeercertificate then
33 cert = conn:getpeercertificate() 32 cert = conn:getpeercertificate()
34 end 33 end