config: Disable editor by default if config b2sum present. Fixes #296

This commit is contained in:
mintsuki 2023-08-29 21:14:26 -05:00
parent 3f0591ee8c
commit 4a46597fcc
1 changed files with 2 additions and 0 deletions

View File

@ -147,6 +147,8 @@ int init_config(size_t config_size) {
config_b2sum += sizeof(CONFIG_B2SUM_SIGNATURE) - 1;
if (memcmp((void *)config_b2sum, CONFIG_B2SUM_EMPTY, 128) != 0) {
editor_enabled = false;
uint8_t out_buf[BLAKE2B_OUT_BYTES];
blake2b(out_buf, config_addr, config_size - 2);
uint8_t hash_buf[BLAKE2B_OUT_BYTES];