From 1b2fb445ca21b2a5d786e56e6a25a4607efc4432 Mon Sep 17 00:00:00 2001 From: Adam Kelly Date: Wed, 19 Aug 2020 13:33:58 +0100 Subject: [PATCH] Use the correct digest algorithm. (Fixes: #191) --- fedireads/signatures.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fedireads/signatures.py b/fedireads/signatures.py index 49d1a2d3..db46aa4b 100644 --- a/fedireads/signatures.py +++ b/fedireads/signatures.py @@ -39,7 +39,7 @@ def make_signature(sender, destination, date, digest): return ','.join('%s="%s"' % (k, v) for (k, v) in signature.items()) def make_digest(data): - return 'SHA-256=' + b64encode(hashlib.sha512(data).digest()).decode('utf-8') + return 'SHA-256=' + b64encode(hashlib.sha256(data).digest()).decode('utf-8') def verify_digest(request): algorithm, digest = request.headers['digest'].split('=', 1)