Skip to content

Commit

Permalink
Fix storage of admin key when installing default config. (#4995)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
Mictronics and thebentern authored Oct 7, 2024
1 parent 53f189f commit 94ecbad
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/mesh/NodeDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 94ecbad

Please sign in to comment.