From 44d52665487bf600e24bd017fc764b179f6b8beb Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 11:02:05 -1000 Subject: Hold the avatar stub checks to an absolute hash The stub mode checks only compared hashes with each other, and the stand-in digest took any algorithm name, so md5, a misspelt sha256 or hex in capitals passed everywhere luaossl is missing, which is every machine here. The comparisons also passed with no hash found on either side. --- tests/extensions/harness.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/extensions/harness.lua') diff --git a/tests/extensions/harness.lua b/tests/extensions/harness.lua index 78e491e..5084ab4 100644 --- a/tests/extensions/harness.lua +++ b/tests/extensions/harness.lua @@ -201,10 +201,13 @@ local function fake_digest_bytes(text) return table.concat(bytes) end --- The slice of the luaossl digest interface the avatar filters use. +-- The slice of the luaossl digest interface the avatar filters use. Both +-- services document SHA-256, so the stand-in refuses any other algorithm. function harness.stub_digest() preload("openssl.digest", { new = function(algorithm) + assert(algorithm == "sha256", + "the avatar filters hash with sha256, not " .. tostring(algorithm)) return { final = function(self, text) return fake_digest_bytes(algorithm .. "\0" .. text) -- cgit 2.12.1