Comparison

mod_s2s_auth_posh/mod_s2s_auth_posh.lua @ 3204:13f381f0c03f

mod_s2s_auth_posh: Abort if no fingerprints are found
author Kim Alvefur <zash@zash.se>
date Thu, 21 Dec 2017 03:23:58 +0100
parent 3203:b3e82e2b818e
child 3205:7bfb25111ea6
comparison
equal deleted inserted replaced
3203:b3e82e2b818e 3204:13f381f0c03f
84 end 84 end
85 local posh = session.posh; 85 local posh = session.posh;
86 local jwk = posh and posh.jwk; 86 local jwk = posh and posh.jwk;
87 local fingerprints = jwk and jwk.fingerprints; 87 local fingerprints = jwk and jwk.fingerprints;
88 88
89 if not fingerprints then
90 log("debug", "No POSH authentication data available");
91 return;
92 end
93
89 local cert_der = pem2der(cert:pem()); 94 local cert_der = pem2der(cert:pem());
90 local cert_hashes = {}; 95 local cert_hashes = {};
91 for i = 1, #hash_order do 96 for i = 1, #hash_order do
92 cert_hashes[i] = base64.encode(hash_funcs[i](cert_der)); 97 cert_hashes[i] = base64.encode(hash_funcs[i](cert_der));
93 end 98 end