6.5.0.16 Refactor TLS and Add visibility toggle to GUI password
6.5.0.16 20190611 * Refactored TLS based on BearSSL, warning breaking change for fingerprints validation (see doc) * Add checkbox to GUI password field enabling visibility during password entry only (#5934)
This commit is contained in:
parent
f99649dc18
commit
2b5c691041
@ -1,4 +1,7 @@
|
||||
/*
|
||||
/* 6.5.0.16 20190611
|
||||
* Refactored TLS based on BearSSL, warning breaking change for fingerprints validation (see doc)
|
||||
* Add checkbox to GUI password field enabling visibility during password entry only (#5934)
|
||||
*
|
||||
* 6.5.0.15 20190606
|
||||
* Change pubsubclient MQTT_KEEPALIVE from 10 to 30 seconds in preparation of AWS IoT support
|
||||
* Add support for AWS IoT with TLS 1.2 on core 2.5.2. Full doc here: https://github.com/arendst/Sonoff-Tasmota/wiki/AWS-IoT
|
||||
@ -7,7 +10,6 @@
|
||||
* Fix include of my_user_config.h in sonoff_aws_iot.cpp (#5930)
|
||||
* Fix exception 9 when syslog is enabled and NTP is just synced (#5917)
|
||||
* Fix Toggle functionality to button double press when one button and two devices are detected (#5935)
|
||||
* Refactored TLS based on BearSSL, warning breaking change for fongerprints validation (see doc)
|
||||
*
|
||||
* 6.5.0.14 20190602
|
||||
* Change webserver HTML input, button, textarea, and select name based on id
|
||||
|
||||
@ -428,7 +428,6 @@
|
||||
|
||||
/********************************************************************************************/
|
||||
|
||||
#define D_ASTERIX "********"
|
||||
#define D_ASTERISK_PWD "****"
|
||||
|
||||
#ifndef MY_LANGUAGE
|
||||
@ -501,13 +500,13 @@ const char S_JSON_COMMAND_NVALUE_ACTIVE_NVALUE[] PROGMEM = "{\"%s\":\"%d (" D
|
||||
const char S_JSON_COMMAND_NVALUE[] PROGMEM = "{\"%s\":%d}";
|
||||
const char S_JSON_COMMAND_LVALUE[] PROGMEM = "{\"%s\":%lu}";
|
||||
const char S_JSON_COMMAND_SVALUE[] PROGMEM = "{\"%s\":\"%s\"}";
|
||||
const char S_JSON_COMMAND_ASTERIX[] PROGMEM = "{\"%s\":\"" D_ASTERIX "\"}";
|
||||
const char S_JSON_COMMAND_ASTERISK[] PROGMEM = "{\"%s\":\"" D_ASTERISK_PWD "\"}";
|
||||
const char S_JSON_COMMAND_XVALUE[] PROGMEM = "{\"%s\":%s}"; // %s must provide quotes on non-number
|
||||
|
||||
const char S_JSON_COMMAND_INDEX_NVALUE[] PROGMEM = "{\"%s%d\":%d}";
|
||||
const char S_JSON_COMMAND_INDEX_LVALUE[] PROGMEM = "{\"%s%d\":%lu}";
|
||||
const char S_JSON_COMMAND_INDEX_SVALUE[] PROGMEM = "{\"%s%d\":\"%s\"}";
|
||||
const char S_JSON_COMMAND_INDEX_ASTERIX[] PROGMEM = "{\"%s%d\":\"" D_ASTERIX "\"}";
|
||||
const char S_JSON_COMMAND_INDEX_ASTERISK[] PROGMEM = "{\"%s%d\":\"" D_ASTERISK_PWD "\"}";
|
||||
const char S_JSON_COMMAND_INDEX_SVALUE_SVALUE[] PROGMEM = "{\"%s%d\":\"%s%s\"}";
|
||||
const char S_JSON_COMMAND_INDEX_NVALUE_ACTIVE_NVALUE[] PROGMEM = "{\"%s%d\":\"%d (" D_JSON_ACTIVE " %d)\"}";
|
||||
|
||||
|
||||
@ -262,15 +262,12 @@
|
||||
#define USE_HOME_ASSISTANT // Enable Home Assistant Discovery Support (+7k code)
|
||||
#define HOME_ASSISTANT_DISCOVERY_PREFIX "homeassistant" // Home Assistant discovery prefix
|
||||
|
||||
// -- MQTT - TLS - AWS IoT ----------------------------------
|
||||
// -- MQTT - TLS - AWS IoT ------------------------
|
||||
//#define USE_MQTT_TLS // Use TLS for MQTT connection (+56.7k code, +6.0k mem and +6.6k additional during connection handshake)
|
||||
//#define USE_MQTT_TLS_CA_CERT // Force full CA validation instead of fingerprints, uses more memory and slower, but simpler to use
|
||||
//#define USE_MQTT_AWS_IOT // Enable MQTT for AWS IoT - requires a private key (+56.7k code, +6.0k mem and +6.6k additional during connection handshake)
|
||||
// note: enabling USE_MQTT_AWS_IOT autoamtically enables USE_MQTT_TLS
|
||||
// you need to generate a private key + certificate per device
|
||||
// and update 'sonoff/sonoff_aws_iot.cpp'
|
||||
// Full documentation here: https://github.com/arendst/Sonoff-Tasmota/wiki/AWS-IoT
|
||||
|
||||
// Note: you need to generate a private key + certificate per device and update 'sonoff/sonoff_aws_iot.cpp'
|
||||
// Full documentation here: https://github.com/arendst/Sonoff-Tasmota/wiki/AWS-IoT
|
||||
|
||||
// -- KNX IP Protocol -----------------------------
|
||||
//#define USE_KNX // Enable KNX IP Protocol Support (+9.4k code, +3k7 mem)
|
||||
|
||||
@ -1259,7 +1259,7 @@ void MqttDataHandler(char* topic, uint8_t* data, unsigned int data_len)
|
||||
restart_flag = 2;
|
||||
Response_P(S_JSON_COMMAND_INDEX_SVALUE, command, index, Settings.sta_pwd[index -1]);
|
||||
} else {
|
||||
Response_P(S_JSON_COMMAND_INDEX_ASTERIX, command, index);
|
||||
Response_P(S_JSON_COMMAND_INDEX_ASTERISK, command, index);
|
||||
}
|
||||
}
|
||||
else if (CMND_HOSTNAME == command_code) {
|
||||
|
||||
@ -20,6 +20,6 @@
|
||||
#ifndef _SONOFF_VERSION_H_
|
||||
#define _SONOFF_VERSION_H_
|
||||
|
||||
const uint32_t VERSION = 0x0605000F;
|
||||
const uint32_t VERSION = 0x06050010;
|
||||
|
||||
#endif // _SONOFF_VERSION_H_
|
||||
|
||||
@ -61,7 +61,14 @@ const char HTTP_HEAD[] PROGMEM =
|
||||
"function qs(s){" // Alias to save code space
|
||||
"return document.querySelector(s);"
|
||||
"}"
|
||||
|
||||
"function sp(i){" // Toggle password visibility
|
||||
"var x=eb(i);"
|
||||
"if(x.type==='password'){"
|
||||
"x.type='text';"
|
||||
"}else{"
|
||||
"x.type='password';"
|
||||
"}"
|
||||
"}"
|
||||
// https://www.htmlgoodies.com/beyond/javascript/article.php/3724571/Using-Multiple-JavaScript-Onload-Functions.htm
|
||||
"function wl(f){" // Execute multiple window.onload
|
||||
"var o=window.onload;"
|
||||
@ -354,9 +361,9 @@ const char HTTP_FORM_WIFI[] PROGMEM =
|
||||
"<fieldset><legend><b> " D_WIFI_PARAMETERS " </b></legend>"
|
||||
"<form method='get' action='wi'>"
|
||||
"<p><b>" D_AP1_SSID "</b> (" STA_SSID1 ")<br><input id='s1' placeholder='" STA_SSID1 "' value='%s'></p>"
|
||||
"<p><b>" D_AP1_PASSWORD "</b><br><input id='p1' type='password' placeholder='" D_AP1_PASSWORD "' value='" D_ASTERISK_PWD "'></p>"
|
||||
"<p><b>" D_AP1_PASSWORD "</b><input type='checkbox' onclick='sp(\"p1\")'><br><input id='p1' type='password' placeholder='" D_AP1_PASSWORD "' value='" D_ASTERISK_PWD "'></p>"
|
||||
"<p><b>" D_AP2_SSID "</b> (" STA_SSID2 ")<br><input id='s2' placeholder='" STA_SSID2 "' value='%s'></p>"
|
||||
"<p><b>" D_AP2_PASSWORD "</b><br><input id='p2' type='password' placeholder='" D_AP2_PASSWORD "' value='" D_ASTERISK_PWD "'></p>"
|
||||
"<p><b>" D_AP2_PASSWORD "</b><input type='checkbox' onclick='sp(\"p2\")'><br><input id='p2' type='password' placeholder='" D_AP2_PASSWORD "' value='" D_ASTERISK_PWD "'></p>"
|
||||
"<p><b>" D_HOSTNAME "</b> (%s)<br><input id='h' placeholder='%s' value='%s'></p>";
|
||||
|
||||
const char HTTP_FORM_LOG1[] PROGMEM =
|
||||
@ -376,7 +383,7 @@ const char HTTP_FORM_OTHER[] PROGMEM =
|
||||
"<p><input id='t2' type='checkbox'%s><b>" D_ACTIVATE "</b></p>"
|
||||
"</fieldset>"
|
||||
"<br>"
|
||||
"<b>" D_WEB_ADMIN_PASSWORD "</b><br><input id='wp' type='password' placeholder='" D_WEB_ADMIN_PASSWORD "' value='" D_ASTERIX "'><br>"
|
||||
"<b>" D_WEB_ADMIN_PASSWORD "</b><input type='checkbox' onclick='sp(\"wp\")'><br><input id='wp' type='password' placeholder='" D_WEB_ADMIN_PASSWORD "' value='" D_ASTERISK_PWD "'><br>"
|
||||
"<br>"
|
||||
"<input id='b1' type='checkbox'%s><b>" D_MQTT_ENABLE "</b><br>"
|
||||
"<br>";
|
||||
@ -2445,7 +2452,7 @@ bool WebCommand(void)
|
||||
strlcpy(Settings.web_password, (SC_CLEAR == Shortcut(XdrvMailbox.data)) ? "" : (SC_DEFAULT == Shortcut(XdrvMailbox.data)) ? WEB_PASSWORD : XdrvMailbox.data, sizeof(Settings.web_password));
|
||||
Response_P(S_JSON_COMMAND_SVALUE, command, Settings.web_password);
|
||||
} else {
|
||||
Response_P(S_JSON_COMMAND_ASTERIX, command);
|
||||
Response_P(S_JSON_COMMAND_ASTERISK, command);
|
||||
}
|
||||
}
|
||||
else if (CMND_WEBLOG == command_code) {
|
||||
|
||||
@ -688,7 +688,7 @@ bool MqttCommand(void)
|
||||
Response_P(S_JSON_COMMAND_SVALUE, command, Settings.mqtt_pwd);
|
||||
restart_flag = 2;
|
||||
} else {
|
||||
Response_P(S_JSON_COMMAND_ASTERIX, command);
|
||||
Response_P(S_JSON_COMMAND_ASTERISK, command);
|
||||
}
|
||||
}
|
||||
#endif // USE_MQTT_AWS_IOT
|
||||
@ -854,7 +854,7 @@ const char HTTP_FORM_MQTT1[] PROGMEM =
|
||||
const char HTTP_FORM_MQTT2[] PROGMEM =
|
||||
#ifndef USE_MQTT_AWS_IOT // user and password disabled with AWS IoT
|
||||
"<p><b>" D_USER "</b> (" MQTT_USER ")<br><input id='mu' placeholder='" MQTT_USER "' value='%s'></p>"
|
||||
"<p><b>" D_PASSWORD "</b><br><input id='mp' type='password' placeholder='" D_PASSWORD "' value='" D_ASTERISK_PWD "'></p>"
|
||||
"<p><b>" D_PASSWORD "</b><input type='checkbox' onclick='sp(\"mp\")'><br><input id='mp' type='password' placeholder='" D_PASSWORD "' value='" D_ASTERISK_PWD "'></p>"
|
||||
#endif // USE_MQTT_AWS_IOT
|
||||
"<p><b>" D_TOPIC "</b> = %%topic%% (%s)<br><input id='mt' placeholder='%s' value='%s'></p>"
|
||||
"<p><b>" D_FULL_TOPIC "</b> (%s)<br><input id='mf' placeholder='%s' value='%s'></p>";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user