From patchwork Fri Jun 23 08:22:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raveendra Padasalagi X-Patchwork-Id: 9805913 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0567860349 for ; Fri, 23 Jun 2017 08:24:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ECEA7286CB for ; Fri, 23 Jun 2017 08:24:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF461286EC; Fri, 23 Jun 2017 08:24:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 876EF286CB for ; Fri, 23 Jun 2017 08:24:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753519AbdFWIWo (ORCPT ); Fri, 23 Jun 2017 04:22:44 -0400 Received: from mail-wr0-f181.google.com ([209.85.128.181]:35205 "EHLO mail-wr0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753889AbdFWIWk (ORCPT ); Fri, 23 Jun 2017 04:22:40 -0400 Received: by mail-wr0-f181.google.com with SMTP id k67so55007385wrc.2 for ; Fri, 23 Jun 2017 01:22:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=J8RSUD0S1G28rRqL0IRHxYrqMeNlYquomh2yHxRPS9E=; b=dLqMLz1lqoTrW76cgLtqruHCRvGuFtmszBmm8w0e436PnlwbjxiKIb23ut+HjLfnm4 1C1SMB9zZmIIJf1aG5HQKEt0ROicWC8SIa5D9LAgAkB3VIMBEyg9NCIaj5AvpEN+c6tg Vz9A7FrRqIeOvljc4q4re7T1SGBDg/ZH7+MMs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=J8RSUD0S1G28rRqL0IRHxYrqMeNlYquomh2yHxRPS9E=; b=OClUwmxx5nIyzJRImUi5zQ0MaVoL9OWGdCJ0lxuwdcGQ5xaSxktBHFY5jNPH9hupFv N7qvL7vu8Pjs8X40xp889xyqeRAklhv8KBgPe36pY1taT4e/TS+COHnGlt2vv5Buo0xO FAzqyb6b9AGHzlKE3+C6Mn599JYWIWa0hzE2AiOG8b5Q00ZGiAqg46lg7WX+ZS3Dahty KvezMcuC1UEB1fkkjtUwj+t9NnFV8I6NPxqIpgvnaqOqu3i4QNu7Y97YyNbyg7pSUwHo 5JtZvmQGsNPuCGfNl7sgL7Pg9nDXUSI5Fe52P8S9JPI2n+fsIh36jARRWOe/IiRF4W7u Fl9A== X-Gm-Message-State: AKS2vOwX+y3GPa5JyF/JRYi4xkiUyvmDyNRi+vzW+pJlFsHCe3t50FtL 1a3osGOodwXqWkAu X-Received: by 10.223.163.197 with SMTP id m5mr4801947wrb.128.1498206159218; Fri, 23 Jun 2017 01:22:39 -0700 (PDT) Received: from rpadasal-OptiPlex-7010.dhcp.avagotech.net ([192.19.237.250]) by smtp.gmail.com with ESMTPSA id j196sm1593681wmd.32.2017.06.23.01.22.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 Jun 2017 01:22:28 -0700 (PDT) From: Raveendra Padasalagi To: Herbert Xu , "David S. Miller" , Rob Rice , Scott Branden , Ray Jui , Steve Lin , linux-crypto@vger.kernel.org Cc: bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, Raveendra Padasalagi Subject: [PATCH] crypto: brcm - software fallback for cryptlen zero Date: Fri, 23 Jun 2017 13:52:10 +0530 Message-Id: <1498206130-15188-1-git-send-email-raveendra.padasalagi@broadcom.com> X-Mailer: git-send-email 1.9.1 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Zero length payload requests are not handled in Broadcom SPU2 engine, so this patch adds conditional check to fallback to software implementation for AES-GCM and AES-CCM algorithms. Signed-off-by: Raveendra Padasalagi Reviewed-by: Ray Jui Reviewed-by: Scott Branden --- drivers/crypto/bcm/cipher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/bcm/cipher.c b/drivers/crypto/bcm/cipher.c index cc0d5b9..6c80863 100644 --- a/drivers/crypto/bcm/cipher.c +++ b/drivers/crypto/bcm/cipher.c @@ -2625,7 +2625,7 @@ static int aead_need_fallback(struct aead_request *req) */ if (((ctx->cipher.mode == CIPHER_MODE_GCM) || (ctx->cipher.mode == CIPHER_MODE_CCM)) && - (req->assoclen == 0)) { + ((req->assoclen == 0) || (req->cryptlen == 0))) { if ((rctx->is_encrypt && (req->cryptlen == 0)) || (!rctx->is_encrypt && (req->cryptlen == ctx->digestsize))) { flow_log("AES GCM/CCM needs fallback for 0 len req\n");