-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yogesh Deshpande <[email protected]>
- Loading branch information
1 parent
f404bcb
commit 37b1882
Showing
11 changed files
with
622 additions
and
12 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
# Copyright 2022-2024 Contributors to the Veraison project. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -eu | ||
set -o pipefail | ||
|
||
# function generate_go_test_vector constructs CBOR test vector using | ||
# supplied comid and corim json template and saves them in a file | ||
# $1 file name for comid json template, example one of COMID_TEMPLATES | ||
# $2 file name for corim json template, example CORIM_TEMPLATE | ||
# $3 a qualifier for each cbor test vector name | ||
# $4 name of the file where the generated CBOR test vectors are aggregated | ||
generate_go_test_vector () { | ||
echo "generating test vector using $1 $2" | ||
cocli comid create -t $1.json | ||
cocli corim create -m $1.cbor -t $2 -o corim$1.cbor | ||
echo "// automatically generated from:" >> $4 | ||
echo "// $1.json and $2" >> $4 | ||
echo "var $3$1 = "'`' >> $4 | ||
cat corim$1.cbor | xxd -p >> $4 | ||
echo '`' >> $4 | ||
} | ||
|
||
CORIM_TEMPLATE="corimCcaRealm.json" | ||
|
||
COMID_TEMPLATES= | ||
COMID_TEMPLATES="${COMID_TEMPLATES} comidCcaRealm" | ||
COMID_TEMPLATES="${COMID_TEMPLATES} comidCcaRealmNoClass" | ||
COMID_TEMPLATES="${COMID_TEMPLATES} comidCcaRealmNoInstance" | ||
COMID_TEMPLATES="${COMID_TEMPLATES} comidCcaRealmInvalidInstance" | ||
COMID_TEMPLATES="${COMID_TEMPLATES} comidCcaRealmInvalidClass" | ||
|
||
TV_DOT_GO=${TV_DOT_GO?must be set in the environment.} | ||
|
||
printf "package cca\n\n" > ${TV_DOT_GO} | ||
|
||
for t in ${COMID_TEMPLATES} | ||
do | ||
generate_go_test_vector $t $CORIM_TEMPLATE "unsignedCorim" $TV_DOT_GO | ||
done | ||
|
||
gofmt -w $TV_DOT_GO |
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,79 @@ | ||
{ | ||
"lang": "en-GB", | ||
"tag-identity": { | ||
"id": "43BBE37F-2E61-4B33-AED3-53CFF1428B16", | ||
"version": 0 | ||
}, | ||
"entities": [ | ||
{ | ||
"name": "Workload Client Ltd.", | ||
"regid": "https://workloadclient.example", | ||
"roles": [ | ||
"tagCreator", | ||
"creator", | ||
"maintainer" | ||
] | ||
} | ||
], | ||
"triples": { | ||
"reference-values": [ | ||
{ | ||
"environment": { | ||
"class": { | ||
"id": { | ||
"type": "uuid", | ||
"value": "CD1F0E55-26F9-460D-B9D8-F7FDE171787C" | ||
}, | ||
"vendor": "Workload Client Ltd" | ||
}, | ||
"instance": { | ||
"type": "bytes", | ||
"value": "QoS1aUymwNLPR4mguVrIAlyBjeUjBDZL580pgbLS7caFsyInfsJYGZYkE9jJssH1" | ||
} | ||
}, | ||
"measurements": [ | ||
{ | ||
"value": { | ||
"raw-value": { | ||
"type": "bytes", | ||
"value": "5Fty9cDAtXLbTY06t+l/No/3TmI0eoJN7LZ6hOUiTXXkW3L1wMC1cttNjTq36X82j/dOYjR6gk3stnqE5SJNdQ==" | ||
}, | ||
"integrity-registers": { | ||
"rim": { | ||
"key-type": "text", | ||
"value": [ | ||
"sha-384;QoS1aUymwNLPR4mguVrIAlyBjeUjBDZL580pgbLS7caFsyInfsJYGZYkE9jJssH1" | ||
] | ||
}, | ||
"rem0": { | ||
"key-type": "text", | ||
"value": [ | ||
"sha-384;IQe752H8pS2VE2oTVNt6TdV7Gya+DT2nHZ6yOYazS6YVq/ZRTPNeWp6lWgMtBop4" | ||
] | ||
}, | ||
"rem1": { | ||
"key-type": "text", | ||
"value": [ | ||
"sha-384;JQe752H8pS2VE2oTVNt6TdV7Gya+DT2nHZ6yOYazS6YVq/ZRTPNeWp6lWgMtBop4" | ||
] | ||
}, | ||
"rem2": { | ||
"key-type": "text", | ||
"value": [ | ||
"sha-384;MQe752H8pS2VE2oTVNt6TdV7Gya+DT2nHZ6yOYazS6YVq/ZRTPNeWp6lWgMtBop4" | ||
] | ||
}, | ||
"rem3": { | ||
"key-type": "text", | ||
"value": [ | ||
"sha-384;NQe752H8pS2VE2oTVNt6TdV7Gya+DT2nHZ6yOYazS6YVq/ZRTPNeWp6lWgMtBop4" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
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,79 @@ | ||
{ | ||
"lang": "en-GB", | ||
"tag-identity": { | ||
"id": "43BBE37F-2E61-4B33-AED3-53CFF1428B16", | ||
"version": 0 | ||
}, | ||
"entities": [ | ||
{ | ||
"name": "Workload Client Ltd.", | ||
"regid": "https://workloadclient.example", | ||
"roles": [ | ||
"tagCreator", | ||
"creator", | ||
"maintainer" | ||
] | ||
} | ||
], | ||
"triples": { | ||
"reference-values": [ | ||
{ | ||
"environment": { | ||
"class": { | ||
"id": { | ||
"type": "psa.impl-id", | ||
"value": "YWNtZS1pbXBsZW1lbnRhdGlvbi1pZC0wMDAwMDAwMDE=" | ||
}, | ||
"vendor": "ACME" | ||
}, | ||
"instance": { | ||
"type": "bytes", | ||
"value": "QoS1aUymwNLPR4mguVrIAlyBjeUjBDZL580pgbLS7caFsyInfsJYGZYkE9jJssH1" | ||
} | ||
}, | ||
"measurements": [ | ||
{ | ||
"value": { | ||
"raw-value": { | ||
"type": "bytes", | ||
"value": "5Fty9cDAtXLbTY06t+l/No/3TmI0eoJN7LZ6hOUiTXXkW3L1wMC1cttNjTq36X82j/dOYjR6gk3stnqE5SJNdQ==" | ||
}, | ||
"integrity-registers": { | ||
"rim": { | ||
"key-type": "text", | ||
"value": [ | ||
"sha-384;QoS1aUymwNLPR4mguVrIAlyBjeUjBDZL580pgbLS7caFsyInfsJYGZYkE9jJssH1" | ||
] | ||
}, | ||
"rem0": { | ||
"key-type": "text", | ||
"value": [ | ||
"sha-384;IQe752H8pS2VE2oTVNt6TdV7Gya+DT2nHZ6yOYazS6YVq/ZRTPNeWp6lWgMtBop4" | ||
] | ||
}, | ||
"rem1": { | ||
"key-type": "text", | ||
"value": [ | ||
"sha-384;JQe752H8pS2VE2oTVNt6TdV7Gya+DT2nHZ6yOYazS6YVq/ZRTPNeWp6lWgMtBop4" | ||
] | ||
}, | ||
"rem2": { | ||
"key-type": "text", | ||
"value": [ | ||
"sha-384;MQe752H8pS2VE2oTVNt6TdV7Gya+DT2nHZ6yOYazS6YVq/ZRTPNeWp6lWgMtBop4" | ||
] | ||
}, | ||
"rem3": { | ||
"key-type": "text", | ||
"value": [ | ||
"sha-384;NQe752H8pS2VE2oTVNt6TdV7Gya+DT2nHZ6yOYazS6YVq/ZRTPNeWp6lWgMtBop4" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
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,75 @@ | ||
{ | ||
"lang": "en-GB", | ||
"tag-identity": { | ||
"id": "43BBE37F-2E61-4B33-AED3-53CFF1428B16", | ||
"version": 0 | ||
}, | ||
"entities": [ | ||
{ | ||
"name": "Workload Client Ltd.", | ||
"regid": "https://workloadclient.example", | ||
"roles": [ | ||
"tagCreator", | ||
"creator", | ||
"maintainer" | ||
] | ||
} | ||
], | ||
"triples": { | ||
"reference-values": [ | ||
{ | ||
"environment": { | ||
"class": { | ||
"id": { | ||
"type": "uuid", | ||
"value": "CD1F0E55-26F9-460D-B9D8-F7FDE171787C" | ||
}, | ||
"vendor": "Workload Client Ltd" | ||
}, | ||
"instance": { | ||
"type": "ueid", | ||
"value": "Ac7rrnuJJ6MiflMDz14PH3s0u1Qq1yUKwD+83jbsLxUI" | ||
} | ||
}, | ||
"measurements": [ | ||
{ | ||
"value": { | ||
"integrity-registers": { | ||
"rim": { | ||
"key-type": "text", | ||
"value": [ | ||
"sha-384;QoS1aUymwNLPR4mguVrIAlyBjeUjBDZL580pgbLS7caFsyInfsJYGZYkE9jJssH1" | ||
] | ||
}, | ||
"rem0": { | ||
"key-type": "text", | ||
"value": [ | ||
"sha-384;IQe752H8pS2VE2oTVNt6TdV7Gya+DT2nHZ6yOYazS6YVq/ZRTPNeWp6lWgMtBop4" | ||
] | ||
}, | ||
"rem1": { | ||
"key-type": "text", | ||
"value": [ | ||
"sha-384;JQe752H8pS2VE2oTVNt6TdV7Gya+DT2nHZ6yOYazS6YVq/ZRTPNeWp6lWgMtBop4" | ||
] | ||
}, | ||
"rem2": { | ||
"key-type": "text", | ||
"value": [ | ||
"sha-384;MQe752H8pS2VE2oTVNt6TdV7Gya+DT2nHZ6yOYazS6YVq/ZRTPNeWp6lWgMtBop4" | ||
] | ||
}, | ||
"rem3": { | ||
"key-type": "text", | ||
"value": [ | ||
"sha-384;NQe752H8pS2VE2oTVNt6TdV7Gya+DT2nHZ6yOYazS6YVq/ZRTPNeWp6lWgMtBop4" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.