1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-28 16:21:03 +00:00

fix(core): fix cardano session derivation

[no changelog]
This commit is contained in:
M1nd3r 2025-01-23 16:24:34 +01:00
parent c495b28f45
commit ab08223b29
2 changed files with 5 additions and 6 deletions

View File

@ -28,7 +28,7 @@ if TYPE_CHECKING:
from trezor.wire import Handler, Msg
if utils.USE_THP:
from trezor.messages import Failure, ThpCreateNewSession, ThpNewSession
from trezor.messages import Failure, ThpCreateNewSession
_SCREENSAVER_IS_ON = False
@ -211,7 +211,7 @@ if utils.USE_THP:
async def handle_ThpCreateNewSession(
message: ThpCreateNewSession,
) -> ThpNewSession | Failure:
) -> Success | Failure:
"""
Creates a new `ThpSession` based on the provided parameters and returns a
`Success` message on success.

View File

@ -8,7 +8,6 @@ from storage.cache_common import (
)
from trezor import utils, wire
from trezor.crypto import cardano
from trezor.wire import context
from apps.common import mnemonic
from apps.common.seed import get_seed
@ -119,7 +118,7 @@ def is_minting_path(path: Bip32Path) -> bool:
def derive_and_store_secrets(ctx: Context, passphrase: str) -> None:
assert device.is_initialized()
assert context.cache_get_bool(APP_COMMON_DERIVE_CARDANO)
assert ctx.cache.get_bool(APP_COMMON_DERIVE_CARDANO)
if not mnemonic.is_bip39():
# nothing to do for SLIP-39, where we can derive the root from the main seed
@ -139,8 +138,8 @@ def derive_and_store_secrets(ctx: Context, passphrase: str) -> None:
else:
icarus_trezor_secret = icarus_secret
context.cache_set(APP_CARDANO_ICARUS_SECRET, icarus_secret)
context.cache_set(APP_CARDANO_ICARUS_TREZOR_SECRET, icarus_trezor_secret)
ctx.cache.set(APP_CARDANO_ICARUS_SECRET, icarus_secret)
ctx.cache.set(APP_CARDANO_ICARUS_TREZOR_SECRET, icarus_trezor_secret)
async def _get_keychain_bip39(derivation_type: CardanoDerivationType) -> Keychain: