Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,16 @@ target_link_libraries(hslock
pico_enable_stdio_usb(hslock 1)
pico_enable_stdio_uart(hslock 0)

# H7 (part A): close the no-firmware-cooperation USB reset-to-BOOTSEL paths.
# pico_stdio_usb otherwise lets a host drop the chip into the BOOTSEL mass-
# storage bootloader with `stty ... 1200` or `picotool reboot -u` and then
# `picotool save` the whole image (every seed + the WiFi password). Disabling
# both reset interfaces means extraction now requires holding BOOTSEL / SWD,
# not just the port. (BOOTSEL-on-power-up and SWD remain — see H7 part B for
# at-rest encryption and the verify-on-hw note.)
target_compile_definitions(hslock PRIVATE
PICO_STDIO_USB_ENABLE_RESET_VIA_BAUD_RATE=0
PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE=0
)

pico_add_extra_outputs(hslock)
6 changes: 6 additions & 0 deletions mbedtls_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@
#define MBEDTLS_SHA1_C
#define MBEDTLS_MD_C

// H7: at-rest encryption of secrets in storage (AES-256-GCM under a device-bound
// KEK derived via HMAC-SHA256). GCM needs AES + the cipher layer.
#define MBEDTLS_AES_C
#define MBEDTLS_CIPHER_C
#define MBEDTLS_GCM_C

#endif
10 changes: 6 additions & 4 deletions serial/commands_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ void cmd_status(int argc, char **argv) {
printf("ntp: not synced\r\n");
}

// Keys (admin only: key inventory is target-selection data)
// Keys (admin only: key inventory is target-selection data). Declared at
// function scope so the scrub below always runs, even on the non-admin path
// where the array stays zero-initialised.
static key_record_t keys[BACKUP_MAX_KEYS];
if (commands_is_admin()) {
static key_record_t keys[BACKUP_MAX_KEYS];
int count = storage_key_list(keys, BACKUP_MAX_KEYS);
int enabled = 0, corrupt = 0;
int count = storage_key_list(keys, BACKUP_MAX_KEYS);
int enabled = 0, corrupt = 0;
for (int i = 0; i < count; i++) {
if (!keys[i].is_checksum_valid)
corrupt++;
Expand Down
Loading
Loading