File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -40,19 +40,22 @@ int main(int argc, char** argv) {
4040
4141 std::shared_ptr<SecureString> p;
4242 uint8_t n_unlocks = 0 , n_counter = 0 ;
43- while (n_unlocks == 0 && n_counter++ <= 4 ) {
43+ while (n_unlocks == 0 && n_counter < 3 ) {
4444 p = GetPassPhrase (" Password: " );
4545 n_unlocks += UnlockSEDs ((char *)p->c_str ());
46+ if (n_unlocks == 0 ) n_counter++;
4647 }
47- if (strcmp (p->c_str (), " debug" ) && n_counter <= 2 ) {
48- printf (" \n Access granted. Starting the system... \n " );
49- sync ();
50- reboot (RB_AUTOBOOT);
51- }
52- else if (n_counter > 2 ) {
48+
49+ if (n_counter >= 3 ) {
5350 printf (" \n Authorization failed. Shutting down... \n " );
5451 sync ();
5552 reboot (RB_POWER_OFF);
5653 }
54+ else if (strcmp (p->c_str (), " debug" )) {
55+ printf (" \n Access granted. Starting the system... \n " );
56+ sync ();
57+ reboot (RB_AUTOBOOT);
58+ }
59+
5760 return 0 ;
5861}
You can’t perform that action at this time.
0 commit comments