linux/kernel
David Howells d441108c6f MODSIGN: Automatically generate module signing keys if missing
Automatically generate keys for module signing if they're absent so that
allyesconfig doesn't break.  The builder should consider generating their own
key and certificate, however, so that the keys are appropriately named.

The private key for the module signer should be placed in signing_key.priv
(unencrypted!) and the public key in an X.509 certificate as signing_key.x509.

If a transient key is desired for signing the modules, a config file for
'openssl req' can be placed in x509.genkey, looking something like the
following:

	[ req ]
	default_bits = 4096
	distinguished_name = req_distinguished_name
	prompt = no
	x509_extensions = myexts

	[ req_distinguished_name ]
	O = Magarathea
	CN = Glacier signing key
	emailAddress = slartibartfast@magrathea.h2g2

	[ myexts ]
	basicConstraints=critical,CA:FALSE
	keyUsage=digitalSignature
	subjectKeyIdentifier=hash
	authorityKeyIdentifier=hash

The build process will use this to configure:

	openssl req -new -nodes -utf8 -sha1 -days 36500 -batch \
		-x509 -config x509.genkey \
		-outform DER -out signing_key.x509 \
		-keyout signing_key.priv

to generate the key.

Note that it is required that the X.509 certificate have a subjectKeyIdentifier
and an authorityKeyIdentifier.  Without those, the certificate will be
rejected.  These can be used to check the validity of a certificate.

Note that 'make distclean' will remove signing_key.{priv,x509} and x509.genkey,
whether or not they were generated automatically.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-10-10 20:01:21 +10:30
..
debug kernel/debug: Make use of KGDB_REASON_NMI 2012-07-31 08:16:43 -05:00
events perf/hwpb: Invoke __perf_event_disable() if interrupts are already disabled 2012-09-04 17:29:53 +02:00
gcov
irq Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-08-03 10:56:44 -07:00
power Revert "NMI watchdog: fix for lockup detector breakage on resume" 2012-08-08 20:49:45 +02:00
sched Revert "sched: Improve scalability via 'CPU buddies', which withstand random perturbations" 2012-09-16 12:29:43 -07:00
time sched: Add missing call to calc_load_exit_idle() 2012-09-04 14:30:29 +02:00
trace tracing/syscalls: Fix perf syscall tracing when syscall_nr == -1 2012-08-17 15:19:46 -04:00
.gitignore
Kconfig.freezer
Kconfig.hz
Kconfig.locks
Kconfig.preempt
Makefile MODSIGN: Automatically generate module signing keys if missing 2012-10-10 20:01:21 +10:30
acct.c
async.c [SCSI] async: make async_synchronize_full() flush all work regardless of domain 2012-07-20 09:07:37 +01:00
audit.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2012-08-01 10:26:23 -07:00
audit.h
audit_tree.c audit: clean up refcounting in audit-tree 2012-08-15 12:55:22 +02:00
audit_watch.c get rid of kern_path_parent() 2012-07-14 16:35:02 +04:00
auditfilter.c
auditsc.c
backtracetest.c
bounds.c
capability.c
cgroup.c Merge branch 'for-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup 2012-07-24 17:47:44 -07:00
cgroup_freezer.c
compat.c
configs.c
cpu.c mm/hotplug: correctly setup fallback zonelists when creating new pgdat 2012-07-31 18:42:44 -07:00
cpu_pm.c
cpuset.c cpusets: Remove/update outdated comments 2012-07-24 13:53:28 +02:00
crash_dump.c
cred.c
delayacct.c
dma.c
elfcore.c
exec_domain.c
exit.c posix_types.h: Cleanup stale __NFDBITS and related definitions 2012-07-26 13:36:43 -07:00
extable.c
fork.c uprobes: Fix mmap_region()'s mm->mm_rb corruption if uprobe_mmap() fails 2012-08-21 11:48:12 +02:00
freezer.c
futex.c futex: Forbid uaddr == uaddr2 in futex_wait_requeue_pi() 2012-07-24 16:02:57 +02:00
futex_compat.c
groups.c
hrtimer.c hrtimer: Update hrtimer base offsets each hrtimer_interrupt 2012-07-11 23:34:39 +02:00
hung_task.c
irq_work.c
itimer.c
jump_label.c
kallsyms.c
kcmp.c
kexec.c kdump: append newline to the last lien of vmcoreinfo note 2012-07-30 17:25:20 -07:00
kfifo.c
kmod.c kmod: avoid deadlock from recursive kmod call 2012-07-30 17:25:20 -07:00
kprobes.c
ksysfs.c
kthread.c kthread_worker: reimplement flush_kthread_work() to allow freeing the work item being executed 2012-07-22 10:15:28 -07:00
latencytop.c
lglock.c
lockdep.c
lockdep_internals.h
lockdep_proc.c
lockdep_states.h
module-internal.h module: signature checking hook 2012-10-10 20:00:55 +10:30
module.c MODSIGN: Add FIPS policy 2012-10-10 20:01:19 +10:30
module_signing.c module: signature checking hook 2012-10-10 20:00:55 +10:30
mutex-debug.c
mutex-debug.h
mutex.c
mutex.h
notifier.c
nsproxy.c
padata.c
panic.c panic: fix a possible deadlock in panic() 2012-07-30 17:25:13 -07:00
params.c
pid.c
pid_namespace.c pid-namespace: limit value of ns_last_pid to (0, max_pid) 2012-09-17 15:00:38 -07:00
posix-cpu-timers.c
posix-timers.c
printk.c printk: Fix calculation of length used to discard records 2012-08-12 21:25:50 +03:00
profile.c
ptrace.c
range.c
rcu.h
rcupdate.c rcu: Consolidate tree/tiny __rcu_read_{,un}lock() implementations 2012-07-02 12:34:23 -07:00
rcutiny.c rcu: Fix rcu_is_cpu_idle() #ifdef in TINY_RCU 2012-07-02 12:34:25 -07:00
rcutiny_plugin.h rcu: Fix code-style issues involving "else" 2012-07-06 06:01:48 -07:00
rcutorture.c rcu: Fix broken strings in RCU's source code. 2012-07-06 06:01:49 -07:00
rcutree.c rcu: Fix code-style issues involving "else" 2012-07-06 06:01:48 -07:00
rcutree.h Merge branches 'bigrtm.2012.07.04a', 'doctorture.2012.07.02a', 'fixes.2012.07.06a' and 'fnh.2012.07.02a' into HEAD 2012-07-06 05:59:30 -07:00
rcutree_plugin.h rcu: Fix code-style issues involving "else" 2012-07-06 06:01:48 -07:00
rcutree_trace.c rcu: Fix broken strings in RCU's source code. 2012-07-06 06:01:49 -07:00
relay.c
res_counter.c
resource.c resource: make sure requested range is included in the root range 2012-07-30 17:25:21 -07:00
rtmutex-debug.c
rtmutex-debug.h
rtmutex-tester.c
rtmutex.c
rtmutex.h
rtmutex_common.h
rwsem.c
seccomp.c
semaphore.c
signal.c signal: make sure we don't get stopped with pending task_work 2012-07-22 23:57:54 +04:00
smp.c
smpboot.c
smpboot.h
softirq.c mm: allow PF_MEMALLOC from softirq context 2012-07-31 18:42:45 -07:00
spinlock.c
srcu.c
stacktrace.c
stop_machine.c
sys.c kernel/sys.c: avoid argv_free(NULL) 2012-07-30 17:25:13 -07:00
sys_ni.c
sysctl.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2012-08-01 10:26:23 -07:00
sysctl_binary.c mm: prepare for removal of obsolete /proc/sys/vm/nr_pdflush_threads 2012-07-31 18:42:40 -07:00
task_work.c task_work: add a scheduling point in task_work_run() 2012-08-21 09:11:44 -07:00
taskstats.c taskstats: check nla_reserve() return 2012-07-30 17:25:21 -07:00
test_kprobes.c
time.c
timeconst.pl
timer.c alpha: take a bunch of syscalls into osf_sys.c 2012-08-19 08:41:19 -07:00
tracepoint.c
tsacct.c
uid16.c
up.c
user-return-notifier.c
user.c
user_namespace.c
utsname.c
utsname_sysctl.c
wait.c
watchdog.c Revert "NMI watchdog: fix for lockup detector breakage on resume" 2012-08-08 20:49:45 +02:00
workqueue.c workqueue: always clear WORKER_REBIND in busy_worker_rebind_fn() 2012-09-17 15:42:31 -07:00
workqueue_sched.h