Skip to content

Commit

Permalink
FAPI: Extend policy tests with policy template.
Browse files Browse the repository at this point in the history
The test for policy template sha1 and sha256 was added.

Signed-off-by: Juergen Repp <juergen_repp@web.de>
  • Loading branch information
JuergenReppSIT authored and cplappert committed Dec 15, 2022
1 parent 2642b76 commit c4feff9
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ EXTRA_DIST += \
test/data/fapi/policy/pol_authorize_nv_sha384.json \
test/data/fapi/policy/pol_cphash_sha384.json \
test/data/fapi/policy/pol_pcr16_0_ecc_authorized_sha384.json \
test/data/fapi/policy/pol_template.json \
test/data/fapi/eventlog/binary_measurements_nuc.b64 \
test/data/fapi/eventlog/binary_measurements_pc_client.b64 \
test/data/fapi/eventlog/event.b64 \
Expand Down
44 changes: 44 additions & 0 deletions test/data/fapi/policy/pol_template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"description":"Description pol_template",
"policy":[
{
"type": "POLICYTEMPLATE",
"templatePublic": {
"type":"ECC",
"nameAlg":"sha256",
"objectAttributes":{
"fixedTPM":1,
"stClear":0,
"fixedParent":1,
"sensitiveDataOrigin":1,
"userWithAuth":1,
"adminWithPolicy":0,
"noDA":0,
"encryptedDuplication":0,
"restricted":1,
"decrypt":1,
"sign":0
},
"authPolicy":"",
"parameters":{
"symmetric":{
"algorithm":"AES",
"keyBits":128,
"mode":"CFB"
},
"scheme":{
"scheme":"NULL"
},
"curveID":"NIST_P256",
"kdf":{
"scheme":"NULL"
}
},
"unique":{
"x":"",
"y":""
}
}
}
]
}
3 changes: 3 additions & 0 deletions test/data/test-fapi-policies.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,8 @@ static policy_digests _test_fapi_policy_policies[] = {
{ .path = "/policy/pol_ek_high_range_sha256",
.sha1 = "23694f69a8f33f588a93879021a294f3ed73b361",
.sha256 = "ca3d0a99a2b93906f7a3342414efcfb3a385d44cd1fd459089d19b5071c0b7a0" },
{ .path = "/policy/pol_template",
.sha1 = "acfec8114dee366fa5451cfcbfe2111cf324e18d",
.sha256 = "4f94fe9a608e6efc376ee1589f43581b8eb1fea60fe6ae94d60f88b67312825d" },
};
#endif

0 comments on commit c4feff9

Please sign in to comment.