Changeset

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 4440:95262bd1bcb2
children 4442:74da3643c62d
files mod_s2s_auth_posh/mod_s2s_auth_posh.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_s2s_auth_posh/mod_s2s_auth_posh.lua	Mon Feb 15 21:04:19 2021 +0100
+++ b/mod_s2s_auth_posh/mod_s2s_auth_posh.lua	Thu Feb 11 15:51:27 2021 +0100
@@ -144,7 +144,7 @@
 		local cert_pem = cert:read("*a");
 		local cert_der, typ = pem2der(cert_pem);
 		if typ == "CERTIFICATE" then
-			table.insert(jwkset.fingerprints, { ["sha-256"] = base64.encode(hashes.sha256(cert_der)); });
+			jwkset.fingerprints[i] = { ["sha-256"] = base64.encode(hashes.sha256(cert_der)); };
 		elseif typ then
 			io.stderr:write(cert_file, " contained a ", typ:lower(), ", was expecting a certificate\n");
 			return 1;