nixos/wireless: reimplement secrets using ext_password_backend#180872
Conversation
pennae
left a comment
There was a problem hiding this comment.
while testing these changes we've run into problems. it seems like wpa_supplicant will provide the password from the external file only to the highest priority block for each entry, i.e. the default settings of fallbackToWPA2 is completely broken.
this is currently not usable at all, and it looks a lot like an upstream bug :(
|
I made this a draft to prevent accidental merges. |
|
I found another upstream bug: the external password is not passed to the kernel if 4-way handshake offloading is enabled. |
|
It doesn't work with WPA3 SAE passwords either. I have written patches to fix both of these issues, which I'll try to get feedback on upstream: |
|
My patches have been accepted upstream. I wonder if @pennae's issue is a different bug, or was caused by the SAE issue I fixed. |
|
finally got around to this, and wpa_supplicant doesn't build from git: builds fine from release 2.10, but that's almost a year old. |
4b5b352 to
bb01a82
Compare
bb01a82 to
0cccd36
Compare
|
I rebased this branch to the latest master. I tried to patch the current wpa_supplicant, but the patches don't apply cleanly and I don't have time to do a backport. So, unless someone does it, this will have to wait for version 2.11. The good news is that now we have tests checking both WPA2 and WPA3: the tests will pass once wpa_supplicant bugs are fixed and this PR can be merged. |
|
@lopsided98 I tried your two patches (on void linux, on top of wpa_supplicant 2.10): I do get the error my config file contains and the file has a line |
|
I don't think it works with the |
|
Thanks a lot, that works indeed. |
|
2.11 is taking forever, for... reasons. |
This replaces the current implementation (splicing the secrets into the configuration file using environment variables) with the new built-in mechanism ext_password_backend. With some minor syntax changes, it works exactly as before, except the heavy lifting is done by wpa_supplicant and probably less error-prone.
0cccd36 to
f951caf
Compare
|
2.11 is Nixpkgs, I rebased and... it doesn't work. |
This links the generated configuration to /etc/wpa_supplicant.conf unless `allowAuxiliaryImperativeNetworks`. In the latter case the file in /etc should be writable and the generated one remains only in the Nix store.
|
I should have sorted everything out. If you could re-test with the latest rebase, it would be great. |
|
@GrahamcOfBorg test wpa_supplicant |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/breaking-changes-announcement-for-unstable/17574/59 |
|
I had a simple setup on one of my
Today after the reboot I found that my The contents of I suspect that commit 89eb93d From what I can see:
Did I get it right? Or something else clobbered my config? If it's indeed the commit 89eb93d is there a chance to get a failsafe assert to be added so that users would not lose their network setup after an upgrade? |
I changed the module to link the generated configuration to /etc/wpa_supplicant.conf, because otherwise the file is not easily accessible (you'd need to look at the daemon argv, or inspect the systemd unit). That said, I have no idea what
Did that ever work at all? Were you manually starting the wpa_supplicant daemon? AFAIK, without
I don't think so... at evaluation time I can't inspect the filesystem to assert the link would overwrite an existing file. |
No manual I have another system that did not update yet. It looks like something is copying All network-relevant networking.wireless.enable = true;
networking.wireless.interfaces = ["wlp0s20f3"];
networking.useDHCP = false;
networking.interfaces.wlp0s20f3.useDHCP = true;
|
|
Ah, you're right. The situation is quite messy because there are (were) three ways to configure wpa_supplicant: fully declaratively, mixed declarative/imperative and fully imperatively. The latter has been kind of unnecessary after I think that commit should be reverted and this deprecated properly, not sure about how, exactly. About nixos overwriting your file, that's apparently how it works... yikes. This should be another issue, if there's not already one open. |
This comment was marked as resolved.
This comment was marked as resolved.
Do we have a resolution for this? I have a similar concern. I'd like to not publish my SSID. |
the example usage mislead me. you can use the substitution for stuff that isn't a Password. However, I'm not sure about ssid. you might have to mkAfter the string to add something custom, not sure |
|
Sorry, but |
|
I just discovered another issue using this new approach: when using This seems to be an upstream issue, but I just want to mention it here as the previous |
Description of changes
This replaces the current implementation (splicing the secrets into the
configuration file using environment variavles) with the new built-in
mechanism
ext_password_backend.With some minor syntax changes, it works exactly as before, except the
heavy lifting is done by wpa_supplicant and probably less error-prone.
Things done
nixosTests.wpa_supplicantnixos/doc/manual/md-to-db.shto update generated release notescc: @lopsided98