Go to the documentation of this file. 1 #ifndef __TRUSTED_KEY_H
2 #define __TRUSTED_KEY_H
5 #define MAX_PCRINFO_SIZE 64
6 #define MAX_BUF_SIZE 512
7 #define TPM_GETRANDOM_SIZE 14
8 #define TPM_OSAP_SIZE 36
9 #define TPM_OIAP_SIZE 10
10 #define TPM_SEAL_SIZE 87
11 #define TPM_UNSEAL_SIZE 104
12 #define TPM_SIZE_OFFSET 2
13 #define TPM_RETURN_OFFSET 6
14 #define TPM_DATA_OFFSET 10
16 #define LOAD32(buffer, offset) (ntohl(*(uint32_t *)&buffer[offset]))
17 #define LOAD32N(buffer, offset) (*(uint32_t *)&buffer[offset])
18 #define LOAD16(buffer, offset) (ntohs(*(uint16_t *)&buffer[offset]))
25 #define INIT_BUF(tb) (tb->len = 0)
73 static inline void dump_sess(
struct osapsess *
s)
77 pr_info(
"trusted-key: secret:\n");
80 pr_info(
"trusted-key: enonce:\n");
85 static inline void dump_tpm_buf(
unsigned char *
buf)
89 pr_info(
"\ntrusted-key: tpm buffer\n");
102 static inline void dump_sess(
struct osapsess *
s)
106 static inline void dump_tpm_buf(
unsigned char *
buf)
111 static inline void store8(
struct tpm_buf *
buf,
const unsigned char value)
128 static inline void storebytes(
struct tpm_buf *buf,
const unsigned char *
in,