mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-04-15 23:05:45 +00:00
fix(core): preallocate storage.debug.reset_internal_entropy
It should allow GC to cleanup `int_entropy`, which can be allocated in random heap position, causing fragmentation. [no changelog]
This commit is contained in:
parent
f942d13748
commit
8b4936926c
@ -84,7 +84,7 @@ async def reset_device(msg: ResetDevice) -> Success:
|
||||
# generate internal entropy
|
||||
int_entropy = random.bytes(32, True)
|
||||
if __debug__:
|
||||
storage.debug.reset_internal_entropy = int_entropy
|
||||
storage.debug.reset_internal_entropy[:] = int_entropy
|
||||
|
||||
entropy_commitment = (
|
||||
hmac(hmac.SHA256, int_entropy, b"").digest() if msg.entropy_check else None
|
||||
|
@ -9,4 +9,5 @@ if __debug__:
|
||||
|
||||
layout_watcher = False
|
||||
|
||||
reset_internal_entropy: bytes = b""
|
||||
reset_internal_entropy = bytearray(32)
|
||||
reset_internal_entropy[:] = bytes()
|
||||
|
Loading…
Reference in New Issue
Block a user