1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-03 19:31:02 +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 595b44c19e
commit e723003731
2 changed files with 5 additions and 6 deletions

View File

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

View File

@ -8,7 +8,6 @@ from storage.cache_common import (
) )
from trezor import utils, wire from trezor import utils, wire
from trezor.crypto import cardano from trezor.crypto import cardano
from trezor.wire import context
from apps.common import mnemonic from apps.common import mnemonic
from apps.common.seed import get_seed 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: def derive_and_store_secrets(ctx: Context, passphrase: str) -> None:
assert device.is_initialized() 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(): if not mnemonic.is_bip39():
# nothing to do for SLIP-39, where we can derive the root from the main seed # 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: else:
icarus_trezor_secret = icarus_secret icarus_trezor_secret = icarus_secret
context.cache_set(APP_CARDANO_ICARUS_SECRET, icarus_secret) ctx.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_TREZOR_SECRET, icarus_trezor_secret)
async def _get_keychain_bip39(derivation_type: CardanoDerivationType) -> Keychain: async def _get_keychain_bip39(derivation_type: CardanoDerivationType) -> Keychain: