Replace compile-time HMAC key with USB provisioning
ESP firmware: - Store HMAC key in NVS via Preferences library instead of compile-time hmac_key.h - KEY? responds with HMAC_KEY:<hex> (if provisioned) or NO_KEY - New SET_KEY:<64-hex> command stores key in NVS and responds OK - Boot messages updated to reflect provisioning state Android app: - UsbKeyReceiver detects NO_KEY response and auto-provisions: generates random 32-byte key via SecureRandom, sends SET_KEY, waits for OK, saves key to SharedPreferences - Read loop now breaks on both HMAC_KEY: and NO_KEY responses Cleanup: - Removed tools/generate_hmac_key.py and src/hmac_key.h - Removed hmac_key.h from .gitignore - README updated for new provisioning flow
This commit is contained in:
parent
c707c21d7f
commit
9a84b05b8a
5 changed files with 155 additions and 116 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,6 +1,3 @@
|
|||
# HMAC key (generated, do not commit)
|
||||
src/hmac_key.h
|
||||
|
||||
# PlatformIO
|
||||
.pio/
|
||||
.pioenvs/
|
||||
|
|
|
|||
Loading…
Reference in a new issue