test: check `Features.max_passphrase_len` in device tests
What changed, and why it matters
This commit only adds a test assertion to verify that the maximum passphrase length reported by a Trezor device matches the expected value for its model family (50 characters for legacy devices, 128 for newer 'core' devices). It is a pure test-code change with no product behavior change and no security fix.
No action required; this is a non-security test-only commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change imports models from trezorlib and asserts that Features.max_passphrase_len equals 50 on legacy models and 128 on all other (core) models. The assertion is placed before existing boundary tests for passphrase length. No firmware logic, limits, or validation code is modified.
Changed components
tests/device_tests/test_session_id_and_passphrase.pyInspect captured patch +2 / −1
### tests/device_tests/test_session_id_and_passphrase.py
@@ -20,7 +20,7 @@
import pytest
-from trezorlib import device, exceptions, messages
+from trezorlib import device, exceptions, messages, models
from trezorlib.debuglink import LayoutType, TrezorTestContext
from trezorlib.exceptions import TrezorFailure
from trezorlib.messages import FailureType, SafetyCheckLevel
@@ -401,6 +401,7 @@ def call(passphrase: str, expected_result: bool):
assert e.code == FailureType.DataError
max_size = test_ctx.features.max_passphrase_len
+ assert max_size == (50 if test_ctx.model in models.LEGACY_MODELS else 128)
# the exact limit (N) should work
call(passphrase="A" * max_size, expected_result=True)Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.