]> git.ipfire.org Git - thirdparty/kmod.git/commit
libkmod: Return module signature information in kmod_module_get_info()
authorMichal Marek <mmarek@suse.cz>
Wed, 16 Jan 2013 08:52:01 +0000 (09:52 +0100)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Fri, 18 Jan 2013 01:48:43 +0000 (23:48 -0200)
commit8fe1681c52ceec35c77e37ca03837c0948e41b49
tree30a1741dcd175e36cc465e9ab3a1620d076e34fb
parent6333934e27934a4d8d7dde729e965fab7f2c416b
libkmod: Return module signature information in kmod_module_get_info()

If the module is built with CONFIG_MODULE_SIG, add the the signer's
name, hexadecimal key id and hash algorithm to the list returned in
kmod_module_get_info(). The modinfo output then looks like this:

filename:       /home/mmarek/kmod/testsuite/rootfs-pristine/test-modinfo/ext4-x86_64-sha256.ko
license:        GPL
description:    Fourth Extended Filesystem
author:         Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others
alias:          ext3
alias:          ext2
depends:        mbcache,jbd2
intree:         Y
vermagic:       3.7.0 SMP mod_unload
signer:         Magrathea: Glacier signing key
sig_key:        E3:C8:FC:A7:3F:B3:1D:DE:84:81:EF:38:E3:4C:DE:4B:0C:FD:1B:F9
sig_hashalgo:   sha256

The signature algorithm (RSA) and key identifier type (X509) are not
displayed, because they are constant information for every signed
module. But it would be trivial to add this. Note: No attempt is made at
verifying the signature, I don't think that modinfo is the right tool
for this.
Makefile.am
libkmod/libkmod-module.c
libkmod/libkmod-private.h
libkmod/libkmod-signature.c [new file with mode: 0644]