bugfix: final flag was missing in framing error response; properly handle framing errors

This commit is contained in:
scgbckbone 2024-02-03 17:54:21 +01:00 committed by doc-hex
parent 209cdba897
commit ebc5830977
3 changed files with 9 additions and 6 deletions

View File

@ -1,6 +1,7 @@
## 5.2.3 - 2024-XX-XX
- Bugfix: Saving passphrase on SD Card caused a freeze that required reboot
- Bugfix: Properly handle and finalize framing error response
## 5.2.2 - 2023-12-21

View File

@ -694,7 +694,7 @@ class MultisigWallet:
#
expect_chain = chains.current_chain().ctype
if "sortedmulti(" in config or MultisigDescriptor.is_descriptor(config):
# assume descriptor, classic config should not contain sertedmulti( and check for checksum separator
# assume descriptor, classic config should not contain sortedmulti( and check for checksum separator
# ignore name
_, addr_fmt, xpubs, has_mine, M, N = cls.from_descriptor(config)
else:

View File

@ -237,6 +237,8 @@ class USBHandler:
# prefer to catch at higher layers, but sometimes can't
resp = b'err_Out of RAM'
msg_len = 0
except FramingError as exc:
raise exc
except Exception as exc:
# catch bugs and fuzzing too
if is_simulator() or is_devmode:
@ -250,8 +252,8 @@ class USBHandler:
except FramingError as exc:
reason = exc.args[0]
#print("Framing: %s" % reason)
self.framing_error(reason)
# print("Framing: %s" % reason)
await self.framing_error(reason)
msg_len = 0
except BaseException as exc:
@ -326,10 +328,10 @@ class USBHandler:
# Let other stuff run during this delay.
await sleep_ms(10)
def framing_error(self, why):
async def framing_error(self, why):
# send error about framing, and recover
self.dev.send(b'%cfram%-59s' % (4+len(why), why))
resp = b'fram' + why.encode()
await self.send_response(resp)
async def handle(self, cmd, args):
# Dispatch incoming message, and provide reply.