mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Miao <eric.miao@nvidia.com>
To: <linux-kernel@vger.kernel.org>
Cc: Eric Miao <eric.miao@nvidia.com>,
	David Howells <dhowells@redhat.com>,
	"Dan Willemsen" <dwillemsen@nvidia.com>
Subject: [PATCH 2/2] MODSIG: use pre-generated X.509 key by MODPUBKEY
Date: Mon, 4 Nov 2013 16:06:35 -0800	[thread overview]
Message-ID: <1383609995-8251-2-git-send-email-eric.miao@nvidia.com> (raw)
In-Reply-To: <1383609995-8251-1-git-send-email-eric.miao@nvidia.com>

If MODPUBKEY is specified and other than default ./signing_key.x509, use
that key instead of generating one on-the-fly.

Signed-off-by: Eric Miao <eric.miao@nvidia.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Dan Willemsen <dwillemsen@nvidia.com>
---
 kernel/Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/kernel/Makefile b/kernel/Makefile
index 1ce4755..66c7c32 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -165,6 +165,13 @@ ifndef CONFIG_MODULE_SIG_HASH
 $(error Could not determine digest type to use from kernel config)
 endif
 
+ifneq ($(MODPUBKEY),./signing_key.x509)
+signing_key.x509: $(MODPUBKEY)
+	@echo "###"
+	@echo "### Use pre-generated X.509 key pair for signing modules."
+	@echo "###"
+	cp -f $< $@
+else
 signing_key.priv signing_key.x509: x509.genkey
 	@echo "###"
 	@echo "### Now generating an X.509 key pair to be used for signing modules."
@@ -202,3 +209,4 @@ x509.genkey:
 	@echo >>x509.genkey "subjectKeyIdentifier=hash"
 	@echo >>x509.genkey "authorityKeyIdentifier=keyid"
 endif
+endif
-- 
1.8.4.1


      reply	other threads:[~2013-11-05  0:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-05  0:06 [PATCH 1/2] module: export sig_enforce readonly even if MODULE_SIG_FORCE is on Eric Miao
2013-11-05  0:06 ` Eric Miao [this message]

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=1383609995-8251-2-git-send-email-eric.miao@nvidia.com \
    --to=eric.miao@nvidia.com \
    --cc=dhowells@redhat.com \
    --cc=dwillemsen@nvidia.com \
    --cc=linux-kernel@vger.kernel.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®