From patchwork Wed Nov 6 05:17:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 178598 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp126886ilf; Tue, 5 Nov 2019 21:21:36 -0800 (PST) X-Google-Smtp-Source: APXvYqw25kqpoQpMR5GpFhq0UhsE9dn/M0/6BK9NUDK8rMy+2sj5Jx+kfdtpbISUpmacvZyaxn3P X-Received: by 2002:a17:906:1f57:: with SMTP id d23mr32363353ejk.233.1573017696850; Tue, 05 Nov 2019 21:21:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573017696; cv=none; d=google.com; s=arc-20160816; b=LJDuGDsnS35+ESwUTJ56KCvqJcV2kXdd6R+jJup1RDPDTd4IKNqE5FRGulVCVN/tDv ishLYtXtSuSzQAG0pH/JLMRiGFgb5L1ZIgiKeAh6IZsuwAPpu1LVGdZtRdZYCku6ClaF lOd+bV0uF9iqV19KvevPXlPGReMEkfSXh7z/3+zfY8ZKlrXfAhYCrz9NvP24SCb/G3Un q2IAOFQrAr3G/M6u50nDhgdiLgAGKC4a+Oo9kVNd0BK3qNqeeFjQB3ULveU9DPRaAedI +KFSsuKQhAbcYS/35qHFBpdzrEIziuZ6PER7rI0iNydpdaRNp0IDOISx690L0UF1SWRz gfwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=TAf8PlFcLywmJw4hLg1ThYA7owiCpXA+qvQLTCXa35Q=; b=dIf6TmMqO6qxLe9CjL5W7/+Se4hKeNjBNF7ioKrysxVx8DfdsmDj8fjpw5GBjIf215 JmIYUG5ePA7zNvlXaibcYNBnhtX9NPLAfZa8hqCDccg2PUaxIF+HzyXAhVKMG+mI/dwC 0/bL+bFIYJCJCi5AHZUjEl3zLzFs5/a9lC7uTxN46bvJ0JL50RRnUbcNKlEdaAGFt6vR Tpzm72p2SI5UxQyzdHMNUYd4pmTCmQ1Z5UQnLkE9i3ZGp7R3uDxNFy38AOBqFSMSTlxd MfTebF61H2To9iYE3Y3oOy/foRVmXoMXqfztQetJsGh1tjjsxkt4+jSxvqpQNfga5K82 TsKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id x51si12648941edd.393.2019.11.05.21.21.36; Tue, 05 Nov 2019 21:21:36 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1CC711BFCA; Wed, 6 Nov 2019 06:20:54 +0100 (CET) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 094AD1BF7A for ; Wed, 6 Nov 2019 06:20:43 +0100 (CET) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id D740C1A010F; Wed, 6 Nov 2019 06:20:42 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 747011A0726; Wed, 6 Nov 2019 06:20:41 +0100 (CET) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 27BD8402DF; Wed, 6 Nov 2019 13:20:39 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: akhil.goyal@nxp.com Date: Wed, 6 Nov 2019 10:47:27 +0530 Message-Id: <20191106051731.3625-9-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106051731.3625-1-hemant.agrawal@nxp.com> References: <20191101175141.4663-1-hemant.agrawal@nxp.com> <20191106051731.3625-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v3 09/13] crypto/dpaa2_sec: enable warning with truncated sha256 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch throw the warning when using truncted digest len for SHA256 case. Signed-off-by: Hemant Agrawal --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 4 ++++ drivers/crypto/dpaa_sec/dpaa_sec.c | 4 ++++ 2 files changed, 8 insertions(+) -- 2.17.1 diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 173ec8095..668832f16 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -2657,6 +2657,10 @@ dpaa2_sec_ipsec_proto_init(struct rte_crypto_cipher_xform *cipher_xform, case RTE_CRYPTO_AUTH_SHA256_HMAC: authdata->algtype = OP_PCL_IPSEC_HMAC_SHA2_256_128; authdata->algmode = OP_ALG_AAI_HMAC; + if (session->digest_length != 16) + DPAA2_SEC_WARN( + "+++Using sha256-hmac truncated len is non-standard," + "it will not work with lookaside proto"); break; case RTE_CRYPTO_AUTH_SHA384_HMAC: authdata->algtype = OP_PCL_IPSEC_HMAC_SHA2_384_192; diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 27a31d065..e729ed7db 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -2645,6 +2645,10 @@ dpaa_sec_ipsec_proto_init(struct rte_crypto_cipher_xform *cipher_xform, case RTE_CRYPTO_AUTH_SHA256_HMAC: session->auth_key.alg = OP_PCL_IPSEC_HMAC_SHA2_256_128; session->auth_key.algmode = OP_ALG_AAI_HMAC; + if (session->digest_length != 16) + DPAA_SEC_WARN( + "+++Using sha256-hmac truncated len is non-standard," + "it will not work with lookaside proto"); break; case RTE_CRYPTO_AUTH_SHA384_HMAC: session->auth_key.alg = OP_PCL_IPSEC_HMAC_SHA2_384_192;