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:13
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:pm2_unseal_cmd() - execute a TPM2_Unload command*@chip: TPM chip to use*@payload: the key data in clear and encrypted form*@options: authentication values and other options*@blob_handle: blob handle* Return: 0 on success* -EPERM on tpm error status* < 0

Proto:static int tpm2_unseal_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 intblob_handle
250  rc = tpm_buf_init( & buf, TPM2_ST_SESSIONS, TPM2_CC_UNSEAL)
251  If rc Then Return rc
254  tpm_buf_append_u32( & buf, blob_handle)
255  pm_buf_append_auth() - append TPMS_AUTH_COMMAND to the buffer
263  rc = tpm_send(chip, data, tpm_buf_length( & buf))
264  If rc > 0 Then rc = -EPERM
267  If Not rc Then
268  data_len = be16_to_cpup((__be16 * ) & data[TPM_HEADER_SIZE + 4])
270  If data_len < MIN_KEY_SIZE || data_len > MAX_KEY_SIZE + 1 Then
271  rc = -EFAULT
272  Go to out
275  If tpm_buf_length( & buf) < TPM_HEADER_SIZE + 6 + data_len Then
276  rc = -EFAULT
277  Go to out
279  data = data[TPM_HEADER_SIZE + 6]
281  memcpy(key, data, data_len - 1)
282  key_len = data_len - 1
283  migratable = data[data_len - 1]
286  out :
287  tpm_buf_destroy( & buf)
288  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.