From patchwork Tue Nov 8 14:20:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolai Stange X-Patchwork-Id: 17069 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2741464wru; Tue, 8 Nov 2022 06:29:11 -0800 (PST) X-Google-Smtp-Source: AMsMyM5NJ/DyxXfQK+oG5vSVUdjBrnMyDVOQgTp6XsgIdkrqf0sdrWMIQYheiHJKpLYdh0jsv5Il X-Received: by 2002:a17:902:db11:b0:188:515e:81a5 with SMTP id m17-20020a170902db1100b00188515e81a5mr29499830plx.64.1667917750728; Tue, 08 Nov 2022 06:29:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667917750; cv=none; d=google.com; s=arc-20160816; b=OBPZ7ms66ezRjMFS5PwFi5uB9GVi1M8DZfR429jFVarsXTNLsLCv5ntykEVZw2GrBY cqlkoBqU/dBDSmCMuj6Il/I5yVezFxjtA/UTziNbVZd+fRcbONHNAoNyYVCy7JNhTn+d CAM6farz6sL7L+fOe2FtLMMhlI/knGeRbtQqR/FUCFjTyPGAy7Ewsb9yJf0WNsH7BZZJ BWlZEDQwyIYmiB+iRKRGpBTEI628DuV23PWoNU4Tm4TEFyQi3bbfoFRLVavjVYPMbkm5 EheV8mdV8S2l4awMhm8PC8hEMMmduPOb2K+BsAGXqlif7YsMloKmuotcIynzwlh45aPc yhlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=gPSHPQSCdTnJCBZ6fMK+DYGTstwG8CZs+9HEtDCY0L8=; b=W0ZzWXfbCTmTQCYfutrsZJF/BMrwKXk56E5wbasEECeBBA3sFVGFuGiJ+33kdNnujQ hLbzRSz/QFhcno2Ubee87eCJAyO5L5d6s/CQTYYXCHF/3KrdeixsfITFbC12xAFiaaM8 0bWlJ99OJTcgg+hlVjaLbudYl10bz2P2sc9F8gI42Fts04JmZRNRje8uMk9wOtbH2840 0tjyyQiLPuJ1DQ8Y/CypoxHvEWaJrJxsfjpnbtXwkXVZGB9oTpv7KDGPe+v2Ji12nIaP F2WvQP4gF/NZIvGJurJefcwKSrBnqemWfmJX3xgOoNQSQcQWD+Y8en+B1AZaNqCBnAOh 3ktg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="YypPimf/"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=5aQPMVpz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o11-20020a170903210b00b001825b1375ebsi11563987ple.544.2022.11.08.06.28.55; Tue, 08 Nov 2022 06:29:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="YypPimf/"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=5aQPMVpz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235423AbiKHOVU (ORCPT + 99 others); Tue, 8 Nov 2022 09:21:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235389AbiKHOVJ (ORCPT ); Tue, 8 Nov 2022 09:21:09 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B2B8C8A01; Tue, 8 Nov 2022 06:21:01 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 1C51D1FB81; Tue, 8 Nov 2022 14:21:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1667917260; h=from:from:reply-to: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=gPSHPQSCdTnJCBZ6fMK+DYGTstwG8CZs+9HEtDCY0L8=; b=YypPimf/81K/l5dZxvWEYO2mkOFBa0WRCfYZ/QU6VE6lpGMfFOHZy+n/CapWTElDjdU+5l lNJZf4e+lvvJUUbTiw/mqgvT7M5COty8gTohZyVhGVdPKWia/o6kGYhIBLoxFSgOIg7Ndb WGH2TxUDkVLuSsS3z1vO64GOmJrU0M8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1667917260; h=from:from:reply-to: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=gPSHPQSCdTnJCBZ6fMK+DYGTstwG8CZs+9HEtDCY0L8=; b=5aQPMVpzPztkei8q7HJrOpM67zWqRw1fhsour4s/Muw9aep3N9WA+sWMA8N6eB9fxPkp71 yy1WRDdTv8U2e9Dg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 04E4F13398; Tue, 8 Nov 2022 14:21:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id lH4xAcxlamM/KQAAMHmgww (envelope-from ); Tue, 08 Nov 2022 14:21:00 +0000 From: Nicolai Stange To: Herbert Xu , "David S. Miller" Cc: Vladis Dronov , Stephan Mueller , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Nicolai Stange Subject: [PATCH 3/4] crypto: testmgr - disallow plain ghash in FIPS mode Date: Tue, 8 Nov 2022 15:20:24 +0100 Message-Id: <20221108142025.13461-4-nstange@suse.de> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221108142025.13461-1-nstange@suse.de> References: <20221108142025.13461-1-nstange@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748938523047029385?= X-GMAIL-MSGID: =?utf-8?q?1748938523047029385?= ghash may be used only as part of the gcm(aes) construction in FIPS mode. Since commit d6097b8d5d55 ("crypto: api - allow algs only in specific constructions in FIPS mode") there's support for using spawns which by itself are marked as non-approved from approved template instantiations. So simply mark plain ghash as non-approved in testmgr to block any attempts of direct instantiations in FIPS mode. Signed-off-by: Nicolai Stange --- crypto/testmgr.c | 1 - 1 file changed, 1 deletion(-) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 1ffbe3abb84a..6d91a2acd119 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c @@ -5125,7 +5125,6 @@ static const struct alg_test_desc alg_test_descs[] = { }, { .alg = "ghash", .test = alg_test_hash, - .fips_allowed = 1, .suite = { .hash = __VECS(ghash_tv_template) }