@@ -45,11 +45,6 @@ static uint8_t _mock_seed[32] = {
45
45
0x33 , 0x33 , 0x33 , 0x33 , 0x33 , 0x33 , 0x33 , 0x33 , 0x44 , 0x44 , 0x44 , 0x44 , 0x44 , 0x44 , 0x44 , 0x44 ,
46
46
};
47
47
48
- static uint8_t _mock_seed_2 [32 ] = {
49
- 0x33 , 0x33 , 0x33 , 0x33 , 0x33 , 0x33 , 0x33 , 0x33 , 0x44 , 0x44 , 0x44 , 0x44 , 0x44 , 0x44 , 0x44 , 0x44 ,
50
- 0x11 , 0x11 , 0x11 , 0x11 , 0x11 , 0x11 , 0x11 , 0x11 , 0x22 , 0x22 , 0x22 , 0x22 , 0x22 , 0x22 , 0x22 , 0x22 ,
51
- };
52
-
53
48
static uint8_t _mock_bip39_seed [64 ] = {
54
49
0x11 , 0x11 , 0x11 , 0x11 , 0x11 , 0x11 , 0x11 , 0x11 , 0x22 , 0x22 , 0x22 , 0x22 , 0x22 , 0x22 , 0x22 , 0x22 ,
55
50
0x33 , 0x33 , 0x33 , 0x33 , 0x33 , 0x33 , 0x33 , 0x33 , 0x44 , 0x44 , 0x44 , 0x44 , 0x44 , 0x44 , 0x44 , 0x44 ,
@@ -305,30 +300,6 @@ static void _test_keystore_encrypt_and_store_seed(void** state)
305
300
assert_int_equal (keystore_encrypt_and_store_seed (_mock_seed , 32 , PASSWORD ), KEYSTORE_OK );
306
301
}
307
302
308
- // this tests that you can create a keystore, unlock it, and then do this again. This is an expected
309
- // workflow for when the wallet setup process is restarted after seeding and unlocking, but before
310
- // creating a backup, in which case a new seed is created.
311
- static void _test_keystore_create_and_unlock_twice (void * * state )
312
- {
313
- _expect_encrypt_and_store_seed ();
314
- assert_int_equal (keystore_encrypt_and_store_seed (_mock_seed , 32 , PASSWORD ), KEYSTORE_OK );
315
-
316
- uint8_t remaining_attempts ;
317
- _smarteeprom_reset ();
318
-
319
- will_return (__wrap_memory_is_seeded , true);
320
- _expect_retain_seed ();
321
- assert_int_equal (KEYSTORE_OK , keystore_unlock (PASSWORD , & remaining_attempts , NULL ));
322
-
323
- // Create new (different) seed.
324
- _expect_encrypt_and_store_seed ();
325
- assert_int_equal (keystore_encrypt_and_store_seed (_mock_seed_2 , 32 , PASSWORD ), KEYSTORE_OK );
326
-
327
- will_return (__wrap_memory_is_seeded , true);
328
- _expect_retain_seed ();
329
- assert_int_equal (KEYSTORE_OK , keystore_unlock (PASSWORD , & remaining_attempts , NULL ));
330
- }
331
-
332
303
static void _expect_seeded (bool seeded )
333
304
{
334
305
uint8_t seed [KEYSTORE_MAX_SEED_LENGTH ];
@@ -636,7 +607,6 @@ int main(void)
636
607
cmocka_unit_test (_test_keystore_secp256k1_nonce_commit ),
637
608
cmocka_unit_test (_test_keystore_secp256k1_sign ),
638
609
cmocka_unit_test (_test_keystore_encrypt_and_store_seed ),
639
- cmocka_unit_test (_test_keystore_create_and_unlock_twice ),
640
610
cmocka_unit_test (_test_keystore_unlock ),
641
611
cmocka_unit_test (_test_keystore_unlock_bip39 ),
642
612
cmocka_unit_test (_test_keystore_lock ),
0 commit comments