Skip to content

Commit

Permalink
Merge pull request #560 from Foundation-Devices/dev-v2.3.4
Browse files Browse the repository at this point in the history
v2.3.4
  • Loading branch information
mjg-foundation authored Oct 8, 2024
2 parents 288e73b + 11f7666 commit 457e740
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 4 additions & 7 deletions ports/stm32/boards/Passport/modules/tasks/sign_text_file_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
13 changes: 0 additions & 13 deletions ports/stm32/boards/Passport/modules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.3
2.3.4

0 comments on commit 457e740

Please sign in to comment.