Search Linux Wireless

Re: [RFC PATCH 1/1] iw: add support for retrieving keys

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

 



On Mon, 2022-08-22 at 09:43 +0200, Raphaël Mélotte wrote:
> For debugging purposes, it can be useful to be able to retrieve keys.
> 
> Add a "iw get key" command, to be able to retrieve keys when the key
> index is known.
> 
> Example retrieving a pairwise key:
> iw dev wlan0 get key 0 02:02:03:04:05:06
> 
> Example retrieving a group key:
> iw dev wlan0 get key 1

The examples don't seem to match the docs:

> +COMMAND(get, key, "",
> +	NL80211_CMD_GET_KEY, 0, CIB_NETDEV, handle_get_key,
> +	"<key index> <MAC address> <pairwise>\n");

and maybe you should switch pairwise/mac addr since it's not required
for pairwise == false I guess? or maybe let you specify the key type
instead, so you can retrieve other kinds of keys?


> +	if (argc) {
> +		if (mac_addr_a2n(mac, argv[0]) == 0) {
> +			NLA_PUT(msg, NL80211_ATTR_MAC, 6, mac);
> +			argv++;
> +			argc--;
> +			nla_put_u32(msg, NL80211_ATTR_KEY_TYPE,
> NL80211_KEYTYPE_PAIRWISE);
> +		}

and this seems like it could have some error return in the else or
something?


Otherwise seems fine to me, any particular reason you sent it as RFC?

johannes




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux