summaryrefslogtreecommitdiffstats
path: root/include/keys
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2016-04-06 11:14:24 -0400
committerDavid Howells <dhowells@redhat.com>2016-04-06 11:14:24 -0400
commite68503bd6836ba765dc8e0ee77ea675fedc07e41 (patch)
tree31ebec81d2f52adc89796dd063468235bfd1cc0e /include/keys
parentad3043fda39db0361d9601685356db4512e914be (diff)
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 'include/keys')
-rw-r--r--include/keys/asymmetric-type.h1
-rw-r--r--include/keys/system_keyring.h7
2 files changed, 2 insertions, 6 deletions
diff --git a/include/keys/asymmetric-type.h b/include/keys/asymmetric-type.h
index 70a8775bb444..d1e23dda4363 100644
--- a/include/keys/asymmetric-type.h
+++ b/include/keys/asymmetric-type.h
@@ -15,6 +15,7 @@
15#define _KEYS_ASYMMETRIC_TYPE_H 15#define _KEYS_ASYMMETRIC_TYPE_H
16 16
17#include <linux/key-type.h> 17#include <linux/key-type.h>
18#include <linux/verification.h>
18 19
19extern struct key_type key_type_asymmetric; 20extern struct key_type key_type_asymmetric;
20 21
diff --git a/include/keys/system_keyring.h b/include/keys/system_keyring.h
index 39fd38cfa8c9..b2d645ac35a0 100644
--- a/include/keys/system_keyring.h
+++ b/include/keys/system_keyring.h
@@ -15,6 +15,7 @@
15#ifdef CONFIG_SYSTEM_TRUSTED_KEYRING 15#ifdef CONFIG_SYSTEM_TRUSTED_KEYRING
16 16
17#include <linux/key.h> 17#include <linux/key.h>
18#include <linux/verification.h>
18#include <crypto/public_key.h> 19#include <crypto/public_key.h>
19 20
20extern struct key *system_trusted_keyring; 21extern struct key *system_trusted_keyring;
@@ -29,12 +30,6 @@ static inline struct key *get_system_trusted_keyring(void)
29} 30}
30#endif 31#endif
31 32
32#ifdef CONFIG_SYSTEM_DATA_VERIFICATION
33extern int system_verify_data(const void *data, unsigned long len,
34 const void *raw_pkcs7, size_t pkcs7_len,
35 enum key_being_used_for usage);
36#endif
37
38#ifdef CONFIG_IMA_MOK_KEYRING 33#ifdef CONFIG_IMA_MOK_KEYRING
39extern struct key *ima_mok_keyring; 34extern struct key *ima_mok_keyring;
40extern struct key *ima_blacklist_keyring; 35extern struct key *ima_blacklist_keyring;