From patchwork Tue Nov 8 14:20:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolai Stange X-Patchwork-Id: 17059 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2740699wru; Tue, 8 Nov 2022 06:27:56 -0800 (PST) X-Google-Smtp-Source: AMsMyM7VTtA6Cm15ppCLMMxbuExHoX7rTldpObPWhLX9B/UEw45jfy6P5V75yVz4mRnYdbasc8+R X-Received: by 2002:a17:902:c944:b0:186:a7d7:c3b with SMTP id i4-20020a170902c94400b00186a7d70c3bmr56581654pla.55.1667917675944; Tue, 08 Nov 2022 06:27:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667917675; cv=none; d=google.com; s=arc-20160816; b=Hls/KyZJbXgNtbT99JNfMuzq8GZZjjHycIzpQ9uEybexPsXTG1tWCmV7b+52MqSswq VXKcOXVyPyTqhnk1TEMAc0OxGgA4kzDorFBySG2qSA+q8eTIqqGuS9Uw0vDB0ia0Lgmb tRRKXVGTI/kBXIiDEf/8d7YqTC0DvNJH78zmyKjxNlyQNv9IgQ6rleegnQa7/EYH2JAV ZdOxh4EviuNFFKhh0kJpi8KL/f3tDZAcYrkYtkQ+AJsbcVfVwckS0XQE+VARWXjbt9fg pyBfIQ4LHR83pefkvW54lIKfmlntETEhUZglg++akI967P5cW204OPWAQ22dGI0aBJnt LyaA== 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=t9ib9ZQ/+innM0aD2x69ESuXh3a/zTGWSIsXZMke6AU=; b=E27LbD1egx3K15R0M3vchl8bajc+dwrF501LJbOspwW+bBl3AREc7Zm0QeSazUt6O1 xLnB0jdCP4bBR2xoyLjmyiEzwItTU1vnMQASl1x23lG/+E5p92uocq9WmC2L1TfLHDTI skSd5HGUtDNStuVWl5VLXo7frtZdIIJCE1MRfgMy7+TRl4Mdge4AMipt3/VnF74NI1+p L6ZfUOj7+gsDt6xlhk6F4Wfo6H4rv98gC47SKyCmjM+2Ql5Sgr+4OFfQouRlT15DXv8Y dD0e+thBiXGSB3dZ4AYmpnz1nOyZyuHDDB904b2PAbwkwhflFhlk9+MDB7bKNGJtPziA RrJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=HnS57Cld; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=TFhOTSr9; 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 s19-20020a17090ad49300b00200919a55b1si16458000pju.180.2022.11.08.06.27.36; Tue, 08 Nov 2022 06:27:55 -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=HnS57Cld; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=TFhOTSr9; 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 S234573AbiKHOVA (ORCPT + 99 others); Tue, 8 Nov 2022 09:21:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234350AbiKHOUv (ORCPT ); Tue, 8 Nov 2022 09:20:51 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59A3D862D6; Tue, 8 Nov 2022 06:20:50 -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-out1.suse.de (Postfix) with ESMTPS id 14D9C22AA8; Tue, 8 Nov 2022 14:20:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1667917249; 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=t9ib9ZQ/+innM0aD2x69ESuXh3a/zTGWSIsXZMke6AU=; b=HnS57CldwjnrLHR6RJs1lxMqU/5R71SJ9Pf10dqy6lRxWNuxHDNQsmghv4ua3OmXGGo9UF FZ48pQokWhWUzO+hSYa2Vq08OYK8Sqs3wwp+QYs6ADO0Tz7bx51vS3nx1M6U6rARSaaWHU YRSltZiUOoYd2Pk3UXk9Y6i/XlSbWh8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1667917249; 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=t9ib9ZQ/+innM0aD2x69ESuXh3a/zTGWSIsXZMke6AU=; b=TFhOTSr9M9P5QaV8wXtBTQB3imVXYwPUv290JXdVOm5sat3zThaV2EtLf/AzgwyDACYsze zvRu1ujw/ilUhMAw== 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 04D3413398; Tue, 8 Nov 2022 14:20:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id a3S5AMFlamMVKQAAMHmgww (envelope-from ); Tue, 08 Nov 2022 14:20:49 +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 2/4] crypto: testmgr - disallow plain cbcmac(aes) in FIPS mode Date: Tue, 8 Nov 2022 15:20:23 +0100 Message-Id: <20221108142025.13461-3-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?1748938444974850512?= X-GMAIL-MSGID: =?utf-8?q?1748938444974850512?= cbcmac(aes) may be used only as part of the ccm(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 cbcmac(aes) 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 e2806ef044fd..1ffbe3abb84a 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c @@ -4501,7 +4501,6 @@ static const struct alg_test_desc alg_test_descs[] = { }, { #endif .alg = "cbcmac(aes)", - .fips_allowed = 1, .test = alg_test_hash, .suite = { .hash = __VECS(aes_cbcmac_tv_template)