From patchwork Thu Mar 31 09:32:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "De Lara Guarch, Pablo" X-Patchwork-Id: 11843 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id DF1A96944; Thu, 31 Mar 2016 11:32:17 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id A5080689E for ; Thu, 31 Mar 2016 11:32:12 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP; 31 Mar 2016 02:32:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,421,1455004800"; d="scan'208";a="922460806" Received: from sie-lab-214-036.ir.intel.com (HELO sie-lab-214-36.ir.intel.com) ([10.237.214.36]) by orsmga001.jf.intel.com with ESMTP; 31 Mar 2016 02:32:10 -0700 From: Pablo de Lara To: dev@dpdk.org Cc: declan.doherty@intel.com, Pablo de Lara Date: Thu, 31 Mar 2016 10:32:10 +0100 Message-Id: <1459416734-54479-5-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1459416734-54479-1-git-send-email-pablo.de.lara.guarch@intel.com> References: <1459414919-44829-1-git-send-email-pablo.de.lara.guarch@intel.com> <1459416734-54479-1-git-send-email-pablo.de.lara.guarch@intel.com> Subject: [dpdk-dev] [PATCH v3 4/8] l2fwd-crypto: fix length of random IV/AAD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" App was generating a random IV/AAD of only 4 bytes, instead of the actual length, since it was using sizeof(length). Fixes: 27cf2d1b18e1 ("examples/l2fwd-crypto: discover capabilities") Signed-off-by: Pablo de Lara --- examples/l2fwd-crypto/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index 1b0c229..c323b55 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -643,7 +643,7 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options) port_cparams[i].aad.phys_addr = options->aad.phys_addr; if (!options->aad_param) generate_random_key(port_cparams[i].aad.data, - sizeof(port_cparams[i].aad.length)); + port_cparams[i].aad.length); } @@ -661,7 +661,7 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options) port_cparams[i].iv.phys_addr = options->iv.phys_addr; if (!options->iv_param) generate_random_key(port_cparams[i].iv.data, - sizeof(port_cparams[i].iv.length)); + port_cparams[i].iv.length); port_cparams[i].cipher_algo = options->cipher_xform.cipher.algo; }