Skip to content

Commit fe351e8

Browse files
Jarkko SakkinenPeterHuewe
authored andcommitted
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>
1 parent a74f8b3 commit fe351e8

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

include/keys/trusted-type.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212

1313
#include <linux/key.h>
1414
#include <linux/rcupdate.h>
15+
#include <linux/tpm.h>
1516

1617
#define MIN_KEY_SIZE 32
1718
#define MAX_KEY_SIZE 128
1819
#define MAX_BLOB_SIZE 320
20+
#define MAX_PCRINFO_SIZE 64
1921

2022
struct trusted_key_payload {
2123
struct rcu_head rcu;
@@ -26,6 +28,16 @@ struct trusted_key_payload {
2628
unsigned char blob[MAX_BLOB_SIZE];
2729
};
2830

31+
struct 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+
2941
extern struct key_type key_type_trusted;
3042

3143
#endif /* _KEYS_TRUSTED_TYPE_H */

security/keys/trusted.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#define __TRUSTED_KEY_H
33

44
/* implementation specific TPM constants */
5-
#define MAX_PCRINFO_SIZE 64
65
#define MAX_BUF_SIZE 512
76
#define TPM_GETRANDOM_SIZE 14
87
#define TPM_OSAP_SIZE 36
@@ -36,16 +35,6 @@ enum {
3635
SRK_keytype = 4
3736
};
3837

39-
struct 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-
4938
#define TPM_DEBUG 0
5039

5140
#if TPM_DEBUG

0 commit comments

Comments
 (0)