@@ -433,30 +433,27 @@ def test_signer_dropped_by_power_cycle(self):
433433 CLASSIFICATION_MALFORMED ,
434434 "the signer came back after a power cycle — it was written to flash" )
435435
436- def test_disabling_advanced_mode_makes_signer_inert_not_erased (self ):
437- """MEASURED behaviour, and it is NOT "disabling AdvancedMode clears the
438- signer".
439-
440- Turning the policy off does make the signer unusable: every consumer in
441- signed_metadata.c (signed_metadata_process, _verify_attestation,
442- _signer_fingerprint) refuses a runtime slot while AdvancedMode is off,
443- so the metadata message fails closed. But nothing erases the slot —
444- storage_setPolicy() only flips a policy bit, and only session_clear()
445- calls signed_metadata_clear_signers(). Turn the policy back on and the
446- old signer verifies again, with NO second trust screen: the expected
447- response list below is exactly one ApplyPolicies ButtonRequest and a
448- Success, so the "Trust 'CI Test' (…) NOT verified by KeepKey" consent is
449- provably not re-shown.
450-
451- Why the host path looks otherwise: ProtocolMixin.apply_policy() follows
452- every policy change with Initialize, and it is that Initialize — not the
453- policy change — that clears the signer (test_signer_dropped_by_initialize).
454- A host that sends the bare message gets the behaviour asserted here.
455-
456- Consequence to weigh at release: a user who disables AdvancedMode to
457- revoke a provider has not revoked it, only suspended it. Re-enabling
458- the policy costs one button press whose screen names the policy and
459- never names the signer it silently re-arms.
436+ def test_disabling_advanced_mode_revokes_the_signer (self ):
437+ """Turning the policy off DROPS the provider, it does not suspend it.
438+
439+ Every consumer in signed_metadata.c already refuses a runtime slot
440+ while AdvancedMode is off, so with the policy off the two behaviours
441+ are indistinguishable — the metadata fails closed either way. The
442+ difference only shows on the way back.
443+
444+ Suspending would mean re-enabling the policy silently re-arms a
445+ provider the user never re-loaded, on a confirmation screen that names
446+ the policy and never names the signer. A user who disabled
447+ AdvancedMode to drop a provider would not have dropped it. So
448+ fsm_msgApplyPolicies calls signed_metadata_clear_signers() on disable,
449+ and coming back costs a fresh LoadClearsignSigner consent — the screen
450+ that names the alias and fingerprint, which is the screen that should
451+ appear whenever trust begins.
452+
453+ The re-enable is sent as the bare message with the exact expected
454+ response list: one ApplyPolicies ButtonRequest and a Success. No trust
455+ screen appears there, which is the point — trust cannot be restored by
456+ a policy toggle at all.
460457 """
461458 self ._arm_session ()
462459
@@ -474,11 +471,10 @@ def test_disabling_advanced_mode_makes_signer_inert_not_erased(self):
474471 self ._apply_policy_raw ("AdvancedMode" , True )
475472
476473 self ._assertClassification (
477- CLASSIFICATION_VERIFIED ,
478- "the signer did NOT survive the policy toggle. That is stricter "
479- "than the code path allows today, so something changed: re-read "
480- "storage_setPolicy() and signed_metadata_clear_signers() before "
481- "loosening this assertion" )
474+ CLASSIFICATION_MALFORMED ,
475+ "the signer survived disabling AdvancedMode — re-enabling the "
476+ "policy re-armed a provider the user never re-loaded, on a screen "
477+ "that never named it" )
482478
483479
484480if __name__ == '__main__' :
0 commit comments