函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\trusted-keys\trusted_tpm1.c Create Date:2022-07-27 20:04:34
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Create an object specific authorisation protocol (OSAP) session

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

返回类型:int

参数:

类型参数名称
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  如果ret不等于TPM_NONCE_SIZE则返回: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  如果ret小于0则返回: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  返回:TSS_rawhmac(secret, key, SHA1_DIGEST_SIZE, TPM_NONCE_SIZE, enonce, TPM_NONCE_SIZE, ononce, 0, 0)
调用者
名称描述
tpm_sealHave the TPM seal(encrypt) the trusted key, possibly based on* Platform Configuration Registers (PCRs). AUTH1 for sealing key.