From patchwork Fri Nov 1 17:51:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 178328 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp824391ill; Fri, 1 Nov 2019 10:56:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCdyQCd7ja3l+vYz/+rwD+7T/WIznubhwGjCERjLYiLLmK1zJpoD8/ddD9zDJ/Ca9vo5RD X-Received: by 2002:aa7:d582:: with SMTP id r2mr14484369edq.193.1572630960940; Fri, 01 Nov 2019 10:56:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572630960; cv=none; d=google.com; s=arc-20160816; b=gngm9EXdbbcG5JfmG7qVxGm5u6GTDnb2PA6QQfhx2kR/gJ6R1+ZiEDGmXQX+FHOSFk YW+uIfC9RGi2DqZVWXoiHgt+W4LCUDU6RwKAs0RmC/ts5LSkVgZ5OhXpGR6WKz/gd/kZ ImwmTFMWTQfDAo0HjWksX6PSotsSX1vOf9AFKz/P0dIHdJ4XY+Csd6zBx6yHxWV8M6GS b1FJ9lCqCUXYXWt1KRNR4I5h7Sdn9eEYUhlHfNooOxvxU6nX/auzctyokliA3ht/4QXl crp541/cZ2l2KVyjATfJ7dGDuxry/H9TUoLJiQmg6x2nRa9uekf0LhJADtHVdr38ShE3 64Qw== 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:to:from; bh=juX8vz1Bb2bYHaJNi3nL1REYauuND+GKqQ0pifCyQ5A=; b=IP6QZCdlk2+JM59H0bixxyzhXDPHLearkDG6wpmTnzkkG0ocBZ0Kt5oxuJF5te1DeB 63L9nYA18jFQtkvSAbu0HA8zMGaMW75rp5eA94xi+Ei6p22UwfxqgOgdlOgoMG0p7fBE C6ZaHqEv2a4JqUhu5OVwH5vL+wP/r4di7mOI23ahFpW6DLZRUDfIuGMRT5tmMpspZ/v4 tkSOKkzM+VfV/1/PGYKeWlckkmRE1BPUHmv5t/qBlyW4qYEFqwz66sz2QP5rGWZ506TV 1DKjSK2VNZoTtrsvhldJCjo3l7NY0phuNpJW8sM4QBEQlBoaBnPBlIIzU62Q5JfwhcUN 5BrQ== 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 j15si6550242ejc.369.2019.11.01.10.56.00; Fri, 01 Nov 2019 10:56:00 -0700 (PDT) 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 85F7C1E8C5; Fri, 1 Nov 2019 18:55:02 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id B6FB21E869 for ; Fri, 1 Nov 2019 18:54:50 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 9A8342001BF; Fri, 1 Nov 2019 18:54:50 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 36DE4200133; Fri, 1 Nov 2019 18:54:49 +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 CB2B9402FC; Sat, 2 Nov 2019 01:54:46 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, akhil.goyal@nxp.com Date: Fri, 1 Nov 2019 23:21:37 +0530 Message-Id: <20191101175141.4663-9-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191101175141.4663-1-hemant.agrawal@nxp.com> References: <20191025083336.24212-1-hemant.agrawal@nxp.com> <20191101175141.4663-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 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 c6b6444aa..32e6c71a9 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -2660,6 +2660,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 24a5a7239..aec5af1c5 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -2667,6 +2667,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;