TPM_OIAP(3)

NAME
TPM_OIAP, TPM_OSAP, TPM_TerminateHandle - Provides session support with the TPM chip

LIBRARY
tcpa

SYNOPSIS
#include <tcpa.h>
uint32_t
TPM_OIAP(uint32_t *handle, char *enonce, FILE *log);
uint32_t
TPM_OSAP(osapsess *sess, unsigned char *key, uint16_t etype, uint32_t evalue, FILE *log);
uint32_t
TPM_TerminateHandle(uint32_t handle, FILE *log);

DESCRIPTION
OIAP is the Object Independent Access Protocol. OSAP is the Object Specific Access Protocol. OIAP is used to create long-term sessions and can be used across multiple objects within a session. OSAP is used to create sessions that only deal with a single object.

TPM_OIAP() is used to creat an object independent session. It returns a new session handle in *handle, and a new nonce (used to prevent reuse of old sessions) in *enonce.

TPM_OSAP() is used to create an object specific session. This links the session to an object (in this case, a particular key that you want to use). This is necessary whenever a key is needed to perform an operation. evalue is actually the key handle (object) that you are establishing a session to use. etype is either 0x0004 if the object is the Storage Root Key (SRK), or 0x0001 for a normal key. For keys, the value of key should be the key authorization secret (password SHA1 hash). The function returns a new osapsess in sess that can be used in the future for accessing the chip. The osapsess structure is seen below.

    typedef struct osapsess {
        uint32_t handle;
        unsigned char enonce[TCPA_NONCE_SIZE];
        unsigned char enonceOSAP[TCPA_NONCE_SIZE];
        unsigned char ononceOSAP[TCPA_NONCE_SIZE];
        unsigned char ssecret[TCPA_HASH_SIZE];
        unsigned char ononce[TCPA_NONCE_SIZE];
    } osapsess;

The primary elements of interest in this structure are the handle, which is the session handle, enonce, which corresponds to the enonce return value from TPM_OIAP(), and ssecret, which is needed in some places.

When finished with a session, it is proper to terminate this session using the TPM_TerminateHandle() function. It takes the handle that was returned by either TPM_OIAP() or TPM_OSAP().

These 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_GetCapability_Version(3), TPM_TakeOwnership(3), TPM_LoadKey(3), TPM_ReadPubek(3), TPM_Seal(3), TPM_Sign(3)

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