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