summaryrefslogtreecommitdiffstats
path: root/scripts/x509keyid
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-10-19 11:53:15 +1030
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-19 08:27:43 -0700
commite2a666d52b4825c26c857cada211f3baac26a600 (patch)
treeb7e91bd10e8c1b2932ffd1716fde3abccd7c4dd8 /scripts/x509keyid
parentc9623de4fc2f8320fe94316b46171683be3b1d59 (diff)
downloadop-kernel-dev-e2a666d52b4825c26c857cada211f3baac26a600.zip
op-kernel-dev-e2a666d52b4825c26c857cada211f3baac26a600.tar.gz
kbuild: sign the modules at install time
Linus deleted the old code and put signing on the install command, I fixed it to extract the keyid and signer-name within sign-file and cleaned up that script now it always signs in-place. Some enthusiast should convert sign-key to perl and pull x509keyid into it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/x509keyid')
-rwxr-xr-xscripts/x509keyid16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/x509keyid b/scripts/x509keyid
index c8e91a4..4241ec6 100755
--- a/scripts/x509keyid
+++ b/scripts/x509keyid
@@ -22,7 +22,7 @@ use strict;
my $raw_data;
-die "Need three filenames\n" if ($#ARGV != 2);
+die "Need a filename [keyid|signer-name]\n" if ($#ARGV != 1);
my $src = $ARGV[0];
@@ -259,10 +259,10 @@ die $src, ": ", "X.509: Couldn't find the Subject Key Identifier extension\n"
my $id_key_id = asn1_retrieve($subject_key_id->[1]);
-open(OUTFD, ">$ARGV[1]") || die $ARGV[1];
-print OUTFD $id_name;
-close OUTFD || die $ARGV[1];
-
-open(OUTFD, ">$ARGV[2]") || die $ARGV[2];
-print OUTFD $id_key_id;
-close OUTFD || die $ARGV[2];
+if ($ARGV[1] eq "signer-name") {
+ print $id_name;
+} elsif ($ARGV[1] eq "keyid") {
+ print $id_key_id;
+} else {
+ die "Unknown arg";
+}
OpenPOWER on IntegriCloud