Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:pm2_load_cmd() - execute a TPM2_Load command*@chip: TPM chip to use*@payload: the key data in clear and encrypted form*@options: authentication values and other options*@blob_handle: returned blob handle* Return: 0 on success.

Proto:static int tpm2_load_cmd(struct tpm_chip *chip, struct trusted_key_payload *payload, struct trusted_key_options *options, unsigned int *blob_handle)

Type:int

Parameter:

TypeParameterName
struct tpm_chip *chip
struct trusted_key_payload *payload
struct trusted_key_options *options
unsigned int *blob_handle
187  private_len = be16_to_cpup((__be16 * ) & blob[0])
188  If private_len > blob_len - 2 Then Return -E2BIG
191  public_len = be16_to_cpup((__be16 * ) & blob[2 + private_len])
192  blob_len = private_len + public_len + 4
193  If blob_len > blob_len Then Return -E2BIG
196  rc = tpm_buf_init( & buf, TPM2_ST_SESSIONS, TPM2_CC_LOAD)
197  If rc Then Return rc
200  tpm_buf_append_u32( & buf, keyhandle)
201  pm_buf_append_auth() - append TPMS_AUTH_COMMAND to the buffer
207  tpm_buf_append( & buf, blob, blob_len)
209  If flags & TPM_BUF_OVERFLOW Then
210  rc = -E2BIG
211  Go to out
214  rc = tpm_send(chip, data, tpm_buf_length( & buf))
215  If Not rc Then blob_handle = be32_to_cpup((__be32 * ) & data[TPM_HEADER_SIZE])
219  out :
220  tpm_buf_destroy( & buf)
222  If rc > 0 Then rc = -EPERM
225  Return rc
Caller
NameDescribe
tpm2_unseal_trustedpm2_unseal_trusted() - unseal the payload of a trusted key*@chip: TPM chip to use*@payload: the key data in clear and encrypted form*@options: authentication values and other options* Return: Same as with tpm_send.