From patchwork Thu Dec 29 21:17: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: 37516 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2595357wrt; Thu, 29 Dec 2022 13:23:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXvXUBlbBxMMxV8819OMdrpbgydsGuUud4sD70UDfd38HUTFGzb4gNzQOtVlQHsG0kkG1EPK X-Received: by 2002:a17:907:a64b:b0:7c0:faff:ab43 with SMTP id vu11-20020a170907a64b00b007c0faffab43mr26175091ejc.26.1672349011438; Thu, 29 Dec 2022 13:23:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672349011; cv=none; d=google.com; s=arc-20160816; b=OsgBchDJ87wdjTqOXCKopeg7fUlsaLKOPn9N9vKzuTNFxBFya8YWjbN0ElTAKkYkT5 BaJZ2meCyOzyN5b96k603M2CoA4dgC3yWDWzqnkGLIMhrRPlcqqoNpTgPspWBCzdEfCX BHuH+Md6MlElqRffHR3mMpukob3FzVml5To6+lUEJU2bhTZVPiV/J1QBrEZZRpsojDkk mYwVQjJFSyig8dkoWYRXzfkgaSfPRZiY7EflAX9Pa95qI76rd5c2tbc4m8KFCadg9zLA nYzvc2cWc98m4V9cEVDfJWcA0BteelULA9DzPZ1AeUyxwBqWqWhfPYxR3QMiMToOv8dZ b0qA== 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=l9hhi/SANunKmoKwXebRhuBJH3zZsPz8xdoxFhR57EY=; b=RvIWhrpJCchVvAMKlh0IjVUGRhER0GWr7yklOgoFSa0ZN5hFfn80aCEpndBhkYEo15 3b2fKGftP+8cc3eCDTNXua+wSy/3Y1nBEnWtHWVnFkhb0QK2YkI/n/gjreDXzve5Pns5 cD8t8/PQn+y9+/pNJSXUIGnX32Tbk49oXx/qAWJ0xvpwnF7YUD1sN7vJKZcOdsnC5T4f fjJkQo2enEIdlW2E1oUt2cuAIG/fT+FvvVrr+E76kJoF5MqZzQ2d3+y7tgn1a4nxq819 HvgmD28aGJ7TPv9HTNf6i7BV662QA9AjgxEmGsQ14yFLx+nZxaJmOVskz+R8c104E+WB Ci8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KaPzllQG; 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 hs12-20020a1709073e8c00b007c10638840asi16196704ejc.75.2022.12.29.13.23.07; Thu, 29 Dec 2022 13:23:31 -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=KaPzllQG; 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 S234282AbiL2VS5 (ORCPT + 99 others); Thu, 29 Dec 2022 16:18:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234208AbiL2VSW (ORCPT ); Thu, 29 Dec 2022 16:18:22 -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 C4F9DBC27 for ; Thu, 29 Dec 2022 13:17:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672348657; 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=l9hhi/SANunKmoKwXebRhuBJH3zZsPz8xdoxFhR57EY=; b=KaPzllQGUiy0NzVs0fsQLWIEk0NAIxBk8aKEZzp6SiNcdaVOf8d7ZcFADL1OUAhuIJzBE7 2c/7qocuadbl88yMUCsURHQYhuAMOut0DY6Y77TDr0JJPd6RDv1owkBlyPn+Qhxx1TS2Bv oM8r/ui0LzI4Pduu5jwbsWhBhI9q5cI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-592-6Ovcs_-INPSoQJHseSVycg-1; Thu, 29 Dec 2022 16:17:33 -0500 X-MC-Unique: 6Ovcs_-INPSoQJHseSVycg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 13A62101B429; Thu, 29 Dec 2022 21:17:33 +0000 (UTC) Received: from rules.brq.redhat.com (ovpn-208-2.brq.redhat.com [10.40.208.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id D2568492B00; Thu, 29 Dec 2022 21:17:30 +0000 (UTC) From: Vladis Dronov To: Herbert Xu , "David S . Miller" Cc: Nicolai Stange , Elliott Robert , Stephan Mueller , Eric Biggers , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Vladis Dronov Subject: [PATCH v3 5/6] crypto: testmgr - disallow plain ghash in FIPS mode Date: Thu, 29 Dec 2022 22:17:09 +0100 Message-Id: <20221229211710.14912-6-vdronov@redhat.com> In-Reply-To: <20221229211710.14912-1-vdronov@redhat.com> References: <20221229211710.14912-1-vdronov@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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=unavailable 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?1753585036613725715?= X-GMAIL-MSGID: =?utf-8?q?1753585036613725715?= From: Nicolai Stange 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 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 562463a77a76..a223cf5f3626 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) }