Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3188155ybd; Fri, 28 Jun 2019 04:27:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzP/B7ybi6ifMOwV9ja6zdc9ly/Qdc88u0+FJEmMiqIM0098w6GYuf169P8SUrQj5Tamp2M X-Received: by 2002:a17:902:100a:: with SMTP id b10mr10778703pla.338.1561721279207; Fri, 28 Jun 2019 04:27:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561721279; cv=none; d=google.com; s=arc-20160816; b=JyXL5pCNuYWg4RB91yj0tRJ0cviWWt5Hk2eE2w4SQR48Qfv1dhljqGCtcAe5NkU367 +fSheaWuU6EUe7piy36yCB5fpc5ssLbgMoggGNUtXS44OeeTOiiG4RHGBvSnhGyuVslx t9I+xUGpjqjqEfivoKJ/svjxDKhx4Q1Y7NGp8ZRZqpU+FOBhGjCVHw4HxTknY2d4tPn7 dZxw7pQTrAlDypDZWbABI/8muNOxvMTstMYOfjKQVN9ePAwCVtLQm/ugn10FbrD6bwMd tgdASZR8N7GVUtOMKp1WDoJDsDksu3N8jflR1gywdi9U384135cNtwVSrem2vBBSkPFQ DpFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=RJqJPwy5FupsECpRr76jUlzOG75dPg4XX7HjL42ex0k=; b=pombdbsO4XzlHWLx8qXfE4LQdVn1FKs40LbhcwWhJltEeNB30oIRgNjYXk4QLG8zlL BsQjBFOuDzu5EoTvnaodqwD2F2Pr3Linh+RHnUyoDYoO7ChVidNlsydCxFOiHdyAKnA/ 9uRN30LdzH8qf42tloo+RzJQBo1fM7H6+0pnVhqbMLPCE734EU11zz6bpyE4FmjfNQr3 mkNjaUOqqbxpJDJJO1TUot6rWInHPUTLP5KPYwQGf/VqALToJF7ECV9Aa2aTMvnu4CuW ynZRtEzgxyVpKzefsABwIbY8om7C8Y/6DlHx5fPUaC+yFQmFRPvHnNcXvukV2UXlHB2d u9fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="EgHHT5K/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t25si1801947pgk.442.2019.06.28.04.27.43; Fri, 28 Jun 2019 04:27:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="EgHHT5K/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726901AbfF1L1c (ORCPT + 99 others); Fri, 28 Jun 2019 07:27:32 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:1936 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726689AbfF1L11 (ORCPT ); Fri, 28 Jun 2019 07:27:27 -0400 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5SBQSqA008465; Fri, 28 Jun 2019 13:27:15 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=RJqJPwy5FupsECpRr76jUlzOG75dPg4XX7HjL42ex0k=; b=EgHHT5K/GSk9XVoJ/wp0aAS6Xf34yhcc2+z0AIY/CmSxGke0kAUgtHmn+fh2J8QK1rNO /M+b6oflRD0jc/AiMaMdqUewvZcDzzEvY0tiCs/mDteM2ga/ul4tq3bU+lVWKGRpGfcS RUs1VzHcPVH4AzWmeFRyqm+Z7yxPcQxBeCOPl838zckkzU2ktAdduhRTaMX+KYtiOROW of5YZw6mO8DwNYWCmhlK3uR0Ny0jFwDhnf4/Ml1qnt8ffGH/RTgCiTyc/tw/G5Syx7t7 KN/SStbES5BP8Mxktg5Sln0KYBVkj9QPhF2HwGK/DnNtTGifbREnRIhL71+SoobJ5RKW 3A== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2t9d2gwgny-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 28 Jun 2019 13:27:14 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 6F76731; Fri, 28 Jun 2019 11:27:14 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4E66127A5; Fri, 28 Jun 2019 11:27:14 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 28 Jun 2019 13:27:14 +0200 Received: from localhost (10.201.23.65) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 28 Jun 2019 13:27:13 +0200 From: Lionel Debieve To: Herbert Xu , "David S . Miller" , Maxime Coquelin , "Alexandre Torgue" , , , CC: Benjamin Gaignard , Fabien Dessenne , Ludovic Barre , Subject: [PATCH 1/2] crypto: stm32/hash: Fix hmac issue more than 256 bytes Date: Fri, 28 Jun 2019 13:26:54 +0200 Message-ID: <20190628112655.9341-2-lionel.debieve@st.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190628112655.9341-1-lionel.debieve@st.com> References: <20190628112655.9341-1-lionel.debieve@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.201.23.65] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-28_04:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Correct condition for the second hmac loop. Key must be only set in the first loop. Initial condition was wrong, HMAC_KEY flag was not properly checked. Signed-off-by: Lionel Debieve --- drivers/crypto/stm32/stm32-hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32/stm32-hash.c index 29519d1c403f..c37d1a336f98 100644 --- a/drivers/crypto/stm32/stm32-hash.c +++ b/drivers/crypto/stm32/stm32-hash.c @@ -349,7 +349,7 @@ static int stm32_hash_xmit_cpu(struct stm32_hash_dev *hdev, return -ETIMEDOUT; if ((hdev->flags & HASH_FLAGS_HMAC) && - (hdev->flags & ~HASH_FLAGS_HMAC_KEY)) { + (!(hdev->flags & HASH_FLAGS_HMAC_KEY))) { hdev->flags |= HASH_FLAGS_HMAC_KEY; stm32_hash_write_key(hdev); if (stm32_hash_wait_busy(hdev)) -- 2.17.1