Repository navigation
Mask the meter keys in the configuration JSON and the GUI - #1339
Merged
Merged
Conversation
gskjold
force-pushed
the
mask-meter-keys
branch
from
December 4, 2026 09:20
54fa202 to
fa33d69
Compare
The meter encryption and authentication keys were returned in clear text by /configuration.json and by the MQTT getconfig reply, and shown in the configuration page. Report them as "***" when set and empty when not, the same way the web, Wi-Fi and MQTT passwords are handled. Saving the form with "***" keeps the stored key; an empty field still clears it and 32 hex digits replace it. MQTT setconfig already ignored values that are not 32 characters. Co-Authored-By: Claude Fable 5.2 <[email protected]>
gskjold
force-pushed
the
mask-meter-keys
branch
from
December 4, 2026 09:36
fa33d69 to
a5bb3b7
Compare
🔧 PR Build ArtifactsVersion: All environments built successfully. Download the zip files:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The meter encryption and authentication keys were returned in clear text by
/configuration.jsonand by the MQTTgetconfigreply (published to<publish topic>/config), and shown in the configuration page. Every other secret in that JSON (web password, Wi-Fi PSK, MQTT password) is already replaced by***. Anyone who can read the configuration endpoint or the MQTT topic could read the keys.Changes
AmsJsonGenerator::generateConfigurationJson()emits***for a key that is set and an empty string for one that is not. This covers both the HTTP endpoint and MQTTgetconfig, which share the generator. An unset authentication key used to be reported as 32 zeros and is now empty.AmsWebServer::handleSave()treats***inmek/meaas "keep the stored key", like the password fields. An empty field still clears the key and 32 hex digits replace it.setconfig: no behaviour change, comment only. A value that is not 32 characters was already ignored, so agetconfig→setconfiground trip keeps the keys.meterKeyPatternalso accepts***, so the form validates without retyping the key.ui/distrebuilt.Not changed: the configuration file download still includes the keys when "include secrets" is ticked, the same as the passwords.
Verification
pio run -e esp32s2andpio run -e esp8266build.pio test -e native_configpasses.***, clear on empty, replace on 32 hex digits) and the GUI form have not been exercised on hardware.🤖 Generated with Claude Code