aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2015-06-12 17:34:01 -0400
committerPeter Huewe <peterhuewe@gmx.de>2015-10-18 19:01:21 -0400
commitfe351e8d4eec801beeba1df1f36d76316be6f1a2 (patch)
treecc20c7855bad077522788bc7f1eaf16f4a5584fb
parenta74f8b36352e79b13d48fa92759c9ea6b78d5817 (diff)
keys, trusted: move struct trusted_key_options to trusted-type.h
Moved struct trusted_key_options to trustes-type.h so that the fields can be accessed from drivers/char/tpm. Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
-rw-r--r--include/keys/trusted-type.h12
-rw-r--r--security/keys/trusted.h11
2 files changed, 12 insertions, 11 deletions
diff --git a/include/keys/trusted-type.h b/include/keys/trusted-type.h
index 56f82e5c9975..c91651f91687 100644
--- a/include/keys/trusted-type.h
+++ b/include/keys/trusted-type.h
@@ -12,10 +12,12 @@
12 12
13#include <linux/key.h> 13#include <linux/key.h>
14#include <linux/rcupdate.h> 14#include <linux/rcupdate.h>
15#include <linux/tpm.h>
15 16
16#define MIN_KEY_SIZE 32 17#define MIN_KEY_SIZE 32
17#define MAX_KEY_SIZE 128 18#define MAX_KEY_SIZE 128
18#define MAX_BLOB_SIZE 320 19#define MAX_BLOB_SIZE 320
20#define MAX_PCRINFO_SIZE 64
19 21
20struct trusted_key_payload { 22struct trusted_key_payload {
21 struct rcu_head rcu; 23 struct rcu_head rcu;
@@ -26,6 +28,16 @@ struct trusted_key_payload {
26 unsigned char blob[MAX_BLOB_SIZE]; 28 unsigned char blob[MAX_BLOB_SIZE];
27}; 29};
28 30
31struct trusted_key_options {
32 uint16_t keytype;
33 uint32_t keyhandle;
34 unsigned char keyauth[TPM_DIGEST_SIZE];
35 unsigned char blobauth[TPM_DIGEST_SIZE];
36 uint32_t pcrinfo_len;
37 unsigned char pcrinfo[MAX_PCRINFO_SIZE];
38 int pcrlock;
39};
40
29extern struct key_type key_type_trusted; 41extern struct key_type key_type_trusted;
30 42
31#endif /* _KEYS_TRUSTED_TYPE_H */ 43#endif /* _KEYS_TRUSTED_TYPE_H */
diff --git a/security/keys/trusted.h b/security/keys/trusted.h
index 3249fbd2b653..ff001a5dcb24 100644
--- a/security/keys/trusted.h
+++ b/security/keys/trusted.h
@@ -2,7 +2,6 @@
2#define __TRUSTED_KEY_H 2#define __TRUSTED_KEY_H
3 3
4/* implementation specific TPM constants */ 4/* implementation specific TPM constants */
5#define MAX_PCRINFO_SIZE 64
6#define MAX_BUF_SIZE 512 5#define MAX_BUF_SIZE 512
7#define TPM_GETRANDOM_SIZE 14 6#define TPM_GETRANDOM_SIZE 14
8#define TPM_OSAP_SIZE 36 7#define TPM_OSAP_SIZE 36
@@ -36,16 +35,6 @@ enum {
36 SRK_keytype = 4 35 SRK_keytype = 4
37}; 36};
38 37
39struct trusted_key_options {
40 uint16_t keytype;
41 uint32_t keyhandle;
42 unsigned char keyauth[SHA1_DIGEST_SIZE];
43 unsigned char blobauth[SHA1_DIGEST_SIZE];
44 uint32_t pcrinfo_len;
45 unsigned char pcrinfo[MAX_PCRINFO_SIZE];
46 int pcrlock;
47};
48
49#define TPM_DEBUG 0 38#define TPM_DEBUG 0
50 39
51#if TPM_DEBUG 40#if TPM_DEBUG