79
79
/* ************************************/
80
80
// Firmware Build Options
81
81
/* ************************************/
82
- #define DEBUG // Enable Serial Monitor, debug firmware
83
- #define STD_VERSION // Define for STD edition firmare, undefine for IN TRVL edition firmware
82
+ // #define DEBUG //Enable Serial Monitor, debug firmware
83
+ // #define STD_VERSION //Define for STD edition firmare, undefine for IN TRVL edition firmware
84
84
#define OK_Color // Define for hardware with color LED
85
85
// #define FACTORYKEYS // Attestation key and other keys encrypted using CHIP ID and RNG for unique per device
86
86
/* ************************************/
@@ -341,8 +341,6 @@ void setup() {
341
341
eeprom_write_byte ((unsigned char *)(2 +i), ctap_buffer[i]); // 2-65 used for fw integrity hash
342
342
}
343
343
memset (ctap_buffer, 0 , 2048 );
344
- // write fwvermaj, prevents downgrade to previous majver
345
- eeprom_write_byte ((unsigned char *)1984 , OKversionmaj[0 ]);
346
344
#endif
347
345
// 3) Enable flash security after writing
348
346
int nn = 0 ;
@@ -351,12 +349,11 @@ void setup() {
351
349
Serial.print (" Flash security bits " );
352
350
if (nn) Serial.print (" not " );
353
351
Serial.println (" written successfully" );
354
- Serial.println (" FW VER MAJ " );
355
- Serial.print (eeprom_read_byte ((unsigned char *)1984 ));
356
352
#endif
357
353
}
358
354
if (!initcheck) {
359
355
wipeEEPROM ();
356
+ eeprom_write_byte ((unsigned char *)1984 , (OKversionmaj[0 ] - ' 0' )); // write fwvermaj, prevents downgrade to previous majver
360
357
okeeprom_eeset_timeout ((uint8_t *)TIMEOUT); // Default lockout 30 min
361
358
unlocked = true ; // Flash is not protected, First time use
362
359
initialized = false ;
@@ -1222,8 +1219,6 @@ void process_slot(int s) {
1222
1219
index ++;
1223
1220
}
1224
1221
otplength = okeeprom_eeget_2FAtype (ptr, slot);
1225
- Serial.println (" OTP TYPE from Flash" );
1226
- Serial.println (temp[0 ]);
1227
1222
if (temp[0 ] > 0 )
1228
1223
{
1229
1224
if (temp[0 ] == MFAGOOGLEAUTH) { // Google Auth
@@ -1481,3 +1476,4 @@ void exceeded_login_attempts() {
1481
1476
}
1482
1477
1483
1478
1479
+
0 commit comments