diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Hash avatar addresses with SHA-256
Gravatar's documentation now describes SHA-256 hashes on gravatar.com alone, and Libravatar has long accepted them beside MD5.
Diffstat (limited to '')
-rw-r--r--tests/extensions/test-email-avatar.lua8
1 file changed, 5 insertions, 3 deletions
diff --git a/tests/extensions/test-email-avatar.lua b/tests/extensions/test-email-avatar.lua
index 41cba8c..c6b92cb 100644
--- a/tests/extensions/test-email-avatar.lua
+++ b/tests/extensions/test-email-avatar.lua
@@ -4,7 +4,8 @@
-- is picked from the script's name. The second argument chooses how the
-- openssl.digest dependency is met, stub swaps in the deterministic fake
-- from the harness, real uses an installed luaossl and adds the one check
--- only a genuine MD5 can pass, and missing makes the module fail to load.
+-- only a genuine SHA-256 can pass, and missing makes the module fail to
+-- load.
local test_directory = arg[0]:match("^(.*)/") or "."
local h = dofile(test_directory .. "/harness.lua")
@@ -12,7 +13,7 @@ local h = dofile(test_directory .. "/harness.lua")
local script = arg[1]
local mode = arg[2] or "stub"
-local base_url = "https://www.gravatar.com/avatar/"
+local base_url = "https://gravatar.com/avatar/"
if script:find("libravatar", 1, true) then
base_url = "https://seccdn.libravatar.org/avatar/"
end
@@ -90,7 +91,8 @@ h.check("the outermost brackets are the ones taken off",
if mode == "real" then
out = render("test@example.com", "x")
- h.equals("a known address hashes to its published md5", hash_of(out), "55502f40dc8b7c769880b10874abc9d0")
+ h.equals("a known address hashes to its sha256", hash_of(out),
+ "973dfe463ec85785f5f95af5ba3906eedb2d931c24e69824a89ea65dba4e813b")
end
h.finish()