Consistency hashing now skip DISK_LABEL

This commit is contained in:
cecio
2023-06-11 21:55:04 +02:00
parent a0ad62e20f
commit c4b914f458
2 changed files with 9 additions and 8 deletions

View File

@@ -109,12 +109,12 @@ boolean written_reported = false;
// Burned hash to check consistency // Burned hash to check consistency
u8 valid_hash[WIDTH] = { u8 valid_hash[WIDTH] = {
0x35, 0x98, 0x95, 0x97, 0xC7, 0x70, 0xD3, 0xE4, 0x60, 0xFB, 0x68, 0xB5, 0xB9, 0xE6, 0xF4, 0xB7,
0xDD, 0x84, 0x71, 0x1D, 0x55, 0xD2, 0xE5, 0xA4, 0x5F, 0xAD, 0x3C, 0x0D, 0xD3, 0x85, 0x01, 0x74,
0x6C, 0x28, 0x84, 0xF6, 0xE1, 0x02, 0xD1, 0x74, 0xED, 0x70, 0x55, 0x55, 0xE8, 0x1D, 0xE4, 0xBB,
0x2F, 0xE9, 0x92, 0xAD, 0xAD, 0x74, 0x71, 0xF0, 0x4F, 0xC7, 0x2C, 0xA6, 0x7C, 0xC7, 0x79, 0x79,
0x37, 0xFF, 0x79, 0x39, 0xDC, 0x20, 0x56, 0x26, 0xEF, 0x21, 0x81, 0xB0, 0xEB, 0xD1, 0xF1, 0x71,
0xFE, 0xC7, 0x9A, 0x4E, 0x3A, 0x27, 0x65, 0x81 0x72, 0x37, 0x13, 0x0C, 0x28, 0x39, 0xC0, 0xB0
}; };
u8 computed_hash[WIDTH] = { 0x00 }; u8 computed_hash[WIDTH] = { 0x00 };
@@ -129,7 +129,8 @@ void setup() {
// TinyUSBDevice.setSerialDescriptor(USB_SERIAL); // TinyUSBDevice.setSerialDescriptor(USB_SERIAL);
// Check consistency of RAM FS // Check consistency of RAM FS
quark(computed_hash, msc_disk[BYTES_TO_HASH_OFFSET], BYTES_TO_HASH); // Add 11 bytes to skip the DISK_LABEL from the hashing
quark(computed_hash, msc_disk[BYTES_TO_HASH_OFFSET] + 11, BYTES_TO_HASH);
#if defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_RP2040) #if defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_RP2040)
// Manual begin() is required on core without built-in support for TinyUSB such as // Manual begin() is required on core without built-in support for TinyUSB such as

View File

@@ -37,7 +37,7 @@
// //
// Keep 11 chars // Keep 11 chars
#define DISK_LABEL 'U', 'S', 'B', 'V', 'A', 'L', 'V', 'E', ' ', ' ', ' ' #define DISK_LABEL 'M', 'y', 'D', 'r', 'i', 'v', 'e', ' ', ' ', ' ', ' '
// Do not change this here, it is just for reference // Do not change this here, it is just for reference
#define README_CONTENTS \ #define README_CONTENTS \