Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\trusted-keys\trusted_tpm1.c Create Date:2022-07-28 18:30:26
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Create an object specific authorisation protocol (OSAP) session

Proto:static int osap(struct tpm_buf *tb, struct osapsess *s, const unsigned char *key, uint16_t type, uint32_t handle)

Type:int

Parameter:

TypeParameterName
struct tpm_buf *tb
struct osapsess *s
const unsigned char *key
uint16_ttype
uint32_thandle
405  ret = tpm_get_random(chip, ononce, TPM_NONCE_SIZE)
406  If ret != TPM_NONCE_SIZE Then Return ret
409  tpm_buf_reset(tb, Command TAGS , TPM_ORD_OSAP)
410  tpm_buf_append_u16(tb, type)
411  tpm_buf_append_u32(tb, handle)
412  tpm_buf_append(tb, ononce, TPM_NONCE_SIZE)
414  ret = For key specific tpm requests, we will generate and send our* own TPM command packets using the drivers send function.
415  If ret < 0 Then Return ret
418  handle = LOAD32(data, TPM_DATA_OFFSET)
419  memcpy(enonce, & (data[TPM_DATA_OFFSET + sizeof(uint32_t)]), TPM_NONCE_SIZE)
421  memcpy(enonce, & (data[TPM_DATA_OFFSET + sizeof(uint32_t) + TPM_NONCE_SIZE]), TPM_NONCE_SIZE)
423  Return TSS_rawhmac(secret, key, SHA1_DIGEST_SIZE, TPM_NONCE_SIZE, enonce, TPM_NONCE_SIZE, ononce, 0, 0)
Caller
NameDescribe
tpm_sealHave the TPM seal(encrypt) the trusted key, possibly based on* Platform Configuration Registers (PCRs). AUTH1 for sealing key.