From 2b5c691041573e5ee5c28f133cbff8a20971c7aa Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Tue, 11 Jun 2019 14:30:07 +0200 Subject: [PATCH] 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) --- sonoff/_changelog.ino | 6 ++++-- sonoff/i18n.h | 5 ++--- sonoff/my_user_config.h | 9 +++------ sonoff/sonoff.ino | 2 +- sonoff/sonoff_version.h | 2 +- sonoff/xdrv_01_webserver.ino | 17 ++++++++++++----- sonoff/xdrv_02_mqtt.ino | 4 ++-- 7 files changed, 25 insertions(+), 20 deletions(-) diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino index 4c7c64139..512e55cc8 100644 --- a/sonoff/_changelog.ino +++ b/sonoff/_changelog.ino @@ -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 diff --git a/sonoff/i18n.h b/sonoff/i18n.h index ead8694ce..e4342f5ea 100644 --- a/sonoff/i18n.h +++ b/sonoff/i18n.h @@ -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)\"}"; diff --git a/sonoff/my_user_config.h b/sonoff/my_user_config.h index 7390027f2..6d2da8af0 100644 --- a/sonoff/my_user_config.h +++ b/sonoff/my_user_config.h @@ -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) diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index e1d84a65f..ef3992714 100755 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -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) { diff --git a/sonoff/sonoff_version.h b/sonoff/sonoff_version.h index e4650a484..cdf6a07fb 100644 --- a/sonoff/sonoff_version.h +++ b/sonoff/sonoff_version.h @@ -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_ diff --git a/sonoff/xdrv_01_webserver.ino b/sonoff/xdrv_01_webserver.ino index a1a2c2d89..f16142cb9 100644 --- a/sonoff/xdrv_01_webserver.ino +++ b/sonoff/xdrv_01_webserver.ino @@ -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 = "
" "" D_USER " (" MQTT_USER ")
" D_PASSWORD "
" D_PASSWORD "
" D_TOPIC " = %%topic%% (%s)
" D_FULL_TOPIC " (%s)