Skip to content

Commit

Permalink
Fix verify()
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph2 committed Dec 23, 2018
1 parent 29ffa1f commit b49a2f1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pyxcp/master/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

import sys

import pyxcp.checksum as checksum


version = sys.version_info
PRE35 = version.major >= 3 and version.minor < 5 # We need some pre-3.5 fixes, e.g. flatten() function.

Expand All @@ -46,9 +49,9 @@ def unlock(client, privilege):
def verify(client, addr, length):
client.setMta(addr)
cs = client.buildChecksum(length)
print("CS: {:08X}".format(cs.checksum))
print("Client CS: {:08X}".format(cs.checksum))
client.setMta(addr)
data = client.upload(length)
data = client.fetch(length)
cc = checksum.check(data, cs.checksumType)
print("CS: {:08X}".format(cc))
print("Our CS: {:08X}".format(cc))

0 comments on commit b49a2f1

Please sign in to comment.