diff mod_watchuntrusted/mod_watchuntrusted.lua @ 1878:7f96183a60ce

mod_watchuntrusted: Add support for SHA-256 hash in message
author Kim Alvefur <zash@zash.se>
date Sun, 27 Sep 2015 21:41:35 +0200
parents 055b39c08fd0
children 4c4a4191b825
line wrap: on
line diff
--- a/mod_watchuntrusted/mod_watchuntrusted.lua	Sun Sep 27 14:58:15 2015 +0200
+++ b/mod_watchuntrusted/mod_watchuntrusted.lua	Sun Sep 27 21:41:35 2015 +0200
@@ -43,7 +43,11 @@
 			error_message = error_message .. "This certificate is " .. session.cert_identity_status .. " for " .. host .. ".";
 		end
 
-		local replacements = { sha1 = event.cert and event.cert:digest("sha1"), errors = error_message };
+		local replacements = {
+			sha1 = event.cert and event.cert:digest("sha1"),
+			sha256 = event.cert and event.cert:digest("sha256"),
+			errors = error_message
+		};
 
 		local message = st.message{ type = "chat", from = local_host }
 			:tag("body")