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

[security & bug] Deprecate WPS & Fix Systemd Artifact #478

Open
pinuke opened this issue Feb 6, 2023 · 5 comments
Open

[security & bug] Deprecate WPS & Fix Systemd Artifact #478

pinuke opened this issue Feb 6, 2023 · 5 comments

Comments

@pinuke
Copy link

pinuke commented Feb 6, 2023

So while trying to port miraclecast over to ChromeOS via Chromebrew, we ran over errors involving how miracle-wifid interacts with wpa_supplicant

WARNING: cannot read hostname from systemd.hostname1: The name org.freedesktop.hostname1 was not provided by any .service files (manager_read_name() in ../src/wifi/wifid.c:400)
Successfully initialized wpa_supplicant
Line 2: unknown global field 'device_name=unknown'.
Line 2: Invalid configuration line 'device_name=unknown'.
Line 3: unknown global field 'device_type=1-0050F204-1'.
Line 3: Invalid configuration line 'device_type=1-0050F204-1'.
Line 4: unknown global field 'config_methods=pbc'.
Line 4: Invalid configuration line 'config_methods=pbc'.
Failed to read or parse configuration '/run/miracle/wifi/wlan0-2.conf'.
ERROR: supplicant: wpas (pid:9324) failed unexpectedly, relaunching after short grace period.. 

Now to touch briefly on systemd. According to this issue, miraclecast is trying to move away from its systemd dependency, so obvioudly, miracle-wifid should not be pulling the hostname from systemd if systemd does not exist. It should be pulling the hostname from elsewhere (user input if you have to)

Now the bigger issue is Line 2: Invalid configuration line 'device_name=unknown'. and Line 3: Invalid configuration line 'device_type=1-0050F204-1'.

After further discovery, we found the cause for the line 2 and line 3 errors was the fact that Chrome OS does not support WPS

Obviously, WPS is disabled on chromebooks for obvious security reasons, so this won't work on WPS-disabled systems

A better approach would be to support WiFi P2P (WiFi Direct) over WPA/WPA2 and deprecate WPS

@albfan
Copy link
Owner

albfan commented Feb 7, 2023

run without systemd is just an option for some distros. hostname is get from dbus. elogind seems to provide sd_bus_call_method too.

Use wifi from network manager is cover on #75

if needed, a PR to get hostname from local command is welcome.

You can modify wpa_supplicant config to use keyboard PIN instead of WPS

@pinuke
Copy link
Author

pinuke commented Feb 7, 2023

elogind seems to provide sd_bus_call_method too.

I'll have to take a look into that and see what effect that has on running it on ChromeOS

Use wifi from network manager is cover on #75

Interesting, ChromeOS doesn't use Network Manager. It uses an extremely locked down alternative known as shill (no command line. Can only be interacted with over dbus).

Though I do notice that a few things from that issue could be used to fix the issues on ChromeOS

if needed, a PR to get hostname from local command is welcome.

If I do end up forking miraclecast, I'll definitely submit one

run without systemd is just an option for some distros. hostname is get from dbus.

If I do end up forking and writing that out, it may be worth deprecating that systemd dependency and make miraclecast platform-agnostic.

However, I will say that this use case of miraclecast is pretty niche, and probably doesn't justify this platform-agnostic change. So I'll leave the topic of dropping the dependency on systemd.hostname to you guys.

You can modify wpa_supplicant config to use keyboard PIN instead of WPS

I'm exploring that now. I'll have to find a way to not use device_name and device_type in the .conf file. That's currently what I'm having to work around at the moment.

I'm not sure if disabling WPS on the original wpa_supplicant binary from hostapd disables those 2 fields or if it just disables it on ChromeOS's implementation.

@pinuke
Copy link
Author

pinuke commented Feb 7, 2023

elogind seems to provide sd_bus_call_method too.

I'll have to take a look into that and see what effect that has on running it on ChromeOS

I do see this: elogind/elogind@7640a5d#diff-0462e381b2fb3286568215681c8983490a37ac9ae0f0c5ee304df7fa6426d4afR182

@pinuke
Copy link
Author

pinuke commented Feb 7, 2023

@albfan
Copy link
Owner

albfan commented Feb 8, 2023

I was about to suggest https://gitlab.gnome.org/GNOME/gnome-network-displays (it is just a source not sink) but is even more heavily relying on network manager and dbus to configure Wifi P2P

Feel free to fork and provide PR with changes CHROMEOS_BUILD or similar

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

No branches or pull requests

2 participants