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

softap_config_equal does not compare auth_mode/cipher #5115

Closed
Rotzbua opened this issue Apr 27, 2021 · 0 comments · Fixed by #5121
Closed

softap_config_equal does not compare auth_mode/cipher #5115

Rotzbua opened this issue Apr 27, 2021 · 0 comments · Fixed by #5121

Comments

@Rotzbua
Copy link
Contributor

Rotzbua commented Apr 27, 2021

Software

Release: 2.0.0-alpha1 and earlier
Library: Wifi

Description

Compare function does not compare security relevant settings. The configured authmode and (since v2) cipher is not compared. For those reason softAP() does not return false in case of bug #5038 and leads to an insecure open ap which is a huge security problem if somebody gets access to normally protected content.

Code

static bool softap_config_equal(const wifi_config_t& lhs, const wifi_config_t& rhs)
{
if(strcmp(reinterpret_cast<const char*>(lhs.ap.ssid), reinterpret_cast<const char*>(rhs.ap.ssid)) != 0) {
return false;
}
if(strcmp(reinterpret_cast<const char*>(lhs.ap.password), reinterpret_cast<const char*>(rhs.ap.password)) != 0) {
return false;
}
if(lhs.ap.channel != rhs.ap.channel) {
return false;
}
if(lhs.ap.ssid_hidden != rhs.ap.ssid_hidden) {
return false;
}
if(lhs.ap.max_connection != rhs.ap.max_connection) {
return false;
}
return true;
}

Expected

Also authmode/cipher should be checked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant