From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B834D480968 for ; Thu, 13 Aug 2026 13:50:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786629039; cv=none; b=dyGLJM6h7DH/MGN4XI7DuvNgZilIkvktyC6n7k7yK+5dleeVrWYwY7WDZybroUyqVSIv3vtrZ2Dg68acPLtaJa1sVjHhbdWgFLjbP7EryQvW0bmgeTS6UBvsE0PYyKO84Km2Lmv/IrL1D89gZ8xIAOKBfJArNZA3mDBfX5SX+a0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786629039; c=relaxed/simple; bh=+2zRxSvjAmqwYOE+tKwr1WSnbMWmNOH7W2evqTcz3wE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aGXLn+0Y3a6yT8z2mG8hGGdlGe+V8yWh/uVJgps8TSQ5CMB2wWi6BZGGipu5wr5lO+DFigcwG84PjHjTU8S00Mj0MG9oTVlRigVtiELIBclI34bgp72RcvncthQK68BqIdJTMmTJ1h45yd6ftuexSWaarwPtLc5alHQyFx9Ogog= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=BmJQCi4u; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BmJQCi4u" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786629037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JpTxCCo1JlTQTpMq2MklUewzzbiQjhVKEixoMx1SLYE=; b=BmJQCi4ufR+Od4n43zEQcKleZ5kI3DUIuxyNF0rzJZg2AAp5QVnvIPgzZE9ESfZMOARvwC iubvFve29GnCyyt2BaUs514mPZxUEpTN2czmsuV86dygdpKQx/n6J64yxNjszGFkvFe8CF BwELGU6vDzIBnfbFTZM7oldh2LMXCPo= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-474-ok_ga5V1OjWuAl6pclbzXw-1; Thu, 13 Aug 2026 09:50:32 -0400 X-MC-Unique: ok_ga5V1OjWuAl6pclbzXw-1 X-Mimecast-MFC-AGG-ID: ok_ga5V1OjWuAl6pclbzXw_1786629030 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B6E1B1800846; Thu, 13 Aug 2026 13:50:30 +0000 (UTC) Received: from thuth-p1g4.redhat.corp (headnet03.pony-001.prod.iad2.dc.redhat.com [10.2.32.114]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4D1851800348; Thu, 13 Aug 2026 13:50:28 +0000 (UTC) From: Thomas Huth To: Eric Biggers , "Jason A. Donenfeld" , Ard Biesheuvel Cc: x86@kernel.org, Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/11] lib/crypto: sha1: Use hmac_sha1_zeroize_ctx() instead of memzero_explicit() Date: Thu, 13 Aug 2026 15:49:47 +0200 Message-ID: <20260813134953.979481-10-thuth@redhat.com> In-Reply-To: <20260813134953.979481-1-thuth@redhat.com> References: <20260813134953.979481-1-thuth@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 From: Thomas Huth It's only cosmetics, but since we have the new hmac_sha1_zeroize_ctx() function anyway, we can also use it here. Signed-off-by: Thomas Huth --- lib/crypto/sha1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/crypto/sha1.c b/lib/crypto/sha1.c index b687b89d97cb4..c4361ef77166e 100644 --- a/lib/crypto/sha1.c +++ b/lib/crypto/sha1.c @@ -275,7 +275,7 @@ void hmac_sha1_final(struct hmac_sha1_ctx *ctx, u8 out[SHA1_DIGEST_SIZE]) for (size_t i = 0; i < SHA1_DIGEST_SIZE; i += 4) put_unaligned_be32(ctx->ostate.h[i / 4], out + i); - memzero_explicit(ctx, sizeof(*ctx)); + hmac_sha1_zeroize_ctx(ctx); } EXPORT_SYMBOL_GPL(hmac_sha1_final); -- 2.55.0