diff options
author | David Howells <dhowells@redhat.com> | 2016-04-06 17:14:24 +0200 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2016-04-06 17:14:24 +0200 |
commit | e68503bd6836ba765dc8e0ee77ea675fedc07e41 (patch) | |
tree | 31ebec81d2f52adc89796dd063468235bfd1cc0e /kernel/module_signing.c | |
parent | X.509: Fix self-signed determination (diff) | |
download | linux-e68503bd6836ba765dc8e0ee77ea675fedc07e41.tar.xz linux-e68503bd6836ba765dc8e0ee77ea675fedc07e41.zip |
KEYS: Generalise system_verify_data() to provide access to internal content
Generalise system_verify_data() to provide access to internal content
through a callback. This allows all the PKCS#7 stuff to be hidden inside
this function and removed from the PE file parser and the PKCS#7 test key.
If external content is not required, NULL should be passed as data to the
function. If the callback is not required, that can be set to NULL.
The function is now called verify_pkcs7_signature() to contrast with
verify_pefile_signature() and the definitions of both have been moved into
linux/verification.h along with the key_being_used_for enum.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'kernel/module_signing.c')
-rw-r--r-- | kernel/module_signing.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/module_signing.c b/kernel/module_signing.c index 64b9dead4a07..593aace88a02 100644 --- a/kernel/module_signing.c +++ b/kernel/module_signing.c @@ -80,6 +80,7 @@ int mod_verify_sig(const void *mod, unsigned long *_modlen) return -EBADMSG; } - return system_verify_data(mod, modlen, mod + modlen, sig_len, - VERIFYING_MODULE_SIGNATURE); + return verify_pkcs7_signature(mod, modlen, mod + modlen, sig_len, + NULL, -ENOKEY, VERIFYING_MODULE_SIGNATURE, + NULL, NULL); } |