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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap

[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux