From patchwork Fri May 22 08:05:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herbert Xu X-Patchwork-Id: 6461721 Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E64A9C0020 for ; Fri, 22 May 2015 08:05:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1787A2024C for ; Fri, 22 May 2015 08:05:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EBED120165 for ; Fri, 22 May 2015 08:05:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756566AbbEVIFs (ORCPT ); Fri, 22 May 2015 04:05:48 -0400 Received: from helcar.hengli.com.au ([209.40.204.226]:33047 "EHLO helcar.hengli.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755960AbbEVIFo (ORCPT ); Fri, 22 May 2015 04:05:44 -0400 Received: from gondolin.me.apana.org.au ([192.168.0.6]) by norbury.hengli.com.au with esmtp (Exim 4.80 #3 (Debian)) id 1Yvhxd-0000cB-1W; Fri, 22 May 2015 18:05:41 +1000 Received: from herbert by gondolin.me.apana.org.au with local (Exim 4.80) (envelope-from ) id 1Yvhxb-0000rO-HH; Fri, 22 May 2015 16:05:39 +0800 Date: Fri, 22 May 2015 16:05:39 +0800 From: Herbert Xu To: Johannes Berg Cc: Linux Crypto Mailing List , netdev@vger.kernel.org, "David S. Miller" , Marcel Holtmann , Steffen Klassert Subject: Re: [PATCH 7/7] mac80211: Switch to new AEAD interface Message-ID: <20150522080539.GA3194@gondor.apana.org.au> References: <20150521103938.GA23035@gondor.apana.org.au> <1432279948.3493.2.camel@sipsolutions.net> <20150522074126.GA2921@gondor.apana.org.au> <1432280608.3493.4.camel@sipsolutions.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1432280608.3493.4.camel@sipsolutions.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, May 22, 2015 at 09:43:28AM +0200, Johannes Berg wrote: > > Oops, sorry, of course - I was running in a VM :) Thanks! Does this patch on top help? diff --git a/net/mac80211/aes_gmac.c b/net/mac80211/aes_gmac.c index 7eee32b..133be53 100644 --- a/net/mac80211/aes_gmac.c +++ b/net/mac80211/aes_gmac.c @@ -24,22 +24,24 @@ int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, const u8 *data, size_t data_len, u8 *mic) { - struct scatterlist sg[3]; + struct scatterlist sg[4]; char aead_req_data[sizeof(struct aead_request) + crypto_aead_reqsize(tfm)] __aligned(__alignof__(struct aead_request)); struct aead_request *aead_req = (void *)aead_req_data; - u8 iv[AES_BLOCK_SIZE]; + u8 zero[GMAC_MIC_LEN], iv[AES_BLOCK_SIZE]; if (data_len < GMAC_MIC_LEN) return -EINVAL; memset(aead_req, 0, sizeof(aead_req_data)); - sg_init_table(sg, 3); + memset(zero, 0, GMAC_MIC_LEN); + sg_init_table(sg, 4); sg_set_buf(&sg[0], aad, AAD_LEN); sg_set_buf(&sg[1], data, data_len - GMAC_MIC_LEN); - sg_set_buf(&sg[2], mic, GMAC_MIC_LEN); + sg_set_buf(&sg[2], zero, GMAC_MIC_LEN); + sg_set_buf(&sg[3], mic, GMAC_MIC_LEN); memcpy(iv, nonce, GMAC_NONCE_LEN); memset(iv + GMAC_NONCE_LEN, 0, sizeof(iv) - GMAC_NONCE_LEN);