diff --git a/devops/Makefile b/devops/Makefile index f6e460c7..a2184348 100644 --- a/devops/Makefile +++ b/devops/Makefile @@ -53,7 +53,7 @@ ifeq ($(SRC_DIR_NAME),sovtoken) # pypi: indy-plenum # apt: indy-plenum (stable component) -FPM_P_DEPENDS := indy-node(=1.10.0~dev1070) +FPM_P_DEPENDS := indy-node(=1.10.0~dev1076) FPM_ARGS := --no-python-dependencies $(FPM_ARGS) endif diff --git a/sovtoken/setup.py b/sovtoken/setup.py index 2b7f4a6c..2af00fab 100644 --- a/sovtoken/setup.py +++ b/sovtoken/setup.py @@ -38,7 +38,7 @@ '*.css', '*.ico', '*.png', 'LICENSE', 'LEGAL', 'sovtoken']}, include_package_data=True, - install_requires=['indy-node==1.10.0.dev1070'], + install_requires=['indy-node==1.10.0.dev1076'], setup_requires=['pytest-runner'], extras_require={ diff --git a/sovtoken/sovtoken/client_authnr.py b/sovtoken/sovtoken/client_authnr.py index 9d551f2f..7f33469c 100644 --- a/sovtoken/sovtoken/client_authnr.py +++ b/sovtoken/sovtoken/client_authnr.py @@ -69,13 +69,12 @@ def getVerkey(self, ident, request): return super().getVerkey(ident, request) @staticmethod - def verify_signtures_on_payments(inputs, outputs, signatures, verifier, - *extra_fields_for_signing): + def verify_signtures_on_payments(inputs, outputs, signatures, verifier, *extra_fields_for_signing): correct_sigs_from = [] - for inp, sig in zip(inputs, - signatures): + incorrect_signatures = {} + for inp, sig in zip(inputs, signatures): try: - sig = base58.b58decode(sig) + sig_decoded = base58.b58decode(sig) except Exception as ex: raise InvalidSignatureFormat from ex @@ -89,11 +88,12 @@ def verify_signtures_on_payments(inputs, outputs, signatures, verifier, continue vr = verifier(verkey) - if vr.verify(sig, ser): + if vr.verify(sig_decoded, ser): correct_sigs_from.append(idr) + else: + incorrect_signatures[idr] = sig if len(correct_sigs_from) != len(inputs): # All inputs should have signatures present - raise InsufficientCorrectSignatures(len(correct_sigs_from), - len(inputs)) + raise InsufficientCorrectSignatures(len(inputs), len(correct_sigs_from), incorrect_signatures) return correct_sigs_from diff --git a/sovtokenfees/sovtokenfees/test/test_client_authnr.py b/sovtokenfees/sovtokenfees/test/test_client_authnr.py index 495c2140..17c352e5 100644 --- a/sovtokenfees/sovtokenfees/test/test_client_authnr.py +++ b/sovtokenfees/sovtokenfees/test/test_client_authnr.py @@ -71,7 +71,8 @@ def test_authenticate_success(node): } with pytest.raises(InsufficientCorrectSignatures) as ex: fees_authenticator.authenticate(req_data) - assert ex.value.args == (0, 4) + + assert ex.value.args == (4, 0, req_data['signatures']) # ------------------------------------------------------------------------------------ @@ -97,7 +98,7 @@ def test_authenticate_success_one_signature(node): with pytest.raises(InsufficientCorrectSignatures) as ex: fees_authenticator.authenticate(req_data) - assert ex.value.args == (0, 1) + assert ex.value.args == (1, 0, req_data['signatures']) # ------------------------------------------------------------------------------------