report: Don't create TPM2 attestation key with adminWithPolicy
The default attestation key for the TPM2 report signer is currently
created with an empty policy but with the adminWithPolicy attribute set.
This makes it impossible to authorize use of the key for the ADMIN role,
which is required by TPM2_Certify.
This drops the adminWithPolicy attribute so that it can be authorized
using its (empty) authorization value. This is appropriate for local
style attestation keys ("LAKs"). I've been working on an interface for
managing attestation keys which will support creating an IAK, and this
will have both the adminWithPolicy attribute set and a policy defined as
specified in the TCG "TPM 2.0 Keys for Device Identity and Attestation"
spec.
This commit is contained in:
committed by
Yu Watanabe
parent
21561b5838
commit
fc5875d137
@@ -1842,7 +1842,6 @@ int tpm2_get_best_attestation_key_template(Tpm2Context *c, TPMT_PUBLIC *ret) {
|
||||
TPMA_OBJECT_FIXEDPARENT |
|
||||
TPMA_OBJECT_SENSITIVEDATAORIGIN |
|
||||
TPMA_OBJECT_USERWITHAUTH |
|
||||
TPMA_OBJECT_ADMINWITHPOLICY |
|
||||
TPMA_OBJECT_RESTRICTED |
|
||||
TPMA_OBJECT_SIGN_ENCRYPT,
|
||||
.parameters.asymDetail = {
|
||||
|
||||
@@ -1818,7 +1818,7 @@ static void check_best_attestation_key_template(Tpm2Context *c) {
|
||||
|
||||
ASSERT_TRUE(IN_SET(template.type, TPM2_ALG_RSA, TPM2_ALG_ECC));
|
||||
ASSERT_TRUE(IN_SET(template.nameAlg, TPM2_ALG_SHA256, TPM2_ALG_SHA384));
|
||||
ASSERT_EQ(template.objectAttributes, TPMA_OBJECT_FIXEDTPM | TPMA_OBJECT_FIXEDPARENT | TPMA_OBJECT_SENSITIVEDATAORIGIN | TPMA_OBJECT_USERWITHAUTH | TPMA_OBJECT_ADMINWITHPOLICY | TPMA_OBJECT_RESTRICTED | TPMA_OBJECT_SIGN_ENCRYPT);
|
||||
ASSERT_EQ(template.objectAttributes, TPMA_OBJECT_FIXEDTPM | TPMA_OBJECT_FIXEDPARENT | TPMA_OBJECT_SENSITIVEDATAORIGIN | TPMA_OBJECT_USERWITHAUTH | TPMA_OBJECT_RESTRICTED | TPMA_OBJECT_SIGN_ENCRYPT);
|
||||
ASSERT_EQ(template.parameters.asymDetail.symmetric.algorithm, TPM2_ALG_NULL);
|
||||
ASSERT_NE(template.parameters.asymDetail.scheme.scheme, TPM2_ALG_NULL);
|
||||
ASSERT_TRUE(IN_SET(template.parameters.asymDetail.scheme.details.anySig.hashAlg, TPM2_ALG_SHA256, TPM2_ALG_SHA384));
|
||||
|
||||
Reference in New Issue
Block a user