summaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2015-03-23 14:41:15 +0100
committerJohannes Berg <johannes.berg@intel.com>2015-03-30 10:38:07 +0200
commit82ca6ef686f0fcefe2c1ad4ab74d5caf41be03a9 (patch)
treef7cc1b260e63480f112995be1cac149ba868dec0 /net/mac80211
parentcfg80211: pass name_assign_type to rdev_add_virtual_intf() (diff)
downloadlinux-82ca6ef686f0fcefe2c1ad4ab74d5caf41be03a9.tar.xz
linux-82ca6ef686f0fcefe2c1ad4ab74d5caf41be03a9.zip
mac80211: Fix misplaced return in AES-GMAC key setup
Commit 8ade538bf39b ("mac80111: Add BIP-GMAC-128 and BIP-GMAC-256 ciphers") had the success return in incorrect place before the crypto_aead_setauthsize() call which practically ended up skipping that call unconditionally. The missing call did not actually change any functionality since GMAC_MIC_LEN (16) is identical to the maxauthsize in gcm(aes) and as such, the default value used for the authsize parameter. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/aes_gmac.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mac80211/aes_gmac.c b/net/mac80211/aes_gmac.c
index 1c72edcb0083..f1321b7d6506 100644
--- a/net/mac80211/aes_gmac.c
+++ b/net/mac80211/aes_gmac.c
@@ -70,9 +70,9 @@ struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[],
err = crypto_aead_setkey(tfm, key, key_len);
if (!err)
- return tfm;
- if (!err)
err = crypto_aead_setauthsize(tfm, GMAC_MIC_LEN);
+ if (!err)
+ return tfm;
crypto_free_aead(tfm);
return ERR_PTR(err);