-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scheme/tpm-enacttrust: validate TA on submission
Evidence handler for tpm-enacttrust expects the provisioned trust anchor to be a base64-encoded PKIX public key. Add validation on the provisioning side to make sure that that is the case. Signed-off-by: Sergei Trofimov <[email protected]>
- Loading branch information
Showing
6 changed files
with
100 additions
and
1 deletion.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
integration-tests/data/endorsements/comid-enacttrust-badta.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"tag-identity": { | ||
"id": "00000000-0000-0000-0000-000000000000" | ||
}, | ||
"entities": [ | ||
{ | ||
"name": "EnactTrust", | ||
"regid": "https://enacttrust.com", | ||
"roles": [ | ||
"tagCreator", | ||
"creator", | ||
"maintainer" | ||
] | ||
} | ||
], | ||
"triples": { | ||
"attester-verification-keys": [ | ||
{ | ||
"environment": { | ||
"instance": { | ||
"type": "uuid", | ||
"value": "7df7714e-aa04-4638-bcbf-434b1dd720f1" | ||
} | ||
}, | ||
"verification-keys": [ | ||
{ | ||
"key": "@@@@" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
integration-tests/tests/test_enacttrust_badkey.tavern.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
test_name: enacttrust-badkey | ||
|
||
marks: | ||
- parametrize: | ||
key: | ||
# Attestation scheme -- this is used to indicate how test cases should | ||
# be constructed (e.g. how the evidence token will be compiled. | ||
- scheme | ||
# Some attestation schemes (currently, only PSA) may support multiple | ||
# profiles. If a scheme does not support multiple profiles, specify it | ||
# as '_'. | ||
- profile | ||
# The name of the endorsements spec within common.yaml | ||
- endorsements | ||
# Signing keys that will be used to construct the evidence. How this is | ||
# used is dependent on the scheme. | ||
- signing | ||
vals: | ||
- [enacttrust, _, mini-bad, ec.p256.enacttrust] | ||
|
||
includes: | ||
- !include common.yaml | ||
|
||
stages: | ||
- name: submit post request to the provisioning service successfully | ||
request: | ||
method: POST | ||
url: http://{provisioning-service}/endorsement-provisioning/v1/submit | ||
headers: | ||
content-type: '{endorsements-content-type}' # set via hook | ||
file_body: __generated__/endorsements/corim-{scheme}-{endorsements}.cbor | ||
response: | ||
status_code: 200 | ||
json: | ||
status: failed | ||
failure-reason: 'submit endorsement returned error: submit endorsements failed: RPC server returned error: plugin "unsigned-corim (TPM EnactTrust profile)" returned error: bad key in CoMID at index 0: could not base64-decode ak-pub: illegal base64 data at input byte 0' | ||
# NOTE: the commented version below is for builtin plugins. | ||
#failure-reason: 'submit endorsement returned error: submit endorsements failed: bad key in CoMID at index 0: could not base64-decode ak-pub: illegal base64 data at input byte 0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters