summaryrefslogtreecommitdiff
path: root/kernel/module_signing.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/module_signing.c')
-rw-r--r--kernel/module_signing.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/module_signing.c b/kernel/module_signing.c
index be5b8fa..f2970bd 100644
--- a/kernel/module_signing.c
+++ b/kernel/module_signing.c
@@ -14,7 +14,6 @@
#include <crypto/public_key.h>
#include <crypto/hash.h>
#include <keys/asymmetric-type.h>
-#include <keys/system_keyring.h>
#include "module-internal.h"
/*
@@ -29,7 +28,7 @@
*/
struct module_signature {
u8 algo; /* Public-key crypto algorithm [enum pkey_algo] */
- u8 hash; /* Digest algorithm [enum hash_algo] */
+ u8 hash; /* Digest algorithm [enum pkey_hash_algo] */
u8 id_type; /* Key identifier type [enum pkey_id_type] */
u8 signer_len; /* Length of signer's name */
u8 key_id_len; /* Length of key identifier */
@@ -40,7 +39,7 @@ struct module_signature {
/*
* Digest the module contents.
*/
-static struct public_key_signature *mod_make_digest(enum hash_algo hash,
+static struct public_key_signature *mod_make_digest(enum pkey_hash_algo hash,
const void *mod,
unsigned long modlen)
{
@@ -55,7 +54,7 @@ static struct public_key_signature *mod_make_digest(enum hash_algo hash,
/* Allocate the hashing algorithm we're going to need and find out how
* big the hash operational data will be.
*/
- tfm = crypto_alloc_shash(hash_algo_name[hash], 0, 0);
+ tfm = crypto_alloc_shash(pkey_hash_algo[hash], 0, 0);
if (IS_ERR(tfm))
return (PTR_ERR(tfm) == -ENOENT) ? ERR_PTR(-ENOPKG) : ERR_CAST(tfm);
@@ -158,7 +157,7 @@ static struct key *request_asymmetric_key(const char *signer, size_t signer_len,
pr_debug("Look up: \"%s\"\n", id);
- key = keyring_search(make_key_ref(system_trusted_keyring, 1),
+ key = keyring_search(make_key_ref(modsign_keyring, 1),
&key_type_asymmetric, id);
if (IS_ERR(key))
pr_warn("Request for unknown module key '%s' err %ld\n",
@@ -218,7 +217,7 @@ int mod_verify_sig(const void *mod, unsigned long *_modlen)
return -ENOPKG;
if (ms.hash >= PKEY_HASH__LAST ||
- !hash_algo_name[ms.hash])
+ !pkey_hash_algo[ms.hash])
return -ENOPKG;
key = request_asymmetric_key(sig, ms.signer_len,