From patchwork Tue Nov 6 08:28:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raveendra Padasalagi X-Patchwork-Id: 10669905 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-2.web.codeaurora.org (Postfix) with ESMTP id 1BAFE15A6 for ; Tue, 6 Nov 2018 08:29:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E2E62A211 for ; Tue, 6 Nov 2018 08:29:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0239E2A217; Tue, 6 Nov 2018 08:29:18 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham 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 A94182A211 for ; Tue, 6 Nov 2018 08:29:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728133AbeKFRxV (ORCPT ); Tue, 6 Nov 2018 12:53:21 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:38311 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387401AbeKFRxQ (ORCPT ); Tue, 6 Nov 2018 12:53:16 -0500 Received: by mail-pf1-f193.google.com with SMTP id b11-v6so5763138pfi.5 for ; Tue, 06 Nov 2018 00:29:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=XRirKOLagPIVrlyYmzESmAHM53TbQ1gxtghv7KZj5gQ=; b=Xk0QhRfXxpi+JgkX9EKyDt11ObFY+dGDv4hTQNQjNX8SQJK3q+66KhEredm8ANIu/3 4QY8OrP+ZgICAWDGQ+8Cdi6k2EsBgfRFqjv/x8uBFmvi56nRDuwqrd8uujcJxq9Dv/Jx Md4pwzLabuDgWLpOl0ckbfGoLXA/8HXhOAdGo= 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=XRirKOLagPIVrlyYmzESmAHM53TbQ1gxtghv7KZj5gQ=; b=VcAgSfLMJ8AF5917+1PuOu0BWiGmgAeKWaESMDwgqMl/QadZsvhUyNbI4oImpbEaZv PjwRGThX5TKNqNmG2VkK6fN24QBFZvIJdQmCIpaUGFdHpulwbZdDlgEAkRNrwKABNDIl DsNKQTRXdyACMXyLwdQAOjB2Qh6Mf1wzMfh6p2xaLqpZ6iLc/nA2MBBA9nq1i7swiYIo k48IUNhB3MUCG2+J+y6aF/l7pJmrTwDoOWCIobjdqFb6TyH6nBSrsRiHDOCDxrHrVYH8 kEnA4zhpb31Q0qH1SIYOUoBarsAdw9FAdSZGK6omhP3lH2jOsWS4Pqi6qJbfnyQuBQTz 74/g== X-Gm-Message-State: AGRZ1gI6PZF0V1Q0w/gZ3hrKpiBeYNnPYUvcTRVf1nlmmgUD59wY5G07 XXHqZbQq5WUYcr3e8/O/ij1+8A== X-Google-Smtp-Source: AJdET5cn/69AUgpGpJ/3Dzam2Rk9L3wrGMXzj90O5zPNHtExlnLtr6E4bZbap6u/1MUh20jRfIMoEw== X-Received: by 2002:a63:1f4e:: with SMTP id q14mr5787453pgm.88.1541492951272; Tue, 06 Nov 2018 00:29:11 -0800 (PST) Received: from rpadasal-OptiPlex-7010.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id u5-v6sm35583131pgk.46.2018.11.06.00.29.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Nov 2018 00:29:10 -0800 (PST) From: Raveendra Padasalagi To: Herbert Xu , "David S. Miller" , Eric Biggers , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Agner Cc: bcm-kernel-feedback-list@broadcom.com, Raveendra Padasalagi Subject: [PATCH] crypto: bcm: fix normal/non key hash algorithm failure Date: Tue, 6 Nov 2018 13:58:58 +0530 Message-Id: <1541492938-29261-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 Remove setkey() callback handler for normal/non key hash algorithms and keep it for AES-CBC/CMAC which needs key. Signed-off-by: Raveendra Padasalagi --- drivers/crypto/bcm/cipher.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/bcm/cipher.c b/drivers/crypto/bcm/cipher.c index 2d1f1db..4d67e22 100644 --- a/drivers/crypto/bcm/cipher.c +++ b/drivers/crypto/bcm/cipher.c @@ -4652,12 +4652,16 @@ static int spu_register_ahash(struct iproc_alg_s *driver_alg) hash->halg.statesize = sizeof(struct spu_hash_export_s); if (driver_alg->auth_info.mode != HASH_MODE_HMAC) { - hash->setkey = ahash_setkey; hash->init = ahash_init; hash->update = ahash_update; hash->final = ahash_final; hash->finup = ahash_finup; hash->digest = ahash_digest; + if ((driver_alg->auth_info.alg == HASH_ALG_AES) && + ((driver_alg->auth_info.mode == HASH_MODE_XCBC) || + (driver_alg->auth_info.mode == HASH_MODE_CMAC))) { + hash->setkey = ahash_setkey; + } } else { hash->setkey = ahash_hmac_setkey; hash->init = ahash_hmac_init;