Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

module: Give 'enum pkey_id_type' a more specific name

This enum originates in generic cryptographic code and has a very
generic name. Nowadays it is only used for module signatures.

As this enum is going to be exposed in a UAPI header, give it a more
specific name for clarity and consistency.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Reviewed-by: Nicolas Schier <nsc@kernel.org>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>

authored by

Thomas Weißschuh and committed by
Sami Tolvanen
acd87264 8988913a

+5 -5
+1 -1
arch/s390/kernel/machine_kexec_file.c
··· 53 53 return -EKEYREJECTED; 54 54 kernel_len -= sig_len; 55 55 56 - if (ms->id_type != PKEY_ID_PKCS7) 56 + if (ms->id_type != MODULE_SIGNATURE_TYPE_PKCS7) 57 57 return -EKEYREJECTED; 58 58 59 59 if (ms->algo != 0 ||
+3 -3
include/linux/module_signature.h
··· 14 14 /* In stripped ARM and x86-64 modules, ~ is surprisingly rare. */ 15 15 #define MODULE_SIG_STRING "~Module signature appended~\n" 16 16 17 - enum pkey_id_type { 18 - PKEY_ID_PKCS7 = 2, /* Signature in PKCS#7 message */ 17 + enum module_signature_type { 18 + MODULE_SIGNATURE_TYPE_PKCS7 = 2, /* Signature in PKCS#7 message */ 19 19 }; 20 20 21 21 /* ··· 31 31 struct module_signature { 32 32 u8 algo; /* Public-key crypto algorithm [0] */ 33 33 u8 hash; /* Digest algorithm [0] */ 34 - u8 id_type; /* Key identifier type [PKEY_ID_PKCS7] */ 34 + u8 id_type; /* Key identifier type [enum module_signature_type] */ 35 35 u8 signer_len; /* Length of signer's name [0] */ 36 36 u8 key_id_len; /* Length of key identifier [0] */ 37 37 u8 __pad[3];
+1 -1
kernel/module_signature.c
··· 24 24 if (be32_to_cpu(ms->sig_len) >= file_len - sizeof(*ms)) 25 25 return -EBADMSG; 26 26 27 - if (ms->id_type != PKEY_ID_PKCS7) { 27 + if (ms->id_type != MODULE_SIGNATURE_TYPE_PKCS7) { 28 28 pr_err("%s: not signed with expected PKCS#7 message\n", 29 29 name); 30 30 return -ENOPKG;