@@ -193,12 +193,20 @@ def test_reset_device_dice(self):
193193 self .assertEqual (' ' .join (mnemonic ), expected_mnemonic )
194194
195195 def test_reset_reentry_disarms_entropy_ack (self ):
196- """An aborted reset must not leave EntropyAck armed.
196+ """An abandoned reset must never leave EntropyAck armed.
197197
198- Regression: reset_init aborts (dice cancel, PIN mismatch, ...) left
199- awaiting_entropy set from an earlier run while zeroing int_entropy,
200- so a following EntropyAck derived the seed from
198+ Regression this guards : reset_init aborts (dice cancel, PIN mismatch,
199+ ...) left awaiting_entropy set from an earlier run while zeroing
200+ int_entropy, so a following EntropyAck derived the seed from
201201 sha256(0*32 || host_bytes) -- entirely host-chosen.
202+
203+ 7.15 closes it EARLIER and more strongly than the original fix did.
204+ #429 replaced the separate awaiting_entropy flag with a single armed
205+ (kind) ceremony, and setup_stage() now REFUSES to open a second
206+ ceremony on top of an armed one. So the re-entry this test used to
207+ perform is rejected outright rather than being allowed and then
208+ disarmed -- there is no second ceremony to leave armed. Both halves are
209+ asserted below: the refusal, and then the original property.
202210 """
203211 self .requires_firmware ("7.15.0" )
204212 self .client .wipe_device ()
@@ -212,16 +220,20 @@ def test_reset_reentry_disarms_entropy_ack(self):
212220 label = 'first' ))
213221 self .assertIsInstance (ret , proto .EntropyRequest )
214222
215- # Re-enter with dice, then abort from the host.
223+ # Re-entry is REFUSED while a ceremony is armed. This is the #429
224+ # guard; before it, the second ResetDevice was accepted and the code
225+ # had to remember to disarm the first one.
216226 ret = self .client .call_raw (proto .ResetDevice (display_random = False ,
217227 strength = 256 ,
218228 passphrase_protection = False ,
219229 pin_protection = False ,
220230 language = 'english' ,
221231 label = 'second' ,
222232 dice_entropy = True ))
223- self .assertIsInstance (ret , proto .ButtonRequest )
224- self .assertEqual (ret .code , proto_types .ButtonRequest_DiceRoll )
233+ self .assertIsInstance (ret , proto .Failure )
234+ self .assertIn ('middle of setup' , ret .message )
235+
236+ # Abandon the FIRST ceremony the way the host is told to.
225237 ret = self .client .call_raw (proto .Cancel ())
226238 self .assertIsInstance (ret , proto .Failure )
227239
0 commit comments