mod_s2s_auth_dane: Check if cert:pubkey() is available
authorKim Alvefur <zash@zash.se>
Sat, 23 Jan 2016 20:34:26 +0100
changeset 2036 6645838c6475
parent 2035 f21147d56bc4
child 2037 acf86edeb1cc
mod_s2s_auth_dane: Check if cert:pubkey() is available
mod_s2s_auth_dane/mod_s2s_auth_dane.lua
--- a/mod_s2s_auth_dane/mod_s2s_auth_dane.lua	Fri Jan 22 16:05:22 2016 +0100
+++ b/mod_s2s_auth_dane/mod_s2s_auth_dane.lua	Sat Jan 23 20:34:26 2016 +0100
@@ -59,6 +59,9 @@
 	else
 		module:log("debug", "The cert:issued() method is unavailable, DANE-TA and PKIX-CA can't be enabled");
 	end
+	if not cert_mt.__index.pubkey then
+		module:log("debug", "The cert:issued() method is unavailable, the SPKI usage can't be supported");
+	end
 end
 local configured_uses = module:get_option_set("dane_uses", { "DANE-EE", "DANE-TA" });
 local enabled_uses = set.intersection(implemented_uses, configured_uses) / function(use) return use_map[use] end;