File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -48,11 +48,25 @@ void reset_reset(bool status)
48
48
{
49
49
keystore_lock ();
50
50
#if !defined(TESTING )
51
- if (!securechip_update_keys ()) {
51
+ bool sc_result_update_keys = false;
52
+ for (int retries = 0 ; retries < 5 ; retries ++ ) {
53
+ sc_result_update_keys = securechip_update_keys ();
54
+ if (sc_result_update_keys ) {
55
+ break ;
56
+ }
57
+ }
58
+ if (!sc_result_update_keys ) {
52
59
Abort ("Could not reset secure chip." );
53
60
}
54
61
#if APP_U2F == 1
55
- if (!securechip_u2f_counter_set (0 )) {
62
+ bool sc_result_u2f_counter_set = false;
63
+ for (int retries = 0 ; retries < 5 ; retries ++ ) {
64
+ sc_result_u2f_counter_set = securechip_u2f_counter_set (0 );
65
+ if (sc_result_u2f_counter_set ) {
66
+ break ;
67
+ }
68
+ }
69
+ if (!sc_result_u2f_counter_set ) {
56
70
Abort ("Could not initialize U2F counter." );
57
71
}
58
72
#endif
Original file line number Diff line number Diff line change @@ -605,7 +605,12 @@ bool securechip_monotonic_increments_remaining(uint32_t* remaining_out)
605
605
606
606
bool securechip_random (uint8_t * rand_out )
607
607
{
608
- return atcab_random (rand_out ) == ATCA_SUCCESS ;
608
+ for (int retries = 0 ; retries < 5 ; retries ++ ) {
609
+ if (atcab_random (rand_out ) == ATCA_SUCCESS ) {
610
+ return true;
611
+ }
612
+ }
613
+ return false;
609
614
}
610
615
611
616
// Length of priv_key must be 32 bytes
You can’t perform that action at this time.
0 commit comments