Repository navigation
Conversation
d15abc5 to
73e3922
Compare
|
|
||
| function bss_reload_psk(bss, config, old_config) | ||
| { | ||
| if (is_equal(old_config.hash.wpa_psk_file, config.hash.wpa_psk_file)) |
There was a problem hiding this comment.
This shouldn't be here, it should instead regenerate the config if the sae_password_file changed. This won't do anything.
There was a problem hiding this comment.
I am really not sure about this one but simply put: if it doesn't do anything here, why would it do something in case of change to wpa_psk_file ? Shouldn't the logic be the same for both sae_password_file and wpa_psk_file ?
There was a problem hiding this comment.
Because RELOAD_WPA_PSK only reloads the wpa_psk_file and it's functionality handled by hostapd itself, sae_password_file is not handled by hostapd (as we're generating the sae_password line on the fly) and so we will need to regenerate the config and reload if it changed.
There was a problem hiding this comment.
Commit b78f011 is my best guess at solving this one. I never did touch UnrealScript before and so I cannot guarantee syntax is correct but the logic should work
There was a problem hiding this comment.
It's not UnrealScript, it's ucode: https://github.com/jow-/ucode
There was a problem hiding this comment.
It's not UnrealScript, it's ucode: https://github.com/jow-/ucode
As you can imagine I did never used ucode either, thanks :)
| @@ -408,7 +409,7 @@ hostapd_set_psk_file() { | |||
| json_get_vars mac vid key | |||
| set_default mac "00:00:00:00:00:00" | |||
There was a problem hiding this comment.
With SAE, there can only be one default key because - unlike with PSK2 - the AP can't check a PMK on its own.
That means there can be only one definition for MAC 00:00:00:00:00:00.
Maybe it makes sense to make that more explicit?
There was a problem hiding this comment.
(that is unless we start using id?)
hmm
There was a problem hiding this comment.
That means there can be only one definition for MAC
00:00:00:00:00:00.
I don't think we should restrain it (at the very least not in hostapd_set_psk_file). As a matter of facts, multiple PSK2 password set for MAC 00:00:00:00:00:00 are used to assign VLAN ID to clients based on their password.
But you are right, this ain't working with SAE, and while I did not know that when first working on this PR, hostapd_set_sae_password is now required since logic is different. With that in mind, it makes sense to implement support for id parameter.
There was a problem hiding this comment.
Password ID support implemented via e05e0c3
Exiting function with a message to stdout if a password is already set for default MAC with no ID.
|
Personally I think the approach in my PR is slightly better, #14515. I simply used the upstream patch |
|
@rany2 If there wasn't already the infrastructure for defining stations using UCI, I'd also favour your more direct approach. We should figure out how UCI and Just adding the option like you do here might make future work more difficult if people start using the file directly (going past the existing Openwrt infrastructure). |
No, it does not. WPS is only a WPA2 thing. |
|
@rany2 I agree that WPS has nothing to do with it. The more important point is: For the UCI-based mechanism, the file is just an artifact. It seems to me that your PR intends to have people writing to the file directly. If they start doing that, it's going to be more difficult to start using the UCI-defined stations for SAE in the future. |
It doesn't matter, if someone wanted to use a UCI-based mechanism they could just specify |
|
I would like to respectfully disagree. Also, I would strongly advise against a There's only one attempt. No guesswork and no brute-force (like it was possible with PSK2). A list of passwords simply makes no sense. You need to know which 1 password to test. In effect, this means you get one dictionary lookup (MAC + opt. key id) and, in case of a miss, you could go with a default. |
|
@yogo1212 I really don't understand what you're arguing about. Hostapd already supports specifying sae_password multiple times. You could specify both sae_password and sae_password_file, it's not mutually exclusive. sae_password_file is just treated by hostapd as if each line is a new sae_password entry. The only difference is that you could only have one wildcard entry with SAE (if you specify multiple wildcard entries, the last one takes effect) whereas PSK does a brute force matching for every matching entry. |
|
@rany2 In my last comment, I was mainly concerned that there was a misconception about SAE because your proposal of adding a My more general concern is that there is currently a dichotomy regarding
It makes sense for Openwrt to provide an abstraction for PSK2/SAE and, in fact, it already does (in part). I simply want to avoid having to do a breaking change here as well. Right now, there is no support for One way to deal with this could be to only use Another way could be to agree now that the goal will be to always merge UCI stations and user-supplied file into one. It is not my intention to upset anyone now but to avoid greater upset (also affecting users) in the future. |
73e3922 to
251bda3
Compare
| ) | ||
| if (is_equal(type, "sae")) { | ||
| let file = "sae_password_file" | ||
| let cmd = "RELOAD_CONFIG" |
There was a problem hiding this comment.
This doesn't work, it doesn't reread the sae_password_file.
There was a problem hiding this comment.
@rany2 if it doesn't reread the file; how can that work for psk?
bss_reload_psk is comparing file hashes which must be computed by reading the file and so if it works for wpa_psk_file there is no reason it does not for sae_password_file or am I missing something?
There was a problem hiding this comment.
if i'm not mistaking hashes are calculated only once, when loading config in iface_load_config which is called prior to iface_set_config and in which iface_reload_config is called and comparing file hashes. so afaik, file hash is updated at the time bss_reload_psk is called
There was a problem hiding this comment.
Oh, you're reading the sae_password_file yourself and then setting the sae_password(s). I thought you were using the hostapd option by now as it is now available in OpenWRT's hostapd. I'm not sure if the bug is relevant if you're setting the sae_password in the hostapd config but maybe not. You need to test it.
However I know for sure that if you used hostapd sae_password_file option it does not work
There was a problem hiding this comment.
This code can't work since let xxx variables declared inside a block are scoped to that block, they`re not visible outside. Also semicolons are mandatory to terminate a statement (they're only optional for the last statement in a block).
It needs to be something like this:
let file, cmd, msg;
if (type == "sae") {
file = "sae_password_file";
cmd = "RELOAD_CONFIG";
msg = "Reload config on sae_password_file change for bss";
}
else {
file = "wpa_psk_file";
cmd = "RELOAD_WPA_PSK";
msg = "Reload WPA PSK file for bss";
}There was a problem hiding this comment.
Shouldn't ucode complain about this not being valid? At any rate, I was actually referring to RELOAD_CONFIG and RELOAD_BSS_CONFIG not reloading for hostapd's sae_password_file option in specific; I hadn't confirmed that this issue is relevant for when sae_password is defined in hostapd config. I didn't know that this wasn't valid code in the first place. I didn't test this submission.
There was a problem hiding this comment.
Oh, you're reading the sae_password_file yourself and then setting the sae_password(s). I thought you were using the hostapd option by now as it is now available in OpenWRT's hostapd. I'm not sure if the bug is relevant if you're setting the sae_password in the hostapd config but maybe not. You need to test it.
Thanks, I will test implementation and report back.
There was a problem hiding this comment.
@rany2 I can now confirm wifi script needs to be called when sae_password_file is amended. hostapd.conf is then regenerated with sae_password_file content.
72ce735 to
b04e331
Compare
|
While functional, I realize the PR is far from perfect, I am discovering OpenWrt inner working with it.
Both options make sense IMHO. We could proceed as follows
|
|
Latest two commits add support for password identifiers in Would anyone disagree with this approach, I can simply remove the |
852f8c6 to
d636ecc
Compare
|
I just squashed all commits and will make sure I do not pollute this PR with work-in-progress commits in the future - I clearly made it a mess, please accept my apologies for that. I am really not sure about what to do with the changes to hostapd.uc, I guess it should just be removed and aligned with what @rany2 did in #14515. Please advice. Any suggestions are welcomed. |
d636ecc to
fe8dd4d
Compare
- Adds SAE support to station defined using `wifi-section` configuration section - Adds support for password identifiers using `pwid` option in `wifi-section` section - Adds support for `sae_password_file` option in `wifi-iface` section, merging with UCI defined password Signed-off-by: Simon Castano <[email protected]>
fe8dd4d to
feba237
Compare
|
@rany2: Good job and thanks to @robimarko for recent merging! :) @rany2: Other tickets/PRs that I have listed here can be closed? @robimarko, like @rany2 has said, this ticket can be closed, maybe other ones too? |
With
saeorsae-mixedencryption it is currently not possible to assign multiple passwords to a singlebss.This PR adds multiple passwords support for the above mentioned encryption mode both via
wifi-stationconfig section andsae_password_fileentry onwifi-ifacesection, therefore allowing VLAN ID assignment for WPA3 clients (using password identifiers).