Mercurial > prosody-modules
comparison mod_s2s_auth_posh/mod_s2s_auth_posh.lua @ 4441:58a112bd9792
mod_s2s_auth_posh: Use unused loop variable for something [luacheck]
Saves a function call, shuts up luacheck. In no case does the input list
of certificates not result in a list of fingerprints of equal length.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 11 Feb 2021 15:51:27 +0100 |
parents | f2037a754480 |
children |
comparison
equal
deleted
inserted
replaced
4440:95262bd1bcb2 | 4441:58a112bd9792 |
---|---|
142 return 1; | 142 return 1; |
143 end | 143 end |
144 local cert_pem = cert:read("*a"); | 144 local cert_pem = cert:read("*a"); |
145 local cert_der, typ = pem2der(cert_pem); | 145 local cert_der, typ = pem2der(cert_pem); |
146 if typ == "CERTIFICATE" then | 146 if typ == "CERTIFICATE" then |
147 table.insert(jwkset.fingerprints, { ["sha-256"] = base64.encode(hashes.sha256(cert_der)); }); | 147 jwkset.fingerprints[i] = { ["sha-256"] = base64.encode(hashes.sha256(cert_der)); }; |
148 elseif typ then | 148 elseif typ then |
149 io.stderr:write(cert_file, " contained a ", typ:lower(), ", was expecting a certificate\n"); | 149 io.stderr:write(cert_file, " contained a ", typ:lower(), ", was expecting a certificate\n"); |
150 return 1; | 150 return 1; |
151 else | 151 else |
152 io.stderr:write(cert_file, " did not contain a certificate in PEM format\n"); | 152 io.stderr:write(cert_file, " did not contain a certificate in PEM format\n"); |