函数逻辑报告 |
Source Code:security\keys\trusted-keys\trusted_tpm2.c |
Create Date:2022-07-27 20:06:07 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:pm2_seal_trusted() - seal 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: < 0 on error and 0 on success.
函数原型:int tpm2_seal_trusted(struct tpm_chip *chip, struct trusted_key_payload *payload, struct trusted_key_options *options)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct tpm_chip * | chip | |
struct trusted_key_payload * | payload | |
struct trusted_key_options * | options |
79 | 如果i恒等于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(tpm2_hash_map)则返回:负EINVAL |
82 | rc等于tpm_buf_init( & buf, TPM2_ST_SESSIONS, TPM2_CC_CREATE) |
86 | tpm_buf_append_u32( & buf, keyhandle) |
94 | tpm_buf_append_u16( & buf, 4 + Max TPM v1.2 PCR size + key_len + 1) |
96 | tpm_buf_append_u16( & buf, Max TPM v1.2 PCR size ) |
97 | tpm_buf_append( & buf, blobauth, Max TPM v1.2 PCR size ) |
98 | tpm_buf_append_u16( & buf, key_len + 1) |
99 | tpm_buf_append( & buf, key, key_len) |
100 | tpm_buf_append_u8( & buf, migratable) |
103 | tpm_buf_append_u16( & buf, 14 + policydigest_len) |
104 | tpm_buf_append_u16( & buf, TPM_ALG_KEYEDHASH) |
105 | tpm_buf_append_u16( & buf, hash) |
108 | 如果policydigest_len则 |
109 | tpm_buf_append_u32( & buf, 0) |
110 | tpm_buf_append_u16( & buf, policydigest_len) |
111 | tpm_buf_append( & buf, policydigest, policydigest_len) |
113 | 否则 |
114 | tpm_buf_append_u32( & buf, TPM2_OA_USER_WITH_AUTH) |
115 | tpm_buf_append_u16( & buf, 0) |
119 | tpm_buf_append_u16( & buf, TPM_ALG_NULL) |
120 | tpm_buf_append_u16( & buf, 0) |
123 | tpm_buf_append_u16( & buf, 0) |
126 | tpm_buf_append_u32( & buf, 0) |
128 | 如果flags按位与TPM_BUF_OVERFLOW则 |
137 | blob_len等于be32_to_cpup((__be32 * ) & data[TPM_HEADER_SIZE]) |
138 | 如果blob_len大于MAX_BLOB_SIZE则 |
142 | 如果tpm_buf_length( & buf)小于TPM_HEADER_SIZE加4加blob_len则 |
147 | memcpy(blob, & data[TPM_HEADER_SIZE + 4], blob_len) |
150 | out : |
151 | tpm_buf_destroy( & buf) |
153 | 如果rc大于0则 |
160 | 返回:rc |
名称 | 描述 |
---|---|
trusted_instantiate | rusted_instantiate - create a new trusted key* Unseal an existing trusted blob or, for a new key, get a* random key, then seal and create a trusted key-type key,* adding it to the specified keyring.* On success, return 0. Otherwise return errno. |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |