[PATCH 2/2] ext_password: Implement new file-based backend

Patrick Steinhardt ps at pks.im
Sun Feb 14 06:03:21 EST 2021


On Sun, Feb 14, 2021 at 12:18:22AM +0200, Jouni Malinen wrote:
> On Sun, Feb 07, 2021 at 06:48:36PM +0100, Patrick Steinhardt wrote:
[snip]
> > +static void ext_password_file_deinit(void *ctx)
> > +{
> > +	struct ext_password_file_data *data = ctx;
> > +
> > +	str_clear_free(data->path);
> 
> str_clear_free() sounds a bit heavy for a path name, but well, if that
> contains some secure information.. However:

Right, that could be a simple `os_free` call. I'll leave it as-is for
now, but I'm happy to change it.

> > +static struct wpabuf * ext_password_file_get(void *ctx, const char *name)
> > +{
> > +	struct ext_password_file_data *data = ctx;
> > +	struct wpabuf *password = NULL;
> > +	char buf[512], *pos;
> 
> This buf[] is used to read the actual passwords, so it would be more
> useful to explicitly clear that memory after use here.. And probably not
> the best design to use wpa_printf(MSG_ERROR, "stuff with the raw line
> from the password file") to get passwords exposed in debug logs and/or
> stdout. Maybe just print the line number without any of the payload.
> 
> > +	while (wpa_config_get_line(buf, sizeof(buf), f, &line, &pos)) {
> > +done:
> > +	fclose(f);
> > +	return password;
> 
> In other words, forced_memzero(buf, sizeof(buf)) before returning from
> the function.

Yup, makes sense.

Patrick

> > diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
> 
> And also similar changes for wpa_supplicant/Android.mk.
> 
> -- 
> Jouni Malinen                                            PGP id EFC895FA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/hostap/attachments/20210214/0ceb5ffc/attachment.sig>


More information about the Hostap mailing list