Commit 0b59f10b authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

staging: vt6656: Fix pairwise key entry save.

The problem is that the group key was saved as VNT_KEY_DEFAULTKEY
was over written by the VNT_KEY_GROUP_ADDRESS index.

mac80211 could not clear the mac_addr in the default key.

The VNT_KEY_DEFAULTKEY is not necesscary so remove it and set as
VNT_KEY_GROUP_ADDRESS.

mac80211 can clear any key using vnt_mac_disable_keyentry.

Fixes: f9ef05ce ("staging: vt6656: Fix pairwise key for non station modes")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/da2f7e7f-1658-1320-6eee-0f55770ca391@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 09057742
...@@ -83,9 +83,6 @@ static int vnt_set_keymode(struct ieee80211_hw *hw, u8 *mac_addr, ...@@ -83,9 +83,6 @@ static int vnt_set_keymode(struct ieee80211_hw *hw, u8 *mac_addr,
case VNT_KEY_PAIRWISE: case VNT_KEY_PAIRWISE:
key_mode |= mode; key_mode |= mode;
key_inx = 4; key_inx = 4;
/* Don't save entry for pairwise key for station mode */
if (priv->op_mode == NL80211_IFTYPE_STATION)
clear_bit(entry, &priv->key_entry_inuse);
break; break;
default: default:
return -EINVAL; return -EINVAL;
...@@ -109,7 +106,6 @@ static int vnt_set_keymode(struct ieee80211_hw *hw, u8 *mac_addr, ...@@ -109,7 +106,6 @@ static int vnt_set_keymode(struct ieee80211_hw *hw, u8 *mac_addr,
int vnt_set_keys(struct ieee80211_hw *hw, struct ieee80211_sta *sta, int vnt_set_keys(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
struct ieee80211_vif *vif, struct ieee80211_key_conf *key) struct ieee80211_vif *vif, struct ieee80211_key_conf *key)
{ {
struct ieee80211_bss_conf *conf = &vif->bss_conf;
struct vnt_private *priv = hw->priv; struct vnt_private *priv = hw->priv;
u8 *mac_addr = NULL; u8 *mac_addr = NULL;
u8 key_dec_mode = 0; u8 key_dec_mode = 0;
...@@ -154,16 +150,12 @@ int vnt_set_keys(struct ieee80211_hw *hw, struct ieee80211_sta *sta, ...@@ -154,16 +150,12 @@ int vnt_set_keys(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) { if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE)
vnt_set_keymode(hw, mac_addr, key, VNT_KEY_PAIRWISE, vnt_set_keymode(hw, mac_addr, key, VNT_KEY_PAIRWISE,
key_dec_mode, true); key_dec_mode, true);
} else { else
vnt_set_keymode(hw, mac_addr, key, VNT_KEY_DEFAULTKEY, vnt_set_keymode(hw, mac_addr, key, VNT_KEY_GROUP_ADDRESS,
key_dec_mode, true); key_dec_mode, true);
vnt_set_keymode(hw, (u8 *)conf->bssid, key,
VNT_KEY_GROUP_ADDRESS, key_dec_mode, true);
}
return 0; return 0;
} }
...@@ -855,8 +855,12 @@ static int vnt_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, ...@@ -855,8 +855,12 @@ static int vnt_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
case SET_KEY: case SET_KEY:
return vnt_set_keys(hw, sta, vif, key); return vnt_set_keys(hw, sta, vif, key);
case DISABLE_KEY: case DISABLE_KEY:
if (test_bit(key->hw_key_idx, &priv->key_entry_inuse)) if (test_bit(key->hw_key_idx, &priv->key_entry_inuse)) {
clear_bit(key->hw_key_idx, &priv->key_entry_inuse); clear_bit(key->hw_key_idx, &priv->key_entry_inuse);
vnt_mac_disable_keyentry(priv, key->hw_key_idx);
}
default: default:
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment