@@ -56,6 +56,8 @@ def generate_entropy(strength, internal_entropy, external_entropy):
5656 return entropy_stripped
5757
5858class TestDeviceReset (common .KeepKeyTest ):
59+ POST_RC18_SETUP_FIRMWARE = "7.16.0"
60+
5961 def test_reset_device (self ):
6062 # No PIN, no passphrase
6163 external_entropy = b'zlutoucky kun upel divoke ody' * 2
@@ -112,7 +114,9 @@ def test_reset_device(self):
112114 self .assertIsInstance (resp , proto .Success )
113115
114116 def test_reset_device_dice (self ):
115- self .requires_firmware ("7.15.0" )
117+ # On-device dice entry landed after the RC18 candidate. RC18 accepts
118+ # the forward-compatible field but follows the ordinary entropy flow.
119+ self .requires_firmware (self .POST_RC18_SETUP_FIRMWARE )
116120
117121 external_entropy = b'zlutoucky kun upel divoke ody' * 2
118122 strength = 256 # 99 rolls
@@ -200,15 +204,17 @@ def test_reset_reentry_disarms_entropy_ack(self):
200204 int_entropy, so a following EntropyAck derived the seed from
201205 sha256(0*32 || host_bytes) -- entirely host-chosen.
202206
203- 7.15 closes it EARLIER and more strongly than the original fix did.
207+ The post-RC18 setup hardening closes it EARLIER and more strongly than
208+ the original fix did.
204209 #429 replaced the separate awaiting_entropy flag with a single armed
205210 (kind) ceremony, and setup_stage() now REFUSES to open a second
206211 ceremony on top of an armed one. So the re-entry this test used to
207212 perform is rejected outright rather than being allowed and then
208213 disarmed -- there is no second ceremony to leave armed. Both halves are
209214 asserted below: the refusal, and then the original property.
210215 """
211- self .requires_firmware ("7.15.0" )
216+ # The single armed-ceremony guard is the post-RC18 #429 behavior.
217+ self .requires_firmware (self .POST_RC18_SETUP_FIRMWARE )
212218 self .client .wipe_device ()
213219
214220 # Arm a reset and walk away without acking the entropy request.
@@ -258,17 +264,18 @@ def test_reset_device_pin(self):
258264 label = 'test' ))
259265
260266 # display_random=True above is deliberate: the field stays in the wire
261- # schema for host compatibility. Firmware 7.15.0 (fw 320f0eb5, "no
262- # entropy display") stopped honouring it -- internal entropy is seed
267+ # schema for host compatibility. The post-RC18 setup hardening (fw
268+ # 320f0eb5, "no entropy display"), first shipped on 7.16, stopped
269+ # honouring it -- internal entropy is seed
263270 # pre-image material, and a host that sets the flag and reads that
264271 # screen once can compute SHA256(shown || ext) and derive the seed.
265272 #
266273 # Branch on the version rather than skipping the test: everything below
267274 # (PIN entry, EntropyRequest/Ack, mnemonic derivation) is version-
268275 # independent and must keep running on older firmware.
269276 f = self .client .features
270- if (f .major_version , f .minor_version , f .patch_version ) < (7 , 15 , 0 ):
271- # Pre-7.15 : the Internal Entropy screen legitimately still exists.
277+ if (f .major_version , f .minor_version , f .patch_version ) < (7 , 16 , 0 ):
278+ # RC18 and older : the Internal Entropy screen still exists.
272279 self .assertIsInstance (ret , proto .ButtonRequest )
273280 self .client .debug .press_yes ()
274281 ret = self .client .call_raw (proto .ButtonAck ())
@@ -342,17 +349,18 @@ def test_failed_pin(self):
342349 label = 'test' ))
343350
344351 # display_random=True above is deliberate: the field stays in the wire
345- # schema for host compatibility. Firmware 7.15.0 (fw 320f0eb5, "no
346- # entropy display") stopped honouring it -- internal entropy is seed
352+ # schema for host compatibility. The post-RC18 setup hardening (fw
353+ # 320f0eb5, "no entropy display"), first shipped on 7.16, stopped
354+ # honouring it -- internal entropy is seed
347355 # pre-image material, and a host that sets the flag and reads that
348356 # screen once can compute SHA256(shown || ext) and derive the seed.
349357 #
350358 # Branch on the version rather than skipping the test: everything below
351359 # (PIN entry, EntropyRequest/Ack, mnemonic derivation) is version-
352360 # independent and must keep running on older firmware.
353361 f = self .client .features
354- if (f .major_version , f .minor_version , f .patch_version ) < (7 , 15 , 0 ):
355- # Pre-7.15 : the Internal Entropy screen legitimately still exists.
362+ if (f .major_version , f .minor_version , f .patch_version ) < (7 , 16 , 0 ):
363+ # RC18 and older : the Internal Entropy screen still exists.
356364 self .assertIsInstance (ret , proto .ButtonRequest )
357365 self .client .debug .press_yes ()
358366 ret = self .client .call_raw (proto .ButtonAck ())
0 commit comments