From patchwork Wed Dec 21 22:41:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladis Dronov X-Patchwork-Id: 35558 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp28238wrn; Wed, 21 Dec 2022 15:07:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXtxxkIO3ZUYpe19/bmspliXQUeusO0wNxM9i1jRQI8dQHeAYnnQ2X0sYyUUS6P2ORmLoM+h X-Received: by 2002:a17:902:8688:b0:189:e7ea:9ff9 with SMTP id g8-20020a170902868800b00189e7ea9ff9mr3740248plo.42.1671664069121; Wed, 21 Dec 2022 15:07:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671664069; cv=none; d=google.com; s=arc-20160816; b=hD8UAQLG0UPyh8WKSTsnP6THY/2k9lkQRcKm9G/WvOxUdKFwy1YgAymImyR6Lv0pSS btic3TQaUUMgsG9wEttpQw2/45Te7poy/LONuN+Na4Fb4Z1REiI1kFVoKxGiVwSIDfsz tMN8sXfxnZqBWxjmOc5blXiPv0okUmw2UCLaQb4bVR1XxG6D0CjN2MND520gz9myoQog QoFwFFlR0XFz7XJZ4XmfTbSEvLBvn1FgRgTb964dguEfMmKQUCmo7p4D9LBuHVXdoABT a8N5H9S9JvJpxXBovz/gh6lgjbX5ixmOGmeofPoDZcfO8pT/rgnpPIK+1e3QGHv3sTXv mOZw== 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; bh=pplydIw3aMKsqvdgTdU8/nS7VlTB2EzgwMqQkCaddDc=; b=GJKEvx2/1/U3kEq6fv83hP15DayAI0Pa9HrrVR0z8VGBzsmCiLNDjvptynAup9bYBu S1XRt8y6kuFbXH0eZDvPIm0oha1KTZveIlB081fFlgID2SjnFuTfbPpCMEeR1bUTGYZB 51/ZmU4ciZLV19sI0AtVcbVArIOH0CrehiK5K6AThP6fisxU0IFmXJbj2QQy6P+pam/6 WAJXYLOD9DtHU6xSemmZYjK2kIG9oTkXmgs+eXSFLPWGa8yNfphECIbXaD3qC/zajh5S QN1yB3v3kt+y534e5YpWobih/wTZOFpCAFIiDxNvuT1YSRcL/2oL66CIgEuKTPsuKL1r wzzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eTGtk7C1; 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=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u6-20020a170902a60600b0018c5dae06f3si16175816plq.410.2022.12.21.15.07.19; Wed, 21 Dec 2022 15:07:49 -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=@redhat.com header.s=mimecast20190719 header.b=eTGtk7C1; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235241AbiLUWnM (ORCPT + 99 others); Wed, 21 Dec 2022 17:43:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235068AbiLUWm7 (ORCPT ); Wed, 21 Dec 2022 17:42:59 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EDDC2036F for ; Wed, 21 Dec 2022 14:42:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671662533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pplydIw3aMKsqvdgTdU8/nS7VlTB2EzgwMqQkCaddDc=; b=eTGtk7C1DG7G3oNhBH/YNMkG7X0P0SU2s83HGrZS6XDJO5XPSdCA6hS67yGJl6f7jP/Ou7 YnbiS9sw7tCyqSkqg0eiOARQ2D4vRodwmw9gL7flZa27Ib0J48dsODIUW1GiJKjYCpk1x5 +R7t5giT6hGWpfKNNBXpWH11/hTLKZE= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-642-keguWWWrPN6K1b3PzfrVGw-1; Wed, 21 Dec 2022 17:42:10 -0500 X-MC-Unique: keguWWWrPN6K1b3PzfrVGw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 02D3C1C05134; Wed, 21 Dec 2022 22:42:10 +0000 (UTC) Received: from rules.brq.redhat.com (ovpn-208-11.brq.redhat.com [10.40.208.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB35B40C2064; Wed, 21 Dec 2022 22:42:07 +0000 (UTC) From: Vladis Dronov To: herbert@gondor.apana.org.au, davem@davemloft.net Cc: nstange@suse.de, elliott@hpe.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, smueller@chronox.de, vdronov@redhat.com Subject: [PATCH 4/6] crypto: testmgr - disallow plain cbcmac(aes) in FIPS mode Date: Wed, 21 Dec 2022 23:41:09 +0100 Message-Id: <20221221224111.19254-5-vdronov@redhat.com> In-Reply-To: <20221221224111.19254-1-vdronov@redhat.com> References: <20221221224111.19254-1-vdronov@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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?1752866822802315247?= X-GMAIL-MSGID: =?utf-8?q?1752866822802315247?= From: Nicolai Stange 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 Signed-off-by: Vladis Dronov --- crypto/testmgr.c | 1 - 1 file changed, 1 deletion(-) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 4476ac97baa5..562463a77a76 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)