From patchwork Sat Jun 11 17:22:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 12878613 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A608CCA47E for ; Sat, 11 Jun 2022 17:23:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238343AbiFKRXp (ORCPT ); Sat, 11 Jun 2022 13:23:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236066AbiFKRXn (ORCPT ); Sat, 11 Jun 2022 13:23:43 -0400 Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23C963CFD3; Sat, 11 Jun 2022 10:23:38 -0700 (PDT) Received: from grover.sesame (133-32-177-133.west.xps.vectant.ne.jp [133.32.177.133]) (authenticated) by conuserg-09.nifty.com with ESMTP id 25BHMhjN022692; Sun, 12 Jun 2022 02:22:43 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com 25BHMhjN022692 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1654968163; bh=nuJ9fX78Hn2THkCVuIttIKmGkLM6Dk/qRQ+cuZnHrm8=; h=From:To:Cc:Subject:Date:From; b=1RE3Uu54helDOf0cj2T9yhUCVy3XiBs+UO77ut4ySI4SO64ULrIRVOQ+HkNGmm+uG kzsxdHqrhl22d2von3RncQU0ZzcKSNLrCDLmZM7rAW8pEflxjxp3JiS7Cpe0kaGeed 0mUwg2Z48gF2IdKpl9KZIAhMD0idS/YF5lI1dtPgIFMX+sNn+gWcHHW31bxchV5t0i KwTYeaTUJzcxIwK33X3u8Vg25ev0WrKZd/vZgw5Oy78R3pWrnyu5jQGB0cnE8s1KFC Z0bf1v6DqPtoFyl799xXm5JqwRM0PTRqyPpcnna8HMYTqf5rbCKc5MFUNHkPzCtYjR 3FuFK5+b/4x+A== X-Nifty-SrcIP: [133.32.177.133] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: =?unknown-8bit?q?David_Howells_=3Cdhowells=40redhat=2Ecom=3E=2C_Jarkko_S?= =?unknown-8bit?q?akkinen_=3Cjarkko=40kernel=2Eorg=3E=2C_Micka=8F=AB=B3l_Sal?= =?unknown-8bit?q?a=8F=AB=E4n___=3Cmic=40linux=2Emicrosoft=2Ecom=3E=2C_Masah?= =?unknown-8bit?q?iro_Yamada_=3Cmasahiroy=40kernel=2Eorg=3E=2C_David_Woodhou?= =?unknown-8bit?q?se_=3Cdwmw2=40infradead=2Eorg=3E=2C_keyrings=40vger=2Ekern?= =?unknown-8bit?q?el=2Eorg=2C_linux-kernel=40vger=2Ekernel=2Eorg?= Subject: [PATCH 1/4] certs/blacklist_hashes.c: fix const confusion in certs blacklist Date: Sun, 12 Jun 2022 02:22:30 +0900 Message-Id: <20220611172233.1494073-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: keyrings@vger.kernel.org This file fails to compile as follows: CC certs/blacklist_hashes.o certs/blacklist_hashes.c:4:1: error: ignoring attribute ‘section (".init.data")’ because it conflicts with previous ‘section (".init.rodata")’ [-Werror=attributes] 4 | const char __initdata *const blacklist_hashes[] = { | ^~~~~ In file included from certs/blacklist_hashes.c:2: certs/blacklist.h:5:38: note: previous declaration here 5 | extern const char __initconst *const blacklist_hashes[]; | ^~~~~~~~~~~~~~~~ Apply the same fix as commit 2be04df5668d ("certs/blacklist_nohashes.c: fix const confusion in certs blacklist"). Fixes: 734114f8782f ("KEYS: Add a system blacklist keyring") Signed-off-by: Masahiro Yamada Reviewed-by: Mickaël Salaün Reviewed-by: Jarkko Sakkinen --- certs/blacklist_hashes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/certs/blacklist_hashes.c b/certs/blacklist_hashes.c index 344892337be0..d5961aa3d338 100644 --- a/certs/blacklist_hashes.c +++ b/certs/blacklist_hashes.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "blacklist.h" -const char __initdata *const blacklist_hashes[] = { +const char __initconst *const blacklist_hashes[] = { #include CONFIG_SYSTEM_BLACKLIST_HASH_LIST , NULL }; From patchwork Sat Jun 11 17:22:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 12878611 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39492CCA480 for ; Sat, 11 Jun 2022 17:23:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237839AbiFKRXo (ORCPT ); Sat, 11 Jun 2022 13:23:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235564AbiFKRXn (ORCPT ); Sat, 11 Jun 2022 13:23:43 -0400 Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47EDB3CA69; Sat, 11 Jun 2022 10:23:37 -0700 (PDT) Received: from grover.sesame (133-32-177-133.west.xps.vectant.ne.jp [133.32.177.133]) (authenticated) by conuserg-09.nifty.com with ESMTP id 25BHMhjO022692; Sun, 12 Jun 2022 02:22:44 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com 25BHMhjO022692 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1654968164; bh=8AWMt733UhcZGFWaooWxFtWrKXN+8+wup6CjtPDO6HI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XYhJnBknDInKrNeS1UG7IGBZnYZHMyxY0WhfBjLIHd/8MruGSwXYxXiXr+gBoNnEY BHg9VYYgaDMSN7ZL2sQibUwk/wyIAQdvOXOHWPW+SpiqGub0cioXWLqnXG2LoYArP0 l8kleYoBIwQLLCaseDFKM0PqGK7lvFG+YmyK2TxcUv8R8r0RZGU3EwmIDpaKjM0pPq 1LB5ljuwYVk1hL26y74JLaJXjBUufWut56ic5xuctz2bFRERJUUPMelydqSArn79iY tw7zh9Zrn50iCoFVqlPuIy3uVj8Gh5rOcYLIaEmcKgDb38eX5dBv0lQzEZYEF4eyeU CbH/r/y4TbRmA== X-Nifty-SrcIP: [133.32.177.133] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: =?unknown-8bit?q?David_Howells_=3Cdhowells=40redhat=2Ecom=3E=2C_Jarkko_S?= =?unknown-8bit?q?akkinen_=3Cjarkko=40kernel=2Eorg=3E=2C_Micka=8F=AB=B3l_Sal?= =?unknown-8bit?q?a=8F=AB=E4n___=3Cmic=40linux=2Emicrosoft=2Ecom=3E=2C_Masah?= =?unknown-8bit?q?iro_Yamada_=3Cmasahiroy=40kernel=2Eorg=3E=2C_David_Woodhou?= =?unknown-8bit?q?se_=3Cdwmw2=40infradead=2Eorg=3E=2C_keyrings=40vger=2Ekern?= =?unknown-8bit?q?el=2Eorg=2C_linux-kernel=40vger=2Ekernel=2Eorg?= Subject: [PATCH 2/4] certs: fix and refactor CONFIG_SYSTEM_BLACKLIST_HASH_LIST build Date: Sun, 12 Jun 2022 02:22:31 +0900 Message-Id: <20220611172233.1494073-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220611172233.1494073-1-masahiroy@kernel.org> References: <20220611172233.1494073-1-masahiroy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: keyrings@vger.kernel.org Commit addf466389d9 ("certs: Check that builtin blacklist hashes are valid") was applied 8 months after the submission. In the meantime, the base code had been removed by commit b8c96a6b466c ("certs: simplify $(srctree)/ handling and remove config_filename macro"). Fix the Makefile. Create a local copy of $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST). It is included from certs/blacklist_hashes.c and also works as a timestamp. Send error messages from check-blacklist-hashes.awk to stderr instead of stdout. Fixes: addf466389d9 ("certs: Check that builtin blacklist hashes are valid") Signed-off-by: Masahiro Yamada Reviewed-by: Mickaël Salaün Reviewed-by: Jarkko Sakkinen --- certs/.gitignore | 2 +- certs/Makefile | 20 ++++++++++---------- certs/blacklist_hashes.c | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/certs/.gitignore b/certs/.gitignore index 56637aceaf81..cec5465f31c1 100644 --- a/certs/.gitignore +++ b/certs/.gitignore @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only -/blacklist_hashes_checked +/blacklist_hash_list /extract-cert /x509_certificate_list /x509_revocation_list diff --git a/certs/Makefile b/certs/Makefile index cb1a9da3fc58..a8d628fd5f7b 100644 --- a/certs/Makefile +++ b/certs/Makefile @@ -7,22 +7,22 @@ obj-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += system_keyring.o system_certificates.o c obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist.o common.o obj-$(CONFIG_SYSTEM_REVOCATION_LIST) += revocation_certificates.o ifneq ($(CONFIG_SYSTEM_BLACKLIST_HASH_LIST),) -quiet_cmd_check_blacklist_hashes = CHECK $(patsubst "%",%,$(2)) - cmd_check_blacklist_hashes = $(AWK) -f $(srctree)/scripts/check-blacklist-hashes.awk $(2); touch $@ -$(eval $(call config_filename,SYSTEM_BLACKLIST_HASH_LIST)) +$(obj)/blacklist_hashes.o: $(obj)/blacklist_hash_list +CFLAGS_blacklist_hashes.o := -I $(obj) -$(obj)/blacklist_hashes.o: $(obj)/blacklist_hashes_checked +quiet_cmd_check_and_copy_blacklist_hash_list = GEN $@ + cmd_check_and_copy_blacklist_hash_list = \ + $(AWK) -f $(srctree)/scripts/check-blacklist-hashes.awk $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) >&2; \ + cat $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) > $@ -CFLAGS_blacklist_hashes.o += -I$(srctree) - -targets += blacklist_hashes_checked -$(obj)/blacklist_hashes_checked: $(SYSTEM_BLACKLIST_HASH_LIST_SRCPREFIX)$(SYSTEM_BLACKLIST_HASH_LIST_FILENAME) scripts/check-blacklist-hashes.awk FORCE - $(call if_changed,check_blacklist_hashes,$(SYSTEM_BLACKLIST_HASH_LIST_SRCPREFIX)$(CONFIG_SYSTEM_BLACKLIST_HASH_LIST)) +$(obj)/blacklist_hash_list: $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) FORCE + $(call if_changed,check_and_copy_blacklist_hash_list) obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist_hashes.o else obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist_nohashes.o endif +targets += blacklist_hash_list quiet_cmd_extract_certs = CERT $@ cmd_extract_certs = $(obj)/extract-cert $(extract-cert-in) $@ @@ -33,7 +33,7 @@ $(obj)/system_certificates.o: $(obj)/x509_certificate_list $(obj)/x509_certificate_list: $(CONFIG_SYSTEM_TRUSTED_KEYS) $(obj)/extract-cert FORCE $(call if_changed,extract_certs) -targets += x509_certificate_list blacklist_hashes_checked +targets += x509_certificate_list # If module signing is requested, say by allyesconfig, but a key has not been # supplied, then one will need to be generated to make sure the build does not diff --git a/certs/blacklist_hashes.c b/certs/blacklist_hashes.c index d5961aa3d338..86d66fe11348 100644 --- a/certs/blacklist_hashes.c +++ b/certs/blacklist_hashes.c @@ -2,6 +2,6 @@ #include "blacklist.h" const char __initconst *const blacklist_hashes[] = { -#include CONFIG_SYSTEM_BLACKLIST_HASH_LIST +#include "blacklist_hash_list" , NULL }; From patchwork Sat Jun 11 17:22:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 12878610 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15535C43334 for ; Sat, 11 Jun 2022 17:23:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238287AbiFKRXo (ORCPT ); Sat, 11 Jun 2022 13:23:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238181AbiFKRXn (ORCPT ); Sat, 11 Jun 2022 13:23:43 -0400 Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C317B3CFC9; Sat, 11 Jun 2022 10:23:37 -0700 (PDT) Received: from grover.sesame (133-32-177-133.west.xps.vectant.ne.jp [133.32.177.133]) (authenticated) by conuserg-09.nifty.com with ESMTP id 25BHMhjP022692; Sun, 12 Jun 2022 02:22:45 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com 25BHMhjP022692 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1654968165; bh=MMlWHI79ZXLVfVOPspFzx7WO3YALeI7+en73nS8lFyY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BPPzm9G0e6v8UIo5UGvWV0+CS09mXXIW3BFcw18fSZLEkOet4hu6efpdPrCVjuOWb I2CJb4QtmLSyESS+JDvVKxbDWuhE1Zbejlb6XpWGX0e/FGzVUU+RhEylEtIVu9hI9G Sux8kMsCqnJ+Z2lQHhnmBJjiBbaqwaRlYUH5SmP1mZv3stMcrG/bXRvNxNu9kmkJ4L VhE6vEpva8xUzxhrMLQZI+6qDiLomI4r1XkR5XTZo8rjakxevx3rBFskiMw+mf45o3 Njb+uypw1Pk1fqynv+6cNh1GqX7/AK0dvTB4zmiG1JUyiyn6x1i1BtvIdm+kcfIT55 3RaI0LCqLS0xw== X-Nifty-SrcIP: [133.32.177.133] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: =?unknown-8bit?q?David_Howells_=3Cdhowells=40redhat=2Ecom=3E=2C_Jarkko_S?= =?unknown-8bit?q?akkinen_=3Cjarkko=40kernel=2Eorg=3E=2C_Micka=8F=AB=B3l_Sal?= =?unknown-8bit?q?a=8F=AB=E4n___=3Cmic=40linux=2Emicrosoft=2Ecom=3E=2C_Masah?= =?unknown-8bit?q?iro_Yamada_=3Cmasahiroy=40kernel=2Eorg=3E=2C_David_Woodhou?= =?unknown-8bit?q?se_=3Cdwmw2=40infradead=2Eorg=3E=2C_keyrings=40vger=2Ekern?= =?unknown-8bit?q?el=2Eorg=2C_linux-kernel=40vger=2Ekernel=2Eorg?= Subject: [PATCH 3/4] certs: move scripts/check-blacklist-hashes.awk to certs/ Date: Sun, 12 Jun 2022 02:22:32 +0900 Message-Id: <20220611172233.1494073-3-masahiroy@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220611172233.1494073-1-masahiroy@kernel.org> References: <20220611172233.1494073-1-masahiroy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: keyrings@vger.kernel.org This script is only used in certs/Makefile, so certs/ is a better home for it. Signed-off-by: Masahiro Yamada Reviewed-by: Mickaël Salaün Reviewed-by: Jarkko Sakkinen --- MAINTAINERS | 1 - certs/Makefile | 2 +- {scripts => certs}/check-blacklist-hashes.awk | 0 3 files changed, 1 insertion(+), 2 deletions(-) rename {scripts => certs}/check-blacklist-hashes.awk (100%) diff --git a/MAINTAINERS b/MAINTAINERS index 1fc9ead83d2a..7c2a7c304824 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4627,7 +4627,6 @@ L: keyrings@vger.kernel.org S: Maintained F: Documentation/admin-guide/module-signing.rst F: certs/ -F: scripts/check-blacklist-hashes.awk F: scripts/sign-file.c F: tools/certs/ diff --git a/certs/Makefile b/certs/Makefile index a8d628fd5f7b..df7aaeafd19c 100644 --- a/certs/Makefile +++ b/certs/Makefile @@ -13,7 +13,7 @@ CFLAGS_blacklist_hashes.o := -I $(obj) quiet_cmd_check_and_copy_blacklist_hash_list = GEN $@ cmd_check_and_copy_blacklist_hash_list = \ - $(AWK) -f $(srctree)/scripts/check-blacklist-hashes.awk $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) >&2; \ + $(AWK) -f $(srctree)/$(src)/check-blacklist-hashes.awk $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) >&2; \ cat $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) > $@ $(obj)/blacklist_hash_list: $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) FORCE diff --git a/scripts/check-blacklist-hashes.awk b/certs/check-blacklist-hashes.awk similarity index 100% rename from scripts/check-blacklist-hashes.awk rename to certs/check-blacklist-hashes.awk From patchwork Sat Jun 11 17:22:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 12878612 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F4056CCA47C for ; Sat, 11 Jun 2022 17:23:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238515AbiFKRXq (ORCPT ); Sat, 11 Jun 2022 13:23:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238179AbiFKRXn (ORCPT ); Sat, 11 Jun 2022 13:23:43 -0400 Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C30783CA54; Sat, 11 Jun 2022 10:23:37 -0700 (PDT) Received: from grover.sesame (133-32-177-133.west.xps.vectant.ne.jp [133.32.177.133]) (authenticated) by conuserg-09.nifty.com with ESMTP id 25BHMhjQ022692; Sun, 12 Jun 2022 02:22:45 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com 25BHMhjQ022692 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1654968166; bh=A23KTIgin1aGL7tlLpcBM/pr60oqIzwLBoV8Wxeh2p0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Llyi0YLJ14b5QWQVQPqHLa7n2JvTbXAheXVqnQLLwV0dA7csg05zwWc8mLxmZ0bTj rAV3r35WL7MPi6o487lTvAsb//1F7Y4OHCgePgTH/1I+q/IVsQZhWBgSB2yvhdP10e YZmOYrv0zRp/1mQaUqky6+MZM3SdSr3Z778OEhDjM84ORNU5/nqSdtOdXt7dB7NP9f sIlf0jfmyFU8xV0RBK52K66MsXzXjxfBObAHb7cgkwgAHL7vpN8KPUzR64FTmW0lou DGiWioOnHdDVKsgy2fW8e6xGEgYUaUjVATsKAe7hwOOUHouugTZhBJH3DjyTuDrbR7 FIfgpRrAQ1IeQ== X-Nifty-SrcIP: [133.32.177.133] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: =?unknown-8bit?q?David_Howells_=3Cdhowells=40redhat=2Ecom=3E=2C_Jarkko_S?= =?unknown-8bit?q?akkinen_=3Cjarkko=40kernel=2Eorg=3E=2C_Micka=8F=AB=B3l_Sal?= =?unknown-8bit?q?a=8F=AB=E4n___=3Cmic=40linux=2Emicrosoft=2Ecom=3E=2C_Masah?= =?unknown-8bit?q?iro_Yamada_=3Cmasahiroy=40kernel=2Eorg=3E=2C_David_Woodhou?= =?unknown-8bit?q?se_=3Cdwmw2=40infradead=2Eorg=3E=2C_keyrings=40vger=2Ekern?= =?unknown-8bit?q?el=2Eorg=2C_linux-kernel=40vger=2Ekernel=2Eorg?= Subject: [PATCH 4/4] certs: unify blacklist_hashes.c and blacklist_nohashes.c Date: Sun, 12 Jun 2022 02:22:33 +0900 Message-Id: <20220611172233.1494073-4-masahiroy@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220611172233.1494073-1-masahiroy@kernel.org> References: <20220611172233.1494073-1-masahiroy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: keyrings@vger.kernel.org These two files are very similar. Unify them. Signed-off-by: Masahiro Yamada Reviewed-by: Mickaël Salaün Reviewed-by: Jarkko Sakkinen --- certs/Makefile | 12 +++++------- certs/blacklist_hashes.c | 1 - certs/blacklist_nohashes.c | 6 ------ 3 files changed, 5 insertions(+), 14 deletions(-) delete mode 100644 certs/blacklist_nohashes.c diff --git a/certs/Makefile b/certs/Makefile index df7aaeafd19c..7068d45db807 100644 --- a/certs/Makefile +++ b/certs/Makefile @@ -4,24 +4,22 @@ # obj-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += system_keyring.o system_certificates.o common.o -obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist.o common.o +obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist.o common.o blacklist_hashes.o obj-$(CONFIG_SYSTEM_REVOCATION_LIST) += revocation_certificates.o -ifneq ($(CONFIG_SYSTEM_BLACKLIST_HASH_LIST),) $(obj)/blacklist_hashes.o: $(obj)/blacklist_hash_list CFLAGS_blacklist_hashes.o := -I $(obj) quiet_cmd_check_and_copy_blacklist_hash_list = GEN $@ cmd_check_and_copy_blacklist_hash_list = \ + $(if $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST), \ $(AWK) -f $(srctree)/$(src)/check-blacklist-hashes.awk $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) >&2; \ - cat $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) > $@ + { cat $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST); echo $(comma) NULL; } > $@, \ + echo NULL > $@) $(obj)/blacklist_hash_list: $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) FORCE $(call if_changed,check_and_copy_blacklist_hash_list) -obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist_hashes.o -else -obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist_nohashes.o -endif + targets += blacklist_hash_list quiet_cmd_extract_certs = CERT $@ diff --git a/certs/blacklist_hashes.c b/certs/blacklist_hashes.c index 86d66fe11348..0c5476abebd9 100644 --- a/certs/blacklist_hashes.c +++ b/certs/blacklist_hashes.c @@ -3,5 +3,4 @@ const char __initconst *const blacklist_hashes[] = { #include "blacklist_hash_list" - , NULL }; diff --git a/certs/blacklist_nohashes.c b/certs/blacklist_nohashes.c deleted file mode 100644 index 753b703ef0ef..000000000000 --- a/certs/blacklist_nohashes.c +++ /dev/null @@ -1,6 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include "blacklist.h" - -const char __initconst *const blacklist_hashes[] = { - NULL -};