TPM_SEAL(3)

NAME
TPM_Seal, TPM_Seal_CurrPCR, TPM_Unseal - Uses the TPM chip to seal (encrypt) and unseal data

LIBRARY
tcpa

SYNOPSIS
#include <tcpa.h>
uint32_t
TPM_Seal(uint32_t keyhandle, unsigned char *pcrinfo, uint32_t pcrinfosize, unsigned char *keyauth, unsigned char *dataauth, unsigned char *data, unsigned int datalen, unsigned char *blob, unsigned int *bloblen, FILE *log);
uint32_t
TPM_Seal_CurrPCR(uint32_t keyhandle, uint32_t pcrmap, unsigned char *keyauth, unsigned char *dataauth, unsigned char *data, unsigned int datalen, unsigned char *blob, unsigned int *bloblen, FILE *log);
uint32_t
TPM_Unseal(uint32_t keyhandle, unsigned char *keyauth, unsigned char *dataauth, unsigned char *blob, unsigned int bloblen, unsigned char *data, unsigned int *datalen, FILE *log);

DESCRIPTION
The first two functions, TPM_Seal() and TPM_Seal_CurrPCR() both are used to encrypt data. The difference between normal encryption and “sealing” data is that when sealing data, you can specify that certain Platform Configuration Registers (pcr's) contain certain (their current) values. TPM_Unseal() is used to unseal (decrypt), and the unseal operation will fail if the pcr's do not contain the same values as when it was sealed. In this way, information can only be accessed when the system is in a known state.

For all these function, the key being used to seal or unseal must already be loaded into the TPM chip with key handle keyhandle. In order to access this key, the proper authorization secret (password SHA1 hash) must be passed in as keyauth. The seal / unseal operations also allow the user to specify a second authorization secret that must be known to unseal the data. This is specific to this seal operation, and is passed in as dataauth.

Both TPM_Seal() and TPM_Seal_CurrPCR() take the datalen bytes of data at data and seal them, storing the output in *blob. The length of the output data will be stored in *bloblen.

TPM_Unseal() takes bloblen bytes of data at blog and unseals them (if everything checks out OK), storing the unsealed data at *data. The unsealed data will have length *datalen

The primary difference between TPM_Seal() and TPM_Seal_CurrPCR() is that TPM_Seal_CurrPCR() uses the current values of the pcr's stored in the chip to do the sealing, while TPM_Seal() allows the user to specify values of the pcr's that must be present for unsealing, but are not necessarily present now. pcrmap in TPM_Seal_CurrPCR() is a bitmask specifying which pcr registers to use in sealing. I'm not sure how the pcr's are specified in TPM_Seal().

All three functions take the log parameter. This is used for diagnostic purposed, and outputs debugging information to the FILE log if non-NULL.

RETURN VALUES

SEE ALSO
TPM_Transmit(3), TPM_OIAP(3), TPM_GetCapability_Version(3), TPM_TakeOwnership(3), TPM_LoadKey(3), TPM_ReadPubek(3), TPM_Sign(3)

AUTHORS
Rick Wash <rwash@citi.umich.edu>

BUGS
How are the pcr's specified in TPM_Seal() ?