Skip to content

Commit

Permalink
Bugfix/signature verify always true (#29)
Browse files Browse the repository at this point in the history
* fix recipient list not copied to request envelope

* fixed signature check masking invalid signatures
  • Loading branch information
oliverrahner authored Feb 7, 2022
1 parent 69c6e7c commit 64cff8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion agrirouter/auth/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def verify(self, public_key) -> None:
unquoted_signature = unquote(self.signature)
encoded_signature = base64.b64decode(unquoted_signature.encode("utf-8"))

self._is_valid = True
try:
verify_signature(encoded_data, encoded_signature, public_key)
except InvalidSignature:
Expand All @@ -56,7 +57,6 @@ def verify(self, public_key) -> None:
finally:
self._was_verified = True

self._is_valid = True

@staticmethod
def decode_token(token: Union[str, bytes]) -> AuthorizationToken:
Expand Down

0 comments on commit 64cff8a

Please sign in to comment.