From 40cfba5a70de6494ad1e5145424b3ae0c1fd1ab8 Mon Sep 17 00:00:00 2001 From: Tomas Krnak Date: Tue, 27 Dec 2022 17:04:01 +0700 Subject: [PATCH] fix(core): halt on too-long-memo already during outputs confirmation phase --- core/src/apps/zcash/orchard/signer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/apps/zcash/orchard/signer.py b/core/src/apps/zcash/orchard/signer.py index 92d41377a..115788402 100644 --- a/core/src/apps/zcash/orchard/signer.py +++ b/core/src/apps/zcash/orchard/signer.py @@ -102,6 +102,8 @@ class OrchardSigner: async def approve_outputs(self) -> None: for i in range(self.params.outputs_count): txo = await self.get_output(i) + if txo.memo is not None and len(txo.memo.encode()) > 512: + raise DataError("Memo is too long.") self.msg_acc.xor_message(txo, i) # add message to the accumulator if output_is_internal(txo): self.approver.add_orchard_change_output(txo)