From 0a5c65e9a2c65002b8f14b0b159bf3cb315d8e64 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 5 Jan 2021 12:20:59 +0000 Subject: [PATCH] Limit json signature checking to strict mode --- inbox.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/inbox.py b/inbox.py index 0b2922fea..bde7388ee 100644 --- a/inbox.py +++ b/inbox.py @@ -2734,7 +2734,7 @@ def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int, queue.pop(0) continue - if checkJsonSignature: + if checkJsonSignature and verifyAllSignatures: # use the original json message received, not one which may have # been modified along the way if not verifyJsonSignature(queueJson['original'], pubKey): @@ -2745,12 +2745,11 @@ def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int, else: print('WARN: jsonld inbox signature check failed ' + keyId) - if verifyAllSignatures: - if os.path.isfile(queueFilename): - os.remove(queueFilename) - if len(queue) > 0: - queue.pop(0) - continue + if os.path.isfile(queueFilename): + os.remove(queueFilename) + if len(queue) > 0: + queue.pop(0) + continue else: print('jsonld inbox signature check success ' + keyId)