From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============2379021530565263672==" MIME-Version: 1.0 From: Denis Kenzior Subject: Re: [PATCH 3/5] ap: Drop struct ap_config in favor of l_settings Date: Mon, 26 Apr 2021 15:22:56 -0500 Message-ID: In-Reply-To: List-Id: To: iwd@lists.01.org --===============2379021530565263672== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Andrew, >>> + if (!passphrase) { >> >> If the PSK is valid, you never get to this check...? Should probably be= done >> first... > = > Here we want the PSK to override the passphrase if both were present > (which they shouldn't) because we do the same thing in station mode > because we don't want to recalculate the PSK. Right. Maybe its just me but the error message below implies you want to o= nly = have one or the other, not both. The current behavior is to take PreShared= Key = and run with it even if both are provided. Anyway, not a big deal for now. This will get a bit trickier once we start = supporting SAE. > = >> >>> + l_error("AP requires one of [Security].PreSharedKey or " >>> + "[Security].Passphrase to be present"); >>> + return false; >>> + } >>> + >>> + strval =3D l_settings_get_string(config, "General", "SSID"); >>> + if (L_WARN_ON(!strval)) >> >> This is user-input, why L_WARN_ON? > = > So the SSID is passed as a D-Bus string or generated by p2p.c and then > written to the l_settings, it should be partly validated when we get > here. > = Fair enough. Do note that we can't get non-utf8 input strings through D-Bu= s = either. I imagine P2P validates the ssid to be utf8 as well, but having a = sanity check here doesn't hurt. Regards, -Denis --===============2379021530565263672==--