Compare commits

..

98 Commits

Author SHA1 Message Date
M1nd3r 6f89cb4c07 Remake ChannelContext, change buffer types
3 weeks ago
M1nd3r dfaf01b86b Add Retransmition object [sample]
3 weeks ago
M1nd3r 416c63df90 Edit thp tests
3 weeks ago
M1nd3r 9acb08e985 Channel refactor
3 weeks ago
M1nd3r cf25a0fcc7 Unify if conditions order
3 weeks ago
M1nd3r 8dceb3bb10 Rename context to channel in thp_v1.py
3 weeks ago
M1nd3r 68e40e4893 Solve race condition
3 weeks ago
M1nd3r e2ec7065d2 Improve logging, partially refactror channel.py
3 weeks ago
M1nd3r 7d4619362b Add logging to sync_set_send_bit
3 weeks ago
M1nd3r db3bb8bbe0 Add derive_cardano field to ThpCreateNewSession protobuf message
3 weeks ago
M1nd3r cf41ec9995 Remove code duplication in pairing.py
3 weeks ago
M1nd3r 25e164a2fd Remove unnecessary abstractions with handlers
3 weeks ago
M1nd3r 3a86c5f948 Improve pairing handling
3 weeks ago
M1nd3r 3ebee69ce1 Fix broken pairing workflow
3 weeks ago
M1nd3r 919e4a544c Fix handling of pairing request
3 weeks ago
M1nd3r 22f9f03e9e Change pairing process into a workflow
3 weeks ago
M1nd3r 06657dbf6e Add ThpPairingPreparationsFinished message
3 weeks ago
M1nd3r c61531d69b Connect pairing handlers with appropriate messages
3 weeks ago
M1nd3r 9b64a3f51f Fix handshake completion message decoding
3 weeks ago
M1nd3r eb6cd2d438 Allow channel to handle only ThpCreateNewSession message
3 weeks ago
M1nd3r 55153fa245 Fix logging of passphrase
3 weeks ago
M1nd3r f64e51f5b2 Update protobuf messages continuity
3 weeks ago
M1nd3r 329152c1d9 Redundant logging removal
3 weeks ago
M1nd3r 9e0c6b7ad5 Implement Pairing flow
3 weeks ago
M1nd3r 4d60687be0 Adjust loop clear
3 weeks ago
M1nd3r fc55f45c0f Adjust imports
3 weeks ago
M1nd3r 30930474b0 Clean session creation
3 weeks ago
M1nd3r 750375c5e3 Adjust create session function params
3 weeks ago
M1nd3r ac4edb4b17 Add pairing and channel EnumValueOptions to protobuf
3 weeks ago
M1nd3r 01f5fdef73 Fix common prebuild protobuf naming error
3 weeks ago
M1nd3r 03224c95b4 Adjust control bytes
3 weeks ago
M1nd3r f6563ce34d Fix protobuf message wire types and pb2py error
3 weeks ago
M1nd3r e3aa720c6a Work on pairing, updated protobuf, note that it crashes during build
3 weeks ago
M1nd3r 1eb6d824c1 Partial fix for bug in session creation response, will fail checks
3 weeks ago
M1nd3r 2fed976c72 Improve logging of expected message type in session context
3 weeks ago
M1nd3r a1ed2444d9 Fix order of checks
3 weeks ago
M1nd3r eb7c256106 Fix loading of sessions from cache, improve logging
3 weeks ago
M1nd3r 057dcd6af8 Fix cyclic imports of constants
3 weeks ago
M1nd3r fc5df2af9f Add new Failure types to switch enumeration for legacy builds
3 weeks ago
M1nd3r ffe6edc9e9 Extract duplicated write to wire
3 weeks ago
M1nd3r ab091a8516 Remove unused code
3 weeks ago
M1nd3r b13c9db682 Unallocated session error, debug log improvements
3 weeks ago
M1nd3r ded9c4ddbe Allow to encode protobuf into memoryview buffer
3 weeks ago
M1nd3r ca788c2437 Add ThpUnallocatedChannel and ThpUnallocatedSession Failure types
3 weeks ago
M1nd3r ff6cf3f4ab Remove unnecessary session_ids in old Codec, fix storage test, suppress invalid warnings
3 weeks ago
M1nd3r 6c57a11ad4 Require noise tag with encrypted messages, improve debug logging
3 weeks ago
M1nd3r 3ee201d69e Add build_unix_frozen_debug config to makefile
3 weeks ago
M1nd3r 870ce35f15 Count with encryption tag for channel messages
3 weeks ago
M1nd3r ea46e27b56 Improve logging of channel state, reduce logging of sessions
3 weeks ago
M1nd3r 7fc59c6d18 Add default value (None) to channel.waiting_for_ack_timeout, create pairing state if branch
3 weeks ago
M1nd3r 62e0bc65ae Fix old codec write, enhance new session response message
3 weeks ago
M1nd3r b1439f2b9d Improve debug log of sync bits
3 weeks ago
M1nd3r aefa245dc4 refactor(core): remove unnecessary protocol abstraction
3 weeks ago
M1nd3r fd40f9004e Remove unnecessary channel state
3 weeks ago
M1nd3r 9b4f56cfdd Fix continuation packet ignoring, unify logging
3 weeks ago
M1nd3r 9cb4c0f7c2 Remove redundant ack
3 weeks ago
M1nd3r b667e8e033 Fix debug log, crashing and mock noise tags
3 weeks ago
M1nd3r 1607b41a26 Change channel allocation response control byte to 0x41 and error control byte to 0x42
3 weeks ago
M1nd3r 8f776fcced Create new session response
3 weeks ago
M1nd3r 750c37697e Refactor channel
3 weeks ago
M1nd3r 29629ffb9e Fix thp_v1 style
3 weeks ago
M1nd3r ca5ddb5c66 Clean thp_v1
3 weeks ago
M1nd3r 00d67f8b0b Clean handle_thp_session
3 weeks ago
M1nd3r 7f7e42a8ce Fix missing send_ack after receiving message with unexpected sync bit
3 weeks ago
M1nd3r aa615de463 Fix debug message
3 weeks ago
M1nd3r 685cadf8c9 Fix synchronization
3 weeks ago
M1nd3r 5493cd90f1 Fix send sync bit update
3 weeks ago
M1nd3r 78b09ef2b5 Change legacy protobuf makefile to ignore all Thp messages
3 weeks ago
M1nd3r 15c0c537e0 Update makefile for legacy protobuf
3 weeks ago
M1nd3r 650d38a6fb feat(core): add messages-thp.proto symbolic link
3 weeks ago
M1nd3r ca6c1cca74 Fix retransmission, adjust debug prints
3 weeks ago
M1nd3r 6a97c7e88a feat(core): improve debug print
3 weeks ago
M1nd3r fe72c472ee feat(core): implement SessionContext write
3 weeks ago
M1nd3r 6a89178368 refactor(core): denote to-be-replaced functions as deprecated
3 weeks ago
M1nd3r dbd29cf0aa feat(core): add description to UnexpectedMessageWithType
3 weeks ago
M1nd3r d4622b1b15 feat(core): improve SessionContext's handling of expected types
3 weeks ago
M1nd3r 714a949919 feat(core): implement SessionContext
3 weeks ago
M1nd3r 5bdd2e7fa5 fix(core): resolve issues with checks
3 weeks ago
M1nd3r a245ef195e feat(core): session creation, part 2
3 weeks ago
M1nd3r 912c85e21e fix(core): fix handshake reading, session creation part 1
3 weeks ago
M1nd3r 37547b19da fix(core): fix use of buffers
3 weeks ago
M1nd3r 6f3db981ec refactor(core): remove unused handlers, clean ChannelContext
3 weeks ago
M1nd3r 7c447ac5d1 feat(core): improve channels, sessions and handshake
3 weeks ago
M1nd3r 42873b1c30 refactor(core): change structure of channels and sessions
3 weeks ago
M1nd3r f75ee29ffa feat(core): make changes to thp cache, part 1
3 weeks ago
M1nd3r fb99d1dbe6 feat(core): remove message type from device properties message
3 weeks ago
M1nd3r ef1b429c62 feat(core): add packet handlers
3 weeks ago
M1nd3r 4f9b3944ab feat(core): add thp module to frozen build
3 weeks ago
M1nd3r 45b0293371 fix(core): fix bugs in thp unittests
3 weeks ago
M1nd3r 947cd8fa1d feat(core): improve logging
3 weeks ago
M1nd3r 92cbacba9e fix(core): fix bugs in synchronization and handler finding
3 weeks ago
M1nd3r 9683039111 feat(core): change structure of THP implementation [Part 1]
3 weeks ago
M1nd3r 2066790d6a fix(core): fix typo in fido2 comment
3 weeks ago
matejcik fa6c9322e2 feat(core): introduce timeout to loop.wait()
3 weeks ago
M1nd3r eabf2e62e3 feat(core): improve thp unittests
3 weeks ago
M1nd3r 2923cc99c5 fix(core): update all_modules
3 weeks ago
M1nd3r cab2ec2d34 feat(core): channel allocation handling and refactor
3 weeks ago
M1nd3r 54221797f9 feat(core): basic THP functionality (not-polished prototype)
3 weeks ago

@ -15,7 +15,7 @@ utils.presize_module("trezor", 30)
# storage imports storage.common, storage.cache and storage.device.
# These import trezor, trezor.config (which is a C module), trezor.utils, and each other.
import storage # noqa: E402
import storage
# we will need space for 12 items in the storage module
utils.presize_module("storage", 12)
@ -30,11 +30,11 @@ if __debug__:
# trezor.pin imports trezor.utils
# We need it as an always-active module because trezor.pin.show_pin_timeout is used
# as a UI callback for storage, which can be invoked at any time
import trezor.pin # noqa: F401, E402
import trezor.pin # noqa: F401
# === Prepare the USB interfaces first. Do not connect to the host yet.
# usb imports trezor.utils and trezor.io which is a C module
import usb # noqa: E402
import usb
# create an unimport manager that will be reused in the main loop
unimport_manager = utils.unimport()
@ -45,7 +45,7 @@ with unimport_manager:
del boot
# start the USB
import storage.device # noqa: E402
import storage.device
usb.bus.open(storage.device.get_device_id())

@ -23,7 +23,7 @@ reads the message's header. When the message type is known the first handler is
"""
from typing import TYPE_CHECKING # pyright: ignore[reportShadowedImports]
from typing import TYPE_CHECKING
from trezor import log, loop, protobuf, utils
from trezor.wire import context, message_handler, protocol_common, thp_v1
@ -40,8 +40,8 @@ from trezor.wire.errors import * # isort:skip # noqa: F401,F403
if TYPE_CHECKING:
from trezorio import WireInterface # pyright: ignore[reportMissingImports]
from typing import ( # pyright: ignore[reportShadowedImports]
from trezorio import WireInterface
from typing import (
Any,
Callable,
Coroutine,

@ -1,12 +1,12 @@
import ustruct # pyright: ignore[reportMissingModuleSource]
from micropython import const # pyright: ignore[reportMissingModuleSource]
from typing import TYPE_CHECKING # pyright: ignore[reportShadowedImports]
import ustruct
from micropython import const
from typing import TYPE_CHECKING
from trezor import io, loop, utils
from trezor.wire.protocol_common import MessageWithId, WireError
if TYPE_CHECKING:
from trezorio import WireInterface # pyright: ignore[reportMissingImports]
from trezorio import WireInterface
_REP_LEN = const(64)

@ -13,7 +13,7 @@ function, which will silently ignore the call if no context is available. Useful
for ButtonRequests. Of course, `context.wait()` transparently works in such situations.
"""
from typing import TYPE_CHECKING # pyright: ignore[reportShadowedImports]
from typing import TYPE_CHECKING
from trezor import log, loop, protobuf
from trezor.wire import codec_v1
@ -21,8 +21,8 @@ from trezor.wire import codec_v1
from .protocol_common import Context, MessageWithId
if TYPE_CHECKING:
from trezorio import WireInterface # pyright: ignore[reportMissingImports]
from typing import ( # pyright: ignore[reportShadowedImports]
from trezorio import WireInterface
from typing import (
Any,
Awaitable,
Callable,

@ -14,8 +14,8 @@ from trezor.wire.errors import * # isort:skip # noqa: F401,F403
if TYPE_CHECKING:
from trezorio import WireInterface # pyright: ignore[reportMissingImports]
from typing import ( # pyright: ignore[reportShadowedImports]
from trezorio import WireInterface
from typing import (
Any,
Callable,
Container,

@ -1,10 +1,10 @@
from typing import TYPE_CHECKING # pyright: ignore[reportShadowedImports]
from typing import TYPE_CHECKING
from trezor import protobuf
if TYPE_CHECKING:
from trezorio import WireInterface # pyright: ignore[reportMissingImports]
from typing import ( # pyright: ignore[reportShadowedImports]
from trezorio import WireInterface
from typing import (
Container,
TypeVar,
overload,

@ -1,5 +1,5 @@
import ustruct # pyright:ignore[reportMissingModuleSource]
from typing import TYPE_CHECKING # pyright:ignore[reportShadowedImports]
import ustruct
from typing import TYPE_CHECKING
from storage import cache_thp as storage_thp_cache
from storage.cache_thp import ChannelCache, SessionThpCache
@ -8,7 +8,7 @@ from trezor.wire.protocol_common import WireError
if TYPE_CHECKING:
from enum import IntEnum
from trezorio import WireInterface # pyright:ignore[reportMissingImports]
from trezorio import WireInterface
else:
IntEnum = object

Loading…
Cancel
Save