Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try authentication on W600 and W800 #1369

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/httpserver/http_basic_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int http_basic_auth_eval(http_request_t *request) {
tmp_auth[decoded_len] = 0;
if (!my_strnicmp(tmp_auth, "admin:", 6)) {
char *basic_auth_password = tmp_auth + 6;
if (strncmp(basic_auth_password, g_cfg.webPassword, 32) == 0) {
if (strncmp(basic_auth_password, g_cfg.webPassword, sizeof(g_cfg.webPassword)-1) == 0) {
return HTTP_BASIC_AUTH_OK;
}
}
Expand All @@ -53,4 +53,4 @@ int http_basic_auth_run(http_request_t *request) {
poststr(request, NULL);
}
return result;
}
}
4 changes: 3 additions & 1 deletion src/new_pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -1293,8 +1293,10 @@ typedef struct mainConfig_s {
//char initCommandLine[512];
#if PLATFORM_W600 || PLATFORM_W800
#define ALLOW_SSID2 0
#define ALLOW_WEB_PASSWORD 0
#define ALLOW_WEB_PASSWORD 1
char initCommandLine[512];
// ofs 0x000007E0 (dec 2016)
char webPassword[30];
#else
#define ALLOW_SSID2 1
#define ALLOW_WEB_PASSWORD 1
Expand Down
Loading