From: Emily Maier <emilymaier@mykolab.com>
To: Rob Landley <rob@landley.net>, Michal Marek <mmarek@suse.cz>
Cc: linux-doc@vger.kernel.org, linux-kbuild@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v2] kbuild: enable use of password-protected signing keys
Date: Thu, 13 Feb 2014 18:00:31 -0500 [thread overview]
Message-ID: <52FD4E8F.2030905@mykolab.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2895 bytes --]
Currently, the module signing script assumes that the private key is
not password-protected. This patch makes it somewhat more secure by
checking of a password file ("signing_key.pass") exists and passing it
to OpenSSL if so.
Version 2 changes: removed command line password passing from the
Makefile, the password file is now autodetected by the Perl signing
script.
Signed-off-by: Emily Maier <emilymaier@mykolab.com>
---
Documentation/dontdiff | 1 +
Documentation/module-signing.txt | 3 +++
scripts/sign-file | 13 ++++++++++---
5 files changed, 15 insertions(+), 4 deletions(-)
diff -uprN -X linux-3.13.2-devel/Documentation/dontdiff linux-3.13.2/Documentation/dontdiff linux-3.13.2-devel/Documentation/dontdiff
--- linux-3.13.2/Documentation/dontdiff 2014-02-06 14:42:22.000000000 -0500
+++ linux-3.13.2-devel/Documentation/dontdiff 2014-02-09 15:30:41.719448065 -0500
@@ -214,6 +214,7 @@ setup
setup.bin
setup.elf
sImage
+signing_key.*
sm_tbl*
split-include
syscalltab.h
diff -uprN -X linux-3.13.2-devel/Documentation/dontdiff linux-3.13.2/Documentation/module-signing.txt linux-3.13.2-devel/Documentation/module-signing.txt
--- linux-3.13.2/Documentation/module-signing.txt 2014-02-06 14:42:22.000000000 -0500
+++ linux-3.13.2-devel/Documentation/module-signing.txt 2014-02-13 17:29:54.412512011 -0500
@@ -137,6 +137,9 @@ generate the public/private key files:
-config x509.genkey -outform DER -out signing_key.x509 \
-keyout signing_key.priv
+If you want to use a signing key with a password, write it to a file called
+"signing_key.pass". For security, make sure it is owned by root with 600
+permissions.
=========================
PUBLIC KEYS IN THE KERNEL
diff -uprN -X linux-3.13.2-devel/Documentation/dontdiff linux-3.13.2/scripts/sign-file linux-3.13.2-devel/scripts/sign-file
--- linux-3.13.2/scripts/sign-file 2014-02-06 14:42:22.000000000 -0500
+++ linux-3.13.2-devel/scripts/sign-file 2014-02-13 17:40:26.003859486 -0500
@@ -365,9 +365,16 @@ if ($signature_file) {
# comprises the signature with no metadata attached.
#
my $pid;
- $pid = open2(*read_from, *write_to,
- "openssl rsautl -sign -inkey $private_key -keyform PEM") ||
- die "openssl rsautl";
+ my $passfile = "signing_key.pass";
+ if (-e $passfile) {
+ $pid = open2(*read_from, *write_to,
+ "openssl rsautl -sign -inkey $private_key -keyform PEM \\
+ -passin file:$passfile") || die "openssl rsautl";
+ } else {
+ $pid = open2(*read_from, *write_to,
+ "openssl rsautl -sign -inkey $private_key -keyform PEM") ||
+ die "openssl rsautl";
+ }
binmode write_to;
print write_to $prologue . $digest || die "pipe to openssl rsautl";
close(write_to) || die "pipe to openssl rsautl";
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]
next reply other threads:[~2014-02-13 23:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-13 23:00 Emily Maier [this message]
2014-03-14 16:33 ` [PATCH v2] kbuild: enable use of password-protected signing keys Michal Marek
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=52FD4E8F.2030905@mykolab.com \
--to=emilymaier@mykolab.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.cz \
--cc=rob@landley.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.