From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id AD33798 for ; Mon, 16 Jul 2018 16:31:49 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jul 2018 07:31:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,361,1526367600"; d="scan'208";a="72742873" Received: from silpixa00399466.ir.intel.com (HELO silpixa00399466.ger.corp.intel.com) ([10.237.223.220]) by fmsmga001.fm.intel.com with ESMTP; 16 Jul 2018 07:31:30 -0700 From: Pablo de Lara To: ankur.dwivedi@cavium.com, declan.doherty@intel.com Cc: Pablo de Lara , stable@dpdk.org Date: Mon, 16 Jul 2018 07:25:51 +0100 Message-Id: <20180716062551.29742-1-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.14.4 Subject: [dpdk-stable] [PATCH] examples/l2fwd-crypto: fix digest with AEAD algorithms X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2018 14:31:50 -0000 When performing authentication verification (both for AEAD algorithms, such as AES-GCM, or for authentication algorithms, such as SHA1-HMAC), the digest address is calculated based on the packet size and the algorithm used (substracting digest size and IP header to the packet size). However, for AEAD algorithms, this was not calculated correctly, since the digest size was not being substracted. Bugzilla ID: 44 Fixes: 2661f4fbe93d ("examples/l2fwd-crypto: add AEAD parameters") Cc: stable@dpdk.org Reported-by: Ankur Dwivedi Signed-off-by: Pablo de Lara --- examples/l2fwd-crypto/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index 9d6bb7857..9ac06a697 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -408,7 +408,7 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m, /* Zero pad data to be crypto'd so it is block aligned */ data_len = rte_pktmbuf_data_len(m) - ipdata_offset; - if (cparams->do_hash && cparams->hash_verify) + if ((cparams->do_hash || cparams->do_aead) && cparams->hash_verify) data_len -= cparams->digest_length; if (cparams->do_cipher) { -- 2.14.4