diff options
Diffstat (limited to 'kernel/module_signing.c')
| -rw-r--r-- | kernel/module_signing.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/module_signing.c b/kernel/module_signing.c index f2970bddc5ea..be5b8fac4bd0 100644 --- a/kernel/module_signing.c +++ b/kernel/module_signing.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <crypto/public_key.h> | 14 | #include <crypto/public_key.h> |
| 15 | #include <crypto/hash.h> | 15 | #include <crypto/hash.h> |
| 16 | #include <keys/asymmetric-type.h> | 16 | #include <keys/asymmetric-type.h> |
| 17 | #include <keys/system_keyring.h> | ||
| 17 | #include "module-internal.h" | 18 | #include "module-internal.h" |
| 18 | 19 | ||
| 19 | /* | 20 | /* |
| @@ -28,7 +29,7 @@ | |||
| 28 | */ | 29 | */ |
| 29 | struct module_signature { | 30 | struct module_signature { |
| 30 | u8 algo; /* Public-key crypto algorithm [enum pkey_algo] */ | 31 | u8 algo; /* Public-key crypto algorithm [enum pkey_algo] */ |
| 31 | u8 hash; /* Digest algorithm [enum pkey_hash_algo] */ | 32 | u8 hash; /* Digest algorithm [enum hash_algo] */ |
| 32 | u8 id_type; /* Key identifier type [enum pkey_id_type] */ | 33 | u8 id_type; /* Key identifier type [enum pkey_id_type] */ |
| 33 | u8 signer_len; /* Length of signer's name */ | 34 | u8 signer_len; /* Length of signer's name */ |
| 34 | u8 key_id_len; /* Length of key identifier */ | 35 | u8 key_id_len; /* Length of key identifier */ |
| @@ -39,7 +40,7 @@ struct module_signature { | |||
| 39 | /* | 40 | /* |
| 40 | * Digest the module contents. | 41 | * Digest the module contents. |
| 41 | */ | 42 | */ |
| 42 | static struct public_key_signature *mod_make_digest(enum pkey_hash_algo hash, | 43 | static struct public_key_signature *mod_make_digest(enum hash_algo hash, |
| 43 | const void *mod, | 44 | const void *mod, |
| 44 | unsigned long modlen) | 45 | unsigned long modlen) |
| 45 | { | 46 | { |
| @@ -54,7 +55,7 @@ static struct public_key_signature *mod_make_digest(enum pkey_hash_algo hash, | |||
| 54 | /* Allocate the hashing algorithm we're going to need and find out how | 55 | /* Allocate the hashing algorithm we're going to need and find out how |
| 55 | * big the hash operational data will be. | 56 | * big the hash operational data will be. |
| 56 | */ | 57 | */ |
| 57 | tfm = crypto_alloc_shash(pkey_hash_algo[hash], 0, 0); | 58 | tfm = crypto_alloc_shash(hash_algo_name[hash], 0, 0); |
| 58 | if (IS_ERR(tfm)) | 59 | if (IS_ERR(tfm)) |
| 59 | return (PTR_ERR(tfm) == -ENOENT) ? ERR_PTR(-ENOPKG) : ERR_CAST(tfm); | 60 | return (PTR_ERR(tfm) == -ENOENT) ? ERR_PTR(-ENOPKG) : ERR_CAST(tfm); |
| 60 | 61 | ||
| @@ -157,7 +158,7 @@ static struct key *request_asymmetric_key(const char *signer, size_t signer_len, | |||
| 157 | 158 | ||
| 158 | pr_debug("Look up: \"%s\"\n", id); | 159 | pr_debug("Look up: \"%s\"\n", id); |
| 159 | 160 | ||
| 160 | key = keyring_search(make_key_ref(modsign_keyring, 1), | 161 | key = keyring_search(make_key_ref(system_trusted_keyring, 1), |
| 161 | &key_type_asymmetric, id); | 162 | &key_type_asymmetric, id); |
| 162 | if (IS_ERR(key)) | 163 | if (IS_ERR(key)) |
| 163 | pr_warn("Request for unknown module key '%s' err %ld\n", | 164 | pr_warn("Request for unknown module key '%s' err %ld\n", |
| @@ -217,7 +218,7 @@ int mod_verify_sig(const void *mod, unsigned long *_modlen) | |||
| 217 | return -ENOPKG; | 218 | return -ENOPKG; |
| 218 | 219 | ||
| 219 | if (ms.hash >= PKEY_HASH__LAST || | 220 | if (ms.hash >= PKEY_HASH__LAST || |
| 220 | !pkey_hash_algo[ms.hash]) | 221 | !hash_algo_name[ms.hash]) |
| 221 | return -ENOPKG; | 222 | return -ENOPKG; |
| 222 | 223 | ||
| 223 | key = request_asymmetric_key(sig, ms.signer_len, | 224 | key = request_asymmetric_key(sig, ms.signer_len, |
