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

Wifi Manager AP name and password extracted from MAC #1331

Merged
merged 1 commit into from
Nov 29, 2022

Conversation

1technophile
Copy link
Owner

@1technophile 1technophile commented Nov 28, 2022

Description:

Set the AP name with the short name plus the 4 first digits of the ESP mac
to don't disclose the password used for WM.
Also change the wm password from MAc to be the last 8 digits, as these will change more than the first 8 ones. Also make consistent the ifndef qnd the parsing between WM_PWD_FROM_MAC and USE_MAC_AS_GATEWAY_NAME

Checklist:

  • The pull request is done against the latest development branch
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • I accept the DCO.

…P mac

so as to don't disclose the password used for WM.
Also change the wm password from MAc to be the last 8 digits, as these will change more than the first 8 ones.
Also make consistent the ifndef qnd the parsing between WM_PWD_FROM_MAC and USE_MAC_AS_GATEWAY_NAME
@1technophile 1technophile merged commit c98511b into development Nov 29, 2022
@1technophile 1technophile deleted the wm-ap-with-short-mac branch November 29, 2022 02:06
@NorthernMan54
Copy link
Collaborator

Just updated a couple of my test boards, and identified a potentially un-intended side effect of this change. When use USE_MAC_AS_GATEWAY_NAME the OTA hostname is also the first 4 digits of ESP Mac, which is not unique.

N: OTA Hostname: OMG_4C75.local

My recommendation would be to revert the OTA hostname back to earlier behaviour, which was the full ESP Mac, but I did not consider the original use case this change was designed to resolve.

@NorthernMan54
Copy link
Collaborator

Replacing this line

strcpy(ota_hostname, WifiManager_ssid);

With

snprintf(ota_hostname, MAC_NAME_MAX_LEN, "%s_%s", Gateway_Short_Name, gateway_name);

Will restore the original behaviour

@1technophile
Copy link
Owner Author

I have considered this, but in this case, the ESP advertises the MAC address on the network, which also means the WifiManager Password when using WM_PWD_FROM_MAC will be available easily.
I was trying to find another board identifier and found that we could use the flash id, but didn't have time to implement it.

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 this pull request may close these issues.

2 participants