obfuscate passwords
This commit is contained in:
parent
196a87d47b
commit
62aa76b06a
|
@ -212,9 +212,17 @@ void InternalDisplay::saveMQTTConfig()
|
||||||
if (!this->getStringToBuffer("user_set.txt", this->mqttConfig->mqtt_user, 16))
|
if (!this->getStringToBuffer("user_set.txt", this->mqttConfig->mqtt_user, 16))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Save the mqtt password
|
// Check if the password should be
|
||||||
if (!this->getStringToBuffer("password_set.txt", this->mqttConfig->mqtt_password, 16))
|
char password_temp[32];
|
||||||
|
// Get the passwords
|
||||||
|
if (!this->getStringToBuffer("password_set.txt", password_temp, 16))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Check if the password should be updated
|
||||||
|
if (strcmp(password_temp, PASSWORD_OBFUSCATION_STRING))
|
||||||
|
{
|
||||||
|
strcpy(this->mqttConfig->mqtt_password, password_temp);
|
||||||
|
}
|
||||||
|
|
||||||
// Save the mqtt base topic
|
// Save the mqtt base topic
|
||||||
if (!this->getStringToBuffer("topic_set.txt", this->mqttConfig->base_topic, 16))
|
if (!this->getStringToBuffer("topic_set.txt", this->mqttConfig->base_topic, 16))
|
||||||
|
@ -852,7 +860,7 @@ void InternalDisplay::refreshMQTTConfig()
|
||||||
this->sendStopBytes();
|
this->sendStopBytes();
|
||||||
// Refresh the mqtt password
|
// Refresh the mqtt password
|
||||||
this->displayAdapter->print("password_set.txt=\"");
|
this->displayAdapter->print("password_set.txt=\"");
|
||||||
this->displayAdapter->print(this->mqttConfig->mqtt_password);
|
this->displayAdapter->print(PASSWORD_OBFUSCATION_STRING);
|
||||||
this->displayAdapter->print("\"");
|
this->displayAdapter->print("\"");
|
||||||
this->sendStopBytes();
|
this->sendStopBytes();
|
||||||
// Refresh the mqtt base topic
|
// Refresh the mqtt base topic
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
#include <DigitalOutputCard.hpp>
|
#include <DigitalOutputCard.hpp>
|
||||||
#include <ClimateCard.hpp>
|
#include <ClimateCard.hpp>
|
||||||
|
|
||||||
|
// Password Obfuscation
|
||||||
|
#define PASSWORD_OBFUSCATION_STRING "********"
|
||||||
|
|
||||||
// Page IDs
|
// Page IDs
|
||||||
#define INTERNAL_DISPLAY_BOOT_PAGE 0
|
#define INTERNAL_DISPLAY_BOOT_PAGE 0
|
||||||
#define INTERNAL_DISPLAY_DASHBOARD_PAGE 1
|
#define INTERNAL_DISPLAY_DASHBOARD_PAGE 1
|
||||||
|
|
Loading…
Reference in New Issue