From 340863224cddfbed230cbb9feaccd3524c37d330 Mon Sep 17 00:00:00 2001 From: SouthFox Date: Wed, 12 Jul 2023 00:13:28 +0800 Subject: [PATCH] [fix] rename function name & fix sign verify --- demo/utils/checker.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/demo/utils/checker.py b/demo/utils/checker.py index f93d1a3..6309a0a 100644 --- a/demo/utils/checker.py +++ b/demo/utils/checker.py @@ -13,7 +13,7 @@ def inbox_prechecker( payload = request.headers ap_body = request.data try: - parsec_signature = HttpSignature.parse_signature( + parsed_signature = HttpSignature.parse_signature( payload["signature"] ) except KeyError: @@ -33,16 +33,15 @@ def inbox_prechecker( sigdate = SignedData( method = request.method, path = request.path, - signed_list = parsec_signature["headers"], + signed_list = parsed_signature["headers"], body_digest = HttpSignature.calculation_digest(ap_body), headers = request.headers, ) is_verify = HttpSignature.verify_signature( HttpSignature.build_signature_string(sigdate), - parsec_signature["signature"], + parsed_signature["signature"], pub_key, ) - print(is_verify) - return True + return is_verify