| 1 |
#ifndef __VTPMMGR_DISK_VTPM_H |
| 2 |
#define __VTPMMGR_DISK_VTPM_H |
| 3 |
#include "vtpm_disk.h" |
| 4 |
|
| 5 |
/* Read PCR values to determine which unseal to try */ |
| 6 |
void TPM_read_pcrs(void); |
| 7 |
void TPM_pcr_digest(struct hash160 *buf, le32_t selection); |
| 8 |
|
| 9 |
/* Sealing for key storage */ |
| 10 |
int TPM_disk_seal(struct disk_seal_entry *dst, const void* src, size_t size); |
| 11 |
int TPM_disk_unseal(void *dst, size_t size, const struct disk_seal_entry *src); |
| 12 |
|
| 13 |
/*TPM 2.0 Bind and Unbind */ |
| 14 |
TPM_RC TPM2_disk_bind(struct disk_seal_entry *dst, void* src, unsigned int size); |
| 15 |
TPM_RC TPM2_disk_unbind(void *dst, unsigned int *size, const struct disk_seal_entry *src); |
| 16 |
|
| 17 |
/* NVRAM to allow revocation of TM-KEY */ |
| 18 |
int TPM_disk_nvalloc(be32_t *nvram_slot, struct tpm_authdata auth); |
| 19 |
int TPM_disk_nvread(void *buf, size_t bufsiz, be32_t nvram_slot, struct tpm_authdata auth); |
| 20 |
int TPM_disk_nvwrite(void *buf, size_t bufsiz, be32_t nvram_slot, struct tpm_authdata auth); |
| 21 |
int TPM_disk_nvchange(be32_t nvram_slot, struct tpm_authdata old, struct tpm_authdata noo); |
| 22 |
|
| 23 |
/* Monotonic counters to detect rollback */ |
| 24 |
int TPM_disk_alloc_counter(be32_t *slot, struct tpm_authdata auth, be32_t *value); |
| 25 |
int TPM_disk_check_counter(be32_t slot, struct tpm_authdata auth, be32_t value); |
| 26 |
int TPM_disk_incr_counter(be32_t slot, struct tpm_authdata auth); |
| 27 |
int TPM_disk_change_counter(be32_t slot, struct tpm_authdata old, struct tpm_authdata noo); |
| 28 |
|
| 29 |
#endif |