From: Eric Snowberg <eric.snowberg@oracle.com>
To: rdunlap@infradead.org, dhowells@redhat.com
Cc: dwmw2@infradead.org, keyrings@vger.kernel.org,
linux-kernel@vger.kernel.org, eric.snowberg@oracle.com
Subject: [PATCH] certs: Fix wrong kconfig option used for x509_revocation_list
Date: Tue, 2 Mar 2021 22:44:18 -0500 [thread overview]
Message-ID: <20210303034418.106762-1-eric.snowberg@oracle.com> (raw)
This fixes a build issue when x509_revocation_list is not defined.
$ make ARCH=x86_64 O=build64 all
EXTRACT_CERTS ../
At main.c:154:
- SSL error:0909006C:PEM routines:get_name:no start line: crypto/pem/pem_lib.c:745
extract-cert: ../: Is a directory
make[2]: [../certs/Makefile:119: certs/x509_revocation_list] Error 1 (ignored)
When the new CONFIG_SYSTEM_REVOCATION_LIST was added [1], it was not carried
into the code for preloading the revocation certificates [2]. Change from
using the original CONFIG_SYSTEM_BLACKLIST_KEYRING to the new
CONFIG_SYSTEM_REVOCATION_LIST.
[1] https://lore.kernel.org/keyrings/EDA280F9-F72D-4181-93C7-CDBE95976FF7@oracle.com/T/#m562c1b27bf402190e7bb573ad20eff5b6310d08f
[2] https://lore.kernel.org/keyrings/EDA280F9-F72D-4181-93C7-CDBE95976FF7@oracle.com/T/#m07e258bf019ccbac23820fad5192ceffa74fc6ab
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Eric Snowberg <eric.snowberg@oracle.com>
---
certs/Makefile | 7 +++++--
certs/blacklist.c | 4 ++++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/certs/Makefile b/certs/Makefile
index e3f4926fd21e..3bc43c88a6d2 100644
--- a/certs/Makefile
+++ b/certs/Makefile
@@ -4,7 +4,10 @@
#
obj-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += system_keyring.o system_certificates.o common.o
-obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist.o revocation_certificates.o common.o
+obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist.o common.o
+ifeq ($(CONFIG_SYSTEM_REVOCATION_LIST),y)
+obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += revocation_certificates.o
+endif
ifneq ($(CONFIG_SYSTEM_BLACKLIST_HASH_LIST),"")
obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist_hashes.o
else
@@ -105,7 +108,7 @@ $(obj)/signing_key.x509: scripts/extract-cert $(X509_DEP) FORCE
$(call if_changed,extract_certs,$(MODULE_SIG_KEY_SRCPREFIX)$(CONFIG_MODULE_SIG_KEY))
endif # CONFIG_MODULE_SIG
-ifeq ($(CONFIG_SYSTEM_BLACKLIST_KEYRING),y)
+ifeq ($(CONFIG_SYSTEM_REVOCATION_LIST),y)
$(eval $(call config_filename,SYSTEM_REVOCATION_KEYS))
diff --git a/certs/blacklist.c b/certs/blacklist.c
index 723b19c96256..c9a435b15af4 100644
--- a/certs/blacklist.c
+++ b/certs/blacklist.c
@@ -21,8 +21,10 @@
static struct key *blacklist_keyring;
+#ifdef CONFIG_SYSTEM_REVOCATION_LIST
extern __initconst const u8 revocation_certificate_list[];
extern __initconst const unsigned long revocation_certificate_list_size;
+#endif
/*
* The description must be a type prefix, a colon and then an even number of
@@ -225,6 +227,7 @@ static int __init blacklist_init(void)
*/
device_initcall(blacklist_init);
+#ifdef CONFIG_SYSTEM_REVOCATION_LIST
/*
* Load the compiled-in list of revocation X.509 certificates.
*/
@@ -237,3 +240,4 @@ static __init int load_revocation_certificate_list(void)
blacklist_keyring);
}
late_initcall(load_revocation_certificate_list);
+#endif
--
2.18.4
next reply other threads:[~2021-03-03 13:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-03 3:44 Eric Snowberg [this message]
2021-03-03 9:24 ` David Howells
2021-03-04 2:45 ` Eric Snowberg
2021-03-04 15:25 ` David Howells
2021-03-04 4:38 ` Jarkko Sakkinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210303034418.106762-1-eric.snowberg@oracle.com \
--to=eric.snowberg@oracle.com \
--cc=dhowells@redhat.com \
--cc=dwmw2@infradead.org \
--cc=keyrings@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®