Skip to content

Commit

Permalink
Determined that we're also failing to verify signatures in the test f…
Browse files Browse the repository at this point in the history
…ile - I may have to check in to that and see if there is a better crypt module.
  • Loading branch information
Romulus10 committed Sep 25, 2018
1 parent fa0bae5 commit 8c487e5
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
3 changes: 0 additions & 3 deletions blockchain_message/src/blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ def retrieve(self, user: Contact, last_message: int, contact_list: List[Contact]

result = contract.functions.retrieve(int(user.address), last_message).call()

result = bytes(result, 'utf8')
result = result.decode('utf8')

messages = list()

res_list = result.split('♠')
Expand Down
1 change: 0 additions & 1 deletion blockchain_message/src/crypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def verify(message: str, signature: str, sender: Contact):
:param signature: The signature to verify.
:param sender: The contact who the message claims to be sent by.
"""
signature.replace("\\\\", "\\")
m = bytes(bytes(message, 'latin-1').decode('latin-1'), 'latin-1')
s = bytes(signature, 'latin-1')
rsa.verify(m, s, rsa.PublicKey.load_pkcs1(sender.key))
Expand Down
2 changes: 1 addition & 1 deletion test/test_crypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ def test_verify(self):
c = Crypt("other")
con = Contact("00001", "other", "[email protected]")
message = "This is a test."
signature = c.sign(message)
signature = str(c.sign(message))
c.verify(message, signature, con)

0 comments on commit 8c487e5

Please sign in to comment.