Fix checksum following BIP-128 standard
Non-Ascii characters should not be converted for checksum calculation. This will give consistent hash to BIP-128 and its Javascript code example. Timelock-Recovery Plans that contained only ascii characters are not affected. Also, 8 hex-chars is enough for a checksum.
This commit is contained in:
@@ -687,10 +687,10 @@ class Plugin(TimelockRecoveryPlugin):
|
||||
# object whose fields can be ordered in multiple ways).
|
||||
return hashlib.sha256(json.dumps(
|
||||
sorted(json_data.items()),
|
||||
skipkeys=False, ensure_ascii=True, check_circular=True,
|
||||
skipkeys=False, ensure_ascii=False, check_circular=True,
|
||||
allow_nan=True, cls=None, indent=None, separators=(',', ':'),
|
||||
default=None, sort_keys=False,
|
||||
).encode()).hexdigest()
|
||||
).encode()).hexdigest()[:8]
|
||||
|
||||
def _save_recovery_plan_json(self, context: TimelockRecoveryContext, download_dialog: WindowModalDialog):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user