Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
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.
Diffstat (limited to 'tests/extensions/harness.lua')
| -rw-r--r-- | tests/extensions/harness.lua | 5 |
1 file changed, 4 insertions, 1 deletion
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) |
