|
80 | 80 | /* maximum number of names the TPM must remember for authorization */
|
81 | 81 | #define AUTH_MAX_NAMES 3
|
82 | 82 |
|
| 83 | +#define AES_KEY_BYTES AES_KEYSIZE_128 |
| 84 | +#define AES_KEY_BITS (AES_KEY_BYTES*8) |
| 85 | + |
83 | 86 | static int tpm2_create_primary(struct tpm_chip *chip, u32 hierarchy,
|
84 | 87 | u32 *handle, u8 *name);
|
85 | 88 |
|
@@ -954,6 +957,20 @@ int tpm2_start_auth_session(struct tpm_chip *chip)
|
954 | 957 | }
|
955 | 958 | EXPORT_SYMBOL(tpm2_start_auth_session);
|
956 | 959 |
|
| 960 | +/* |
| 961 | + * A mask containing the object attributes for the kernel held null primary key |
| 962 | + * used in HMAC encryption. For more information on specific attributes look up |
| 963 | + * to "8.3 TPMA_OBJECT (Object Attributes)". |
| 964 | + */ |
| 965 | +#define TPM2_OA_NULL_KEY ( \ |
| 966 | + TPM2_OA_NO_DA | \ |
| 967 | + TPM2_OA_FIXED_TPM | \ |
| 968 | + TPM2_OA_FIXED_PARENT | \ |
| 969 | + TPM2_OA_SENSITIVE_DATA_ORIGIN | \ |
| 970 | + TPM2_OA_USER_WITH_AUTH | \ |
| 971 | + TPM2_OA_DECRYPT | \ |
| 972 | + TPM2_OA_RESTRICTED) |
| 973 | + |
957 | 974 | /**
|
958 | 975 | * tpm2_parse_create_primary() - parse the data returned from TPM_CC_CREATE_PRIMARY
|
959 | 976 | *
|
@@ -1018,7 +1035,7 @@ static int tpm2_parse_create_primary(struct tpm_chip *chip, struct tpm_buf *buf,
|
1018 | 1035 | val = tpm_buf_read_u32(buf, &offset_t);
|
1019 | 1036 |
|
1020 | 1037 | /* object properties */
|
1021 |
| - if (val != TPM2_OA_TMPL) |
| 1038 | + if (val != TPM2_OA_NULL_KEY) |
1022 | 1039 | return -EINVAL;
|
1023 | 1040 |
|
1024 | 1041 | /* auth policy (empty) */
|
@@ -1178,7 +1195,7 @@ static int tpm2_create_primary(struct tpm_chip *chip, u32 hierarchy,
|
1178 | 1195 | tpm_buf_append_u16(&template, TPM_ALG_SHA256);
|
1179 | 1196 |
|
1180 | 1197 | /* object properties */
|
1181 |
| - tpm_buf_append_u32(&template, TPM2_OA_TMPL); |
| 1198 | + tpm_buf_append_u32(&template, TPM2_OA_NULL_KEY); |
1182 | 1199 |
|
1183 | 1200 | /* sauth policy (empty) */
|
1184 | 1201 | tpm_buf_append_u16(&template, 0);
|
|
0 commit comments