From e8fd32fd5e65ac92b10343eebf466fe8c420b0ca Mon Sep 17 00:00:00 2001 From: Matt Gleason Date: Fri, 4 Oct 2024 16:13:34 -0400 Subject: [PATCH 1/3] SFT-4203: fixed casa signatures --- .../modules/flows/sign_electrum_message_flow.py | 2 +- .../Passport/modules/tasks/sign_text_file_task.py | 11 ++++------- ports/stm32/boards/Passport/modules/utils.py | 13 ------------- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/ports/stm32/boards/Passport/modules/flows/sign_electrum_message_flow.py b/ports/stm32/boards/Passport/modules/flows/sign_electrum_message_flow.py index b83f3ccf8..464ba4f96 100644 --- a/ports/stm32/boards/Passport/modules/flows/sign_electrum_message_flow.py +++ b/ports/stm32/boards/Passport/modules/flows/sign_electrum_message_flow.py @@ -82,7 +82,7 @@ async def show_message(self): async def do_sign(self): (sig, address, error) = await spinner_task('Signing Message', sign_text_file_task, - args=[self.message, self.subpath, self.addr_format, True]) + args=[self.message, self.subpath, self.addr_format]) if error is None: self.signature = sig self.goto(self.show_signed) diff --git a/ports/stm32/boards/Passport/modules/tasks/sign_text_file_task.py b/ports/stm32/boards/Passport/modules/tasks/sign_text_file_task.py index ec2f9fdbb..00dcf2387 100644 --- a/ports/stm32/boards/Passport/modules/tasks/sign_text_file_task.py +++ b/ports/stm32/boards/Passport/modules/tasks/sign_text_file_task.py @@ -11,20 +11,17 @@ import stash import chains -from utils import sign_message_digest, sign_message_digest_recoverable +from utils import sign_message_digest_recoverable -async def sign_text_file_task(on_done, text, subpath, addr_fmt, recoverable=False): +async def sign_text_file_task(on_done, text, subpath, addr_fmt): with stash.SensitiveValues() as sv: node = sv.derive_path(subpath) address = sv.chain.address(node, addr_fmt) digest = chains.current_chain().hash_message(text.encode()) - if recoverable: - # signature will be 65 bytes - signature = sign_message_digest_recoverable(digest, subpath) - else: - signature = sign_message_digest(digest, subpath) + # signature will be 65 bytes + signature = sign_message_digest_recoverable(digest, subpath) await on_done(signature, address, None) diff --git a/ports/stm32/boards/Passport/modules/utils.py b/ports/stm32/boards/Passport/modules/utils.py index 259626a62..61ca11fe0 100644 --- a/ports/stm32/boards/Passport/modules/utils.py +++ b/ports/stm32/boards/Passport/modules/utils.py @@ -1038,19 +1038,6 @@ def split_to_lines(s, width): return '\n'.join([s[i:i + width] for i in range(0, len(s), width)]) -def sign_message_digest(digest, subpath): - from foundation import secp256k1 - # do the signature itself! - with stash.SensitiveValues() as sv: - node = sv.derive_path(subpath) - pk = node.private_key() - sv.register(pk) - - rv = secp256k1.sign_ecdsa(digest, pk) - - return rv - - def sign_message_digest_recoverable(digest, subpath): from trezorcrypto import ecdsa # do the signature itself! From d026706b4cbdc80123b061c11b3d43759ed76b66 Mon Sep 17 00:00:00 2001 From: mjg-foundation <114431859+mjg-foundation@users.noreply.github.com> Date: Mon, 7 Oct 2024 11:21:15 -0400 Subject: [PATCH 2/3] Update version.txt to v2.3.4b1 --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 0bee604df..cf34cd6d7 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -2.3.3 +2.3.4b1 From 11f76664ac46ba31e6bb977651513c5c981ae5cc Mon Sep 17 00:00:00 2001 From: mjg-foundation <114431859+mjg-foundation@users.noreply.github.com> Date: Tue, 8 Oct 2024 10:53:41 -0400 Subject: [PATCH 3/3] Update version.txt to v2.3.4 --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index cf34cd6d7..3f684d2d9 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -2.3.4b1 +2.3.4