diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce 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-- | custom/extensions/email-libravatar.lua | 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 3 insertions, 2 deletions
diff --git a/custom/extensions/email-libravatar.lua b/custom/extensions/email-libravatar.lua index 719be2e..e04c2c2 100644 --- a/custom/extensions/email-libravatar.lua +++ b/custom/extensions/email-libravatar.lua @@ -28,7 +28,8 @@ -- -- Every page view sends the visitor's IP address and a hash of each -- committer's email to a third-party service, so leave this filter off if --- that is not acceptable for your instance. Addresses are hashed with MD5. +-- that is not acceptable for your instance. Addresses are hashed with +-- SHA-256, which Libravatar accepts alongside MD5. local has_digest, digest = pcall(require, "openssl.digest") @@ -48,7 +49,7 @@ local buffer = "" local avatar_hash = nil local function hash_hex(input) - local raw = digest.new("md5"):final(input) + local raw = digest.new("sha256"):final(input) local hex = "" for i = 1, #raw do hex = hex .. string.format("%.2x", string.byte(raw, i)) |
