mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-24 01:16:55 +00:00
Fix storage of admin key when installing default config. (#4995)
* Fix LED pinout for T-Echo board marked v1.0, date 2021-6-28 * Merge PR #420 * Fixed double and missing Default class. * Use correct format specifier and fixed typo. * Removed duplicate code. * Fix error: #if with no expression * Fix warning: extra tokens at end of #endif directive. * Fix antenna switching logic. Complementary-pin control logic is required on the rp2040-lora board. * Fix deprecated macros. * Set RP2040 in dormant mode when deep sleep is triggered. * Fix array out of bounds read. * Admin key count needs to be set otherwise the key will be zero loaded after reset. * Don't reset the admin key size when loading defaults. Preserve an existing key in config if possible. --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
parent
53f189fff4
commit
94ecbad904
@ -317,8 +317,7 @@ void NodeDB::installDefaultConfig(bool preserveKey = false)
|
||||
#ifdef USERPREFS_USE_ADMIN_KEY
|
||||
memcpy(config.security.admin_key[0].bytes, USERPREFS_ADMIN_KEY, 32);
|
||||
config.security.admin_key[0].size = 32;
|
||||
#else
|
||||
config.security.admin_key[0].size = 0;
|
||||
config.security.admin_key_count = 1;
|
||||
#endif
|
||||
if (shouldPreserveKey) {
|
||||
config.security.private_key.size = 32;
|
||||
|
Loading…
Reference in New Issue
Block a user