From 7caa4d97e5193b381526e045a4ebbaeb61852907 Mon Sep 17 00:00:00 2001 From: Yogesh Deshpande Date: Tue, 8 Oct 2024 17:50:01 +0100 Subject: [PATCH] fix! Rebase to latest of CoRIM Signed-off-by: Yogesh Deshpande --- deployments/docker/src/builder.docker | 2 +- end-to-end/input/cca-endorsements.cbor | Bin 1344 -> 1105 bytes end-to-end/input/cca-realm-endorsements.cbor | Bin 761 -> 762 bytes end-to-end/input/psa-endorsements.cbor | Bin 952 -> 833 bytes .../input/src/comid-cca-realm-refval.json | 76 +++++---- end-to-end/input/src/comid-cca-refval.json | 158 ++++++----------- end-to-end/input/src/comid-psa-refval.json | 94 ++++------ go.mod | 2 +- go.sum | 4 +- .../comid-cca-platform-refval.json | 160 +++++++----------- .../endorsements/comid-cca-realm-refval.json | 76 +++++---- .../data/endorsements/comid-cca-refval.json | 160 +++++++----------- .../endorsements/comid-enacttrust-refval.json | 14 +- .../data/endorsements/comid-psa-refval.json | 94 ++++------ .../arm-cca/test/corim/src/comidCcaRealm.json | 76 +++++---- .../corim/src/comidCcaRealmInvalidClass.json | 76 +++++---- .../src/comidCcaRealmInvalidInstance.json | 70 ++++---- .../test/corim/src/comidCcaRealmNoClass.json | 70 ++++---- .../corim/src/comidCcaRealmNoInstance.json | 70 ++++---- .../test/corim/src/comidCcaRefValFour.json | 126 +++++--------- .../test/corim/src/comidCcaRefValOne.json | 22 +-- .../unsignedCorimCcaComidCcaRefValFour.cbor | Bin 847 -> 668 bytes .../unsignedCorimCcaComidCcaRefValOne.cbor | Bin 386 -> 387 bytes ...edCorimCcaNoProfileComidCcaRefValFour.cbor | Bin 820 -> 641 bytes ...nedCorimCcaNoProfileComidCcaRefValOne.cbor | Bin 359 -> 360 bytes .../unsignedCorimCcaRealmComidCcaRealm.cbor | Bin 665 -> 666 bytes ...orimCcaRealmComidCcaRealmInvalidClass.cbor | Bin 668 -> 669 bytes ...mCcaRealmComidCcaRealmInvalidInstance.cbor | Bin 580 -> 581 bytes ...gnedCorimCcaRealmComidCcaRealmNoClass.cbor | Bin 552 -> 553 bytes ...dCorimCcaRealmComidCcaRealmNoInstance.cbor | Bin 541 -> 542 bytes .../common/cca/platform/cca_ssd_extractor.go | 75 ++++---- scheme/common/cca/realm/realm_extractor.go | 35 ++-- .../corim/src/ComidParsecCcaMultRefVal.json | 122 +++++-------- .../corim/src/ComidParsecCcaRefValOne.json | 24 +-- ...orimParsecCcaComidParsecCcaMultRefVal.cbor | Bin 1026 -> 787 bytes ...CorimParsecCcaComidParsecCcaRefValOne.cbor | Bin 407 -> 408 bytes scheme/parsec-tpm/corim_extractor.go | 43 +++-- .../corim/src/ComidParsecTpmPcrsGood.json | 56 +++--- .../corim/src/ComidParsecTpmPcrsNoClass.json | 56 +++--- .../src/ComidParsecTpmPcrsNoDigests.json | 18 +- .../corim/src/ComidParsecTpmPcrsNoPCR.json | 42 ++--- .../src/ComidParsecTpmPcrsUnknownPCRType.json | 54 +++--- ...signedCorimMiniComidParsecTpmPcrsGood.cbor | Bin 391 -> 368 bytes ...nedCorimMiniComidParsecTpmPcrsNoClass.cbor | Bin 425 -> 385 bytes ...dCorimMiniComidParsecTpmPcrsNoDigests.cbor | Bin 187 -> 188 bytes ...ignedCorimMiniComidParsecTpmPcrsNoPCR.cbor | Bin 387 -> 364 bytes ...mMiniComidParsecTpmPcrsUnknownPCRType.cbor | Bin 427 -> 404 bytes scheme/psa-iot/corim_extractor.go | 49 +++--- .../corim/src/ComidPsaRefValMultDigest.json | 30 ++-- .../corim/src/ComidPsaRefValNoImplID.json | 26 +-- .../test/corim/src/ComidPsaRefValNoMkey.json | 30 ++-- .../test/corim/src/ComidPsaRefValOne.cbor | Bin 0 -> 228 bytes .../test/corim/src/ComidPsaRefValOne.json | 26 +-- .../src/ComidPsaRefValOnlyMandIDAttr.json | 22 +-- .../test/corim/src/ComidPsaRefValThree.json | 32 +--- ...signedCorimCorimMiniComidPsaIakPubOne.cbor | Bin 383 -> 0 bytes ...signedCorimCorimMiniComidPsaIakPubTwo.cbor | Bin 664 -> 0 bytes ...gnedCorimMiniComidPsaRefValMultDigest.cbor | Bin 317 -> 318 bytes ...signedCorimMiniComidPsaRefValNoImplID.cbor | Bin 253 -> 254 bytes ...unsignedCorimMiniComidPsaRefValNoMkey.cbor | Bin 234 -> 235 bytes .../unsignedCorimMiniComidPsaRefValOne.cbor | Bin 280 -> 281 bytes ...CorimMiniComidPsaRefValOnlyMandIDAttr.cbor | Bin 269 -> 270 bytes .../unsignedCorimMiniComidPsaRefValThree.cbor | Bin 589 -> 470 bytes scheme/tpm-enacttrust/extractor.go | 5 +- .../corim/src/ComidTpmEnactTrustBadInst.json | 14 +- .../src/ComidTpmEnactTrustGoldenOne.json | 14 +- .../src/ComidTpmEnactTrustGoldenTwo.json | 36 ++-- .../src/ComidTpmEnactTrustMultDigest.json | 16 +- .../corim/src/ComidTpmEnactTrustNoDigest.json | 12 +- .../corim/src/ComidTpmEnactTrustNoInst.json | 14 +- ...nedCorimMiniComidTpmEnactTrustBadInst.cbor | Bin 219 -> 220 bytes ...dCorimMiniComidTpmEnactTrustGoldenOne.cbor | Bin 200 -> 201 bytes ...dCorimMiniComidTpmEnactTrustGoldenTwo.cbor | Bin 263 -> 242 bytes ...CorimMiniComidTpmEnactTrustMultDigest.cbor | Bin 236 -> 237 bytes ...edCorimMiniComidTpmEnactTrustNoDigest.cbor | Bin 188 -> 189 bytes ...gnedCorimMiniComidTpmEnactTrustNoInst.cbor | Bin 238 -> 239 bytes 76 files changed, 964 insertions(+), 1237 deletions(-) create mode 100644 scheme/psa-iot/test/corim/src/ComidPsaRefValOne.cbor delete mode 100644 scheme/psa-iot/test/corim/unsignedCorimCorimMiniComidPsaIakPubOne.cbor delete mode 100644 scheme/psa-iot/test/corim/unsignedCorimCorimMiniComidPsaIakPubTwo.cbor diff --git a/deployments/docker/src/builder.docker b/deployments/docker/src/builder.docker index bf8c152e..9d18e2b7 100644 --- a/deployments/docker/src/builder.docker +++ b/deployments/docker/src/builder.docker @@ -60,7 +60,7 @@ RUN go mod download &&\ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26 &&\ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1 &&\ go install github.com/mitchellh/protoc-gen-go-json@v1.1.0 &&\ - go install github.com/veraison/corim/cocli@be7ec482 &&\ + go install github.com/veraison/cocli@4eada925 &&\ go install github.com/veraison/evcli/v2@86d12893 &&\ go install github.com/veraison/pocli@v0.2.0 &&\ go install github.com/go-delve/delve/cmd/dlv@v1.22.1 diff --git a/end-to-end/input/cca-endorsements.cbor b/end-to-end/input/cca-endorsements.cbor index f8dd36072d20d342e1dbb80f4e286d21b4237943..4fba6270246e037254b4510428d075766bc6f9d4 100644 GIT binary patch delta 39 ucmX@Wb&+F&7!#A|Lvi`$ZlcO2o% diff --git a/end-to-end/input/cca-realm-endorsements.cbor b/end-to-end/input/cca-realm-endorsements.cbor index 4b417da108a41de2b41744553ebd9e53aef32a51..6366ec6859e08c9246cdbe35847f4ed64511b847 100644 GIT binary patch delta 17 Zcmey#`ipgfIOCLw64x0UH@@d$0sukz2Iv3) delta 15 Xcmeyx`jd5nIOF7r64y6=;9>#*HTMQ) diff --git a/end-to-end/input/psa-endorsements.cbor b/end-to-end/input/psa-endorsements.cbor index 5538d590b39e1316b5d4d97c973fbb50ea5884c1..0030b8785f2ee564747ff3ce2e7961bb4ce72107 100644 GIT binary patch delta 31 ncmdnNevoZ~7!%{-i4wkyjT8UbFg8zI6f@b1F>dn}#wUybvXu+M delta 45 rcmX@ewu60w7!#A!Lvi`?GS({@SpD+RdQDP52 diff --git a/end-to-end/input/src/comid-cca-realm-refval.json b/end-to-end/input/src/comid-cca-realm-refval.json index 000955ee..7cd2bfa2 100644 --- a/end-to-end/input/src/comid-cca-realm-refval.json +++ b/end-to-end/input/src/comid-cca-realm-refval.json @@ -31,47 +31,49 @@ "value": "Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" } }, - "measurement": { - "value": { - "raw-value": { - "type": "bytes", - "value": "QURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBRA==" - }, - "integrity-registers": { - "rim": { - "key-type": "text", - "value": [ - "sha-512;Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" - ] - }, - "rem0": { - "key-type": "text", - "value": [ - "sha-512;Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" - ] - }, - "rem1": { - "key-type": "text", - "value": [ - "sha-512;Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" - ] - }, - "rem2": { - "key-type": "text", - "value": [ - "sha-512;Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" - ] + "measurements": [ + { + "value": { + "raw-value": { + "type": "bytes", + "value": "QURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBRA==" }, - "rem3": { - "key-type": "text", - "value": [ - "sha-512;Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" - ] + "integrity-registers": { + "rim": { + "key-type": "text", + "value": [ + "sha-512;Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" + ] + }, + "rem0": { + "key-type": "text", + "value": [ + "sha-512;Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" + ] + }, + "rem1": { + "key-type": "text", + "value": [ + "sha-512;Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" + ] + }, + "rem2": { + "key-type": "text", + "value": [ + "sha-512;Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" + ] + }, + "rem3": { + "key-type": "text", + "value": [ + "sha-512;Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" + ] + } } } } - } + ] } ] } - } + } \ No newline at end of file diff --git a/end-to-end/input/src/comid-cca-refval.json b/end-to-end/input/src/comid-cca-refval.json index c423ee94..636c04d2 100644 --- a/end-to-end/input/src/comid-cca-refval.json +++ b/end-to-end/input/src/comid-cca-refval.json @@ -28,126 +28,80 @@ "model": "RoadRunner" } }, - "measurement": { - "key": { - "type": "psa.refval-id", + "measurements": [ + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "BL", + "version": "3.4.2", + "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + } + }, "value": { - "label": "BL", - "version": "3.4.2", - "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + "digests": [ + "sha-256;BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + ] } }, - "value": { - "digests": [ - "sha-256;BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" - ] - } - } - }, - { - "environment": { - "class": { - "id": { - "type": "psa.impl-id", - "value": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "M1", + "version": "1.2.0", + "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + } }, - "vendor": "ACME", - "model": "RoadRunner" - } - }, - "measurement": { - "key": { - "type": "psa.refval-id", "value": { - "label": "M1", - "version": "1.2.0", - "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + "digests": [ + "sha-256;CwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + ] } }, - "value": { - "digests": [ - "sha-256;CwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" - ] - } - } - }, - { - "environment": { - "class": { - "id": { - "type": "psa.impl-id", - "value": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "M2", + "version": "1.2.3", + "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + } }, - "vendor": "ACME", - "model": "RoadRunner" - } - }, - "measurement": { - "key": { - "type": "psa.refval-id", "value": { - "label": "M2", - "version": "1.2.3", - "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + "digests": [ + "sha-256;DwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + ] } }, - "value": { - "digests": [ - "sha-256;DwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" - ] - } - } - }, - { - "environment": { - "class": { - "id": { - "type": "psa.impl-id", - "value": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "M3", + "version": "1.0.0", + "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + } }, - "vendor": "ACME", - "model": "RoadRunner" - } - }, - "measurement": { - "key": { - "type": "psa.refval-id", "value": { - "label": "M3", - "version": "1.0.0", - "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + "digests": [ + "sha-256;EwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + ] } }, - "value": { - "digests": [ - "sha-256;EwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" - ] - } - } - }, - { - "environment": { - "class": { - "id": { - "type": "psa.impl-id", - "value": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + { + "key": { + "type": "cca.platform-config-id", + "value": "cfg v1.0.0" }, - "vendor": "ACME", - "model": "RoadRunner" - } - }, - "measurement": { - "key": { - "type": "cca.platform-config-id", - "value": "cfg v1.0.0" - }, - "value": { - "raw-value": { - "type": "bytes", - "value": "AQID" + "value": { + "raw-value": { + "type": "bytes", + "value": "AQID" + } } } - } + ] } ] } diff --git a/end-to-end/input/src/comid-psa-refval.json b/end-to-end/input/src/comid-psa-refval.json index d1c2da1f..b070ef67 100644 --- a/end-to-end/input/src/comid-psa-refval.json +++ b/end-to-end/input/src/comid-psa-refval.json @@ -28,75 +28,53 @@ "model": "RoadRunner" } }, - "measurement": { - "key": { - "type": "psa.refval-id", + "measurements": [ + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "BL", + "version": "2.1.0", + "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + } + }, "value": { - "label": "BL", - "version": "2.1.0", - "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + "digests": [ + "sha-256;h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" + ] } }, - "value": { - "digests": [ - "sha-256;h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" - ] - } - } - }, - { - "environment": { - "class": { - "id": { - "type": "psa.impl-id", - "value": "YWNtZS1pbXBsZW1lbnRhdGlvbi1pZC0wMDAwMDAwMDE=" + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "PRoT", + "version": "1.3.5", + "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + } }, - "vendor": "ACME", - "model": "RoadRunner" - } - }, - "measurement": { - "key": { - "type": "psa.refval-id", "value": { - "label": "PRoT", - "version": "1.3.5", - "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + "digests": [ + "sha-256;AmOCmYm2/ZVPcrqvL8ZLwuLwHWktTecphuqAj26ZgT8=" + ] } }, - "value": { - "digests": [ - "sha-256;AmOCmYm2/ZVPcrqvL8ZLwuLwHWktTecphuqAj26ZgT8=" - ] - } - } - }, - { - "environment": { - "class": { - "id": { - "type": "psa.impl-id", - "value": "YWNtZS1pbXBsZW1lbnRhdGlvbi1pZC0wMDAwMDAwMDE=" + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "ARoT", + "version": "0.1.4", + "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + } }, - "vendor": "ACME", - "model": "RoadRunner" - } - }, - "measurement": { - "key": { - "type": "psa.refval-id", "value": { - "label": "ARoT", - "version": "0.1.4", - "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + "digests": [ + "sha-256;o6XnFfDMV0pzw/m+u2vCTzL/1bZ7OHJEwskJ2neaFHg=" + ] } - }, - "value": { - "digests": [ - "sha-256;o6XnFfDMV0pzw/m+u2vCTzL/1bZ7OHJEwskJ2neaFHg=" - ] } - } + ] } ] } diff --git a/go.mod b/go.mod index ed613b82..0390fe32 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/tbaehler/gin-keycloak v1.6.1 github.com/veraison/ccatoken v1.3.1 github.com/veraison/cmw v0.1.0 - github.com/veraison/corim v1.1.3-0.20240911154934-4f141ee6d1e7 + github.com/veraison/corim v1.1.3-0.20241003171039-fe09de9f3764 github.com/veraison/dice v0.0.1 github.com/veraison/ear v1.1.2 github.com/veraison/eat v0.0.0-20220117140849-ddaf59d69f53 diff --git a/go.sum b/go.sum index 3b4dce08..12753bea 100644 --- a/go.sum +++ b/go.sum @@ -1729,8 +1729,8 @@ github.com/veraison/ccatoken v1.3.1 h1:zUHXr2mPprxMYv5Mm2mumxzQZ3I9wy7QGayXqa9Rv github.com/veraison/ccatoken v1.3.1/go.mod h1:vMqdbW4H/8A3oT+24qssuIK3Aefy06XqzTELGg+gWAg= github.com/veraison/cmw v0.1.0 h1:vD6tBlGPROCW/HlDcG1jh+XUJi5ihrjXatKZBjrv8mU= github.com/veraison/cmw v0.1.0/go.mod h1:WoBrlgByc6C1FeHhdze1/bQx1kv5d1sWKO5ezEf4Hs4= -github.com/veraison/corim v1.1.3-0.20240911154934-4f141ee6d1e7 h1:sq9OVQgwpRJDFrQDGAOMs5p22Hp1zfDYRkeb+EVJWTU= -github.com/veraison/corim v1.1.3-0.20240911154934-4f141ee6d1e7/go.mod h1:Wj3a6bSo7+3peVGjwGayHDALILh4PHMngDhgBYUbVLk= +github.com/veraison/corim v1.1.3-0.20241003171039-fe09de9f3764 h1:48GvCJSVsBDaqIiK0m+h4D9rhAwLlzias+F5oLId/Fg= +github.com/veraison/corim v1.1.3-0.20241003171039-fe09de9f3764/go.mod h1:Wj3a6bSo7+3peVGjwGayHDALILh4PHMngDhgBYUbVLk= github.com/veraison/dice v0.0.1 h1:dOm7ByDN/r4WlDsGkEUXzdPMXgTvAPTAksQ8+BwBrD4= github.com/veraison/dice v0.0.1/go.mod h1:QPMLc5LVMj08VZ+HNMYk4XxWoVYGAUBVm8Rd5V1hzxs= github.com/veraison/ear v1.1.2 h1:Xs41FqAG8IyJaceqNFcX2+nf51Et1uyhmCJV8SZqw/8= diff --git a/integration-tests/data/endorsements/comid-cca-platform-refval.json b/integration-tests/data/endorsements/comid-cca-platform-refval.json index 08c70be4..afc94afb 100644 --- a/integration-tests/data/endorsements/comid-cca-platform-refval.json +++ b/integration-tests/data/endorsements/comid-cca-platform-refval.json @@ -28,127 +28,81 @@ "model": "RoadRunner" } }, - "measurement": { - "key": { - "type": "psa.refval-id", + "measurements": [ + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "BL", + "version": "3.4.2", + "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + } + }, "value": { - "label": "BL", - "version": "3.4.2", - "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + "digests": [ + "sha-256:BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + ] } }, - "value": { - "digests": [ - "sha-256:BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" - ] - } - } - }, - { - "environment": { - "class": { - "id": { - "type": "psa.impl-id", - "value": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "M1", + "version": "1.2.0", + "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + } }, - "vendor": "ACME", - "model": "RoadRunner" - } - }, - "measurement": { - "key": { - "type": "psa.refval-id", "value": { - "label": "M1", - "version": "1.2.0", - "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + "digests": [ + "sha-256:CwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + ] } }, - "value": { - "digests": [ - "sha-256:CwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" - ] - } - } - }, - { - "environment": { - "class": { - "id": { - "type": "psa.impl-id", - "value": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "M2", + "version": "1.2.3", + "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + } }, - "vendor": "ACME", - "model": "RoadRunner" - } - }, - "measurement": { - "key": { - "type": "psa.refval-id", "value": { - "label": "M2", - "version": "1.2.3", - "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + "digests": [ + "sha-256:DwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + ] } }, - "value": { - "digests": [ - "sha-256:DwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" - ] - } - } - }, - { - "environment": { - "class": { - "id": { - "type": "psa.impl-id", - "value": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "M3", + "version": "1.0.0", + "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + } }, - "vendor": "ACME", - "model": "RoadRunner" - } - }, - "measurement": { - "key": { - "type": "psa.refval-id", "value": { - "label": "M3", - "version": "1.0.0", - "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + "digests": [ + "sha-256:EwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + ] } }, - "value": { - "digests": [ - "sha-256:EwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" - ] - } - } - }, - { - "environment": { - "class": { - "id": { - "type": "psa.impl-id", - "value": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + { + "key": { + "type": "cca.platform-config-id", + "value": "cfg v1.0.0" }, - "vendor": "ACME", - "model": "RoadRunner" - } - }, - "measurement": { - "key": { - "type": "cca.platform-config-id", - "value": "cfg v1.0.0" - }, - "value": { - "raw-value": { - "type": "bytes", - "value": "AQID" + "value": { + "raw-value": { + "type": "bytes", + "value": "AQID" + } } } - } + ] } ] } - } + } \ No newline at end of file diff --git a/integration-tests/data/endorsements/comid-cca-realm-refval.json b/integration-tests/data/endorsements/comid-cca-realm-refval.json index fa81d86b..16697f55 100644 --- a/integration-tests/data/endorsements/comid-cca-realm-refval.json +++ b/integration-tests/data/endorsements/comid-cca-realm-refval.json @@ -31,47 +31,49 @@ "value": "Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" } }, - "measurement": { - "value": { - "raw-value": { - "type": "bytes", - "value": "QURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBRA==" - }, - "integrity-registers": { - "rim": { - "key-type": "text", - "value": [ - "sha-512;Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" - ] - }, - "rem0": { - "key-type": "text", - "value": [ - "sha-512;Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" - ] - }, - "rem1": { - "key-type": "text", - "value": [ - "sha-512;Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" - ] - }, - "rem2": { - "key-type": "text", - "value": [ - "sha-512;Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" - ] + "measurements": [ + { + "value": { + "raw-value": { + "type": "bytes", + "value": "QURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBRA==" }, - "rem3": { - "key-type": "text", - "value": [ - "sha-512;Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" - ] + "integrity-registers": { + "rim": { + "key-type": "text", + "value": [ + "sha-512;Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" + ] + }, + "rem0": { + "key-type": "text", + "value": [ + "sha-512;Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" + ] + }, + "rem1": { + "key-type": "text", + "value": [ + "sha-512;Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" + ] + }, + "rem2": { + "key-type": "text", + "value": [ + "sha-512;Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" + ] + }, + "rem3": { + "key-type": "text", + "value": [ + "sha-512;Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" + ] + } } } } - } + ] } ] } -} +} \ No newline at end of file diff --git a/integration-tests/data/endorsements/comid-cca-refval.json b/integration-tests/data/endorsements/comid-cca-refval.json index 86e78be6..7a03aeea 100644 --- a/integration-tests/data/endorsements/comid-cca-refval.json +++ b/integration-tests/data/endorsements/comid-cca-refval.json @@ -28,127 +28,81 @@ "model": "RoadRunner" } }, - "measurement": { - "key": { - "type": "psa.refval-id", + "measurements": [ + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "BL", + "version": "3.4.2", + "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + } + }, "value": { - "label": "BL", - "version": "3.4.2", - "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + "digests": [ + "sha-256:BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + ] } }, - "value": { - "digests": [ - "sha-256:BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" - ] - } - } - }, - { - "environment": { - "class": { - "id": { - "type": "psa.impl-id", - "value": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "M1", + "version": "1.2.0", + "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + } }, - "vendor": "ACME", - "model": "RoadRunner" - } - }, - "measurement": { - "key": { - "type": "psa.refval-id", "value": { - "label": "M1", - "version": "1.2.0", - "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + "digests": [ + "sha-256:CwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + ] } }, - "value": { - "digests": [ - "sha-256:CwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" - ] - } - } - }, - { - "environment": { - "class": { - "id": { - "type": "psa.impl-id", - "value": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "M2", + "version": "1.2.3", + "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + } }, - "vendor": "ACME", - "model": "RoadRunner" - } - }, - "measurement": { - "key": { - "type": "psa.refval-id", "value": { - "label": "M2", - "version": "1.2.3", - "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + "digests": [ + "sha-256:DwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + ] } }, - "value": { - "digests": [ - "sha-256:DwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" - ] - } - } - }, - { - "environment": { - "class": { - "id": { - "type": "psa.impl-id", - "value": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "M3", + "version": "1.0.0", + "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + } }, - "vendor": "ACME", - "model": "RoadRunner" - } - }, - "measurement": { - "key": { - "type": "psa.refval-id", "value": { - "label": "M3", - "version": "1.0.0", - "signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + "digests": [ + "sha-256:EwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" + ] } }, - "value": { - "digests": [ - "sha-256:EwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=" - ] - } - } - }, - { - "environment": { - "class": { - "id": { - "type": "psa.impl-id", - "value": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + { + "key": { + "type": "cca.platform-config-id", + "value": "cfg v1.0.0" }, - "vendor": "ACME", - "model": "RoadRunner" - } - }, - "measurement": { - "key": { - "type": "cca.platform-config-id", - "value": "cfg v1.0.0" - }, - "value": { - "raw-value": { - "type": "bytes", - "value": "AQID" + "value": { + "raw-value": { + "type": "bytes", + "value": "AQID" + } } } - } + ] } ] } -} +} \ No newline at end of file diff --git a/integration-tests/data/endorsements/comid-enacttrust-refval.json b/integration-tests/data/endorsements/comid-enacttrust-refval.json index f4aa0e5b..3b4c4ae6 100644 --- a/integration-tests/data/endorsements/comid-enacttrust-refval.json +++ b/integration-tests/data/endorsements/comid-enacttrust-refval.json @@ -22,13 +22,15 @@ "value": "7df7714e-aa04-4638-bcbf-434b1dd720f1" } }, - "measurement": { - "value": { - "digests": [ - "sha-256;h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" - ] + "measurements": [ + { + "value": { + "digests": [ + "sha-256;h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" + ] + } } - } + ] } ] } diff --git a/integration-tests/data/endorsements/comid-psa-refval.json b/integration-tests/data/endorsements/comid-psa-refval.json index 41a1f2ec..8fd66fbc 100644 --- a/integration-tests/data/endorsements/comid-psa-refval.json +++ b/integration-tests/data/endorsements/comid-psa-refval.json @@ -28,75 +28,53 @@ "model": "RoadRunner" } }, - "measurement": { - "key": { - "type": "psa.refval-id", + "measurements": [ + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "BL", + "version": "2.1.0", + "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + } + }, "value": { - "label": "BL", - "version": "2.1.0", - "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + "digests": [ + "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" + ] } }, - "value": { - "digests": [ - "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" - ] - } - } - }, - { - "environment": { - "class": { - "id": { - "type": "psa.impl-id", - "value": "YWNtZS1pbXBsZW1lbnRhdGlvbi1pZC0wMDAwMDAwMDE=" + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "PRoT", + "version": "1.3.5", + "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + } }, - "vendor": "ACME", - "model": "RoadRunner" - } - }, - "measurement": { - "key": { - "type": "psa.refval-id", "value": { - "label": "PRoT", - "version": "1.3.5", - "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + "digests": [ + "sha-256:AmOCmYm2/ZVPcrqvL8ZLwuLwHWktTecphuqAj26ZgT8=" + ] } }, - "value": { - "digests": [ - "sha-256:AmOCmYm2/ZVPcrqvL8ZLwuLwHWktTecphuqAj26ZgT8=" - ] - } - } - }, - { - "environment": { - "class": { - "id": { - "type": "psa.impl-id", - "value": "YWNtZS1pbXBsZW1lbnRhdGlvbi1pZC0wMDAwMDAwMDE=" + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "ARoT", + "version": "0.1.4", + "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + } }, - "vendor": "ACME", - "model": "RoadRunner" - } - }, - "measurement": { - "key": { - "type": "psa.refval-id", "value": { - "label": "ARoT", - "version": "0.1.4", - "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + "digests": [ + "sha-256:o6XnFfDMV0pzw/m+u2vCTzL/1bZ7OHJEwskJ2neaFHg=" + ] } - }, - "value": { - "digests": [ - "sha-256:o6XnFfDMV0pzw/m+u2vCTzL/1bZ7OHJEwskJ2neaFHg=" - ] } - } + ] } ] } diff --git a/scheme/arm-cca/test/corim/src/comidCcaRealm.json b/scheme/arm-cca/test/corim/src/comidCcaRealm.json index b2c3f494..cd59b035 100644 --- a/scheme/arm-cca/test/corim/src/comidCcaRealm.json +++ b/scheme/arm-cca/test/corim/src/comidCcaRealm.json @@ -31,47 +31,49 @@ "value": "QoS1aUymwNLPR4mguVrIAlyBjeUjBDZL580pgbLS7caFsyInfsJYGZYkE9jJssH1" } }, - "measurement": { - "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" - ] + "measurements": [ + { + "value": { + "raw-value": { + "type": "bytes", + "value": "5Fty9cDAtXLbTY06t+l/No/3TmI0eoJN7LZ6hOUiTXXkW3L1wMC1cttNjTq36X82j/dOYjR6gk3stnqE5SJNdQ==" }, - "rem3": { - "key-type": "text", - "value": [ - "sha-384;NQe752H8pS2VE2oTVNt6TdV7Gya+DT2nHZ6yOYazS6YVq/ZRTPNeWp6lWgMtBop4" - ] + "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" + ] + } } } } - } + ] } ] } -} +} \ No newline at end of file diff --git a/scheme/arm-cca/test/corim/src/comidCcaRealmInvalidClass.json b/scheme/arm-cca/test/corim/src/comidCcaRealmInvalidClass.json index c4080743..acd2ea34 100644 --- a/scheme/arm-cca/test/corim/src/comidCcaRealmInvalidClass.json +++ b/scheme/arm-cca/test/corim/src/comidCcaRealmInvalidClass.json @@ -31,47 +31,49 @@ "value": "QoS1aUymwNLPR4mguVrIAlyBjeUjBDZL580pgbLS7caFsyInfsJYGZYkE9jJssH1" } }, - "measurement": { - "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" - ] + "measurements": [ + { + "value": { + "raw-value": { + "type": "bytes", + "value": "5Fty9cDAtXLbTY06t+l/No/3TmI0eoJN7LZ6hOUiTXXkW3L1wMC1cttNjTq36X82j/dOYjR6gk3stnqE5SJNdQ==" }, - "rem3": { - "key-type": "text", - "value": [ - "sha-384;NQe752H8pS2VE2oTVNt6TdV7Gya+DT2nHZ6yOYazS6YVq/ZRTPNeWp6lWgMtBop4" - ] + "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" + ] + } } } } - } + ] } ] } -} +} \ No newline at end of file diff --git a/scheme/arm-cca/test/corim/src/comidCcaRealmInvalidInstance.json b/scheme/arm-cca/test/corim/src/comidCcaRealmInvalidInstance.json index 47558bde..d59681fa 100644 --- a/scheme/arm-cca/test/corim/src/comidCcaRealmInvalidInstance.json +++ b/scheme/arm-cca/test/corim/src/comidCcaRealmInvalidInstance.json @@ -31,43 +31,45 @@ "value": "Ac7rrnuJJ6MiflMDz14PH3s0u1Qq1yUKwD+83jbsLxUI" } }, - "measurement": { - "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" - ] + "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" + ] + } } } } - } + ] } ] } -} +} \ No newline at end of file diff --git a/scheme/arm-cca/test/corim/src/comidCcaRealmNoClass.json b/scheme/arm-cca/test/corim/src/comidCcaRealmNoClass.json index 1e4c5771..3d5bcf60 100644 --- a/scheme/arm-cca/test/corim/src/comidCcaRealmNoClass.json +++ b/scheme/arm-cca/test/corim/src/comidCcaRealmNoClass.json @@ -24,43 +24,45 @@ "value": "QoS1aUymwNLPR4mguVrIAlyBjeUjBDZL580pgbLS7caFsyInfsJYGZYkE9jJssH1" } }, - "measurement": { - "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" - ] + "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" + ] + } } } } - } + ] } ] } -} +} \ No newline at end of file diff --git a/scheme/arm-cca/test/corim/src/comidCcaRealmNoInstance.json b/scheme/arm-cca/test/corim/src/comidCcaRealmNoInstance.json index 0bca088b..c849be77 100644 --- a/scheme/arm-cca/test/corim/src/comidCcaRealmNoInstance.json +++ b/scheme/arm-cca/test/corim/src/comidCcaRealmNoInstance.json @@ -27,43 +27,45 @@ "vendor": "Workload Client Ltd" } }, - "measurement": { - "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" - ] + "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" + ] + } } } } - } + ] } ] } -} +} \ No newline at end of file diff --git a/scheme/arm-cca/test/corim/src/comidCcaRefValFour.json b/scheme/arm-cca/test/corim/src/comidCcaRefValFour.json index 12de6cd4..25b68c88 100644 --- a/scheme/arm-cca/test/corim/src/comidCcaRefValFour.json +++ b/scheme/arm-cca/test/corim/src/comidCcaRefValFour.json @@ -28,100 +28,66 @@ "model": "RoadRunner" } }, - "measurement": { - "key": { - "type": "psa.refval-id", + "measurements": [ + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "BL", + "version": "2.1.0", + "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + } + }, "value": { - "label": "BL", - "version": "2.1.0", - "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + "digests": [ + "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" + ] } }, - "value": { - "digests": [ - "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" - ] - } - } - }, - { - "environment": { - "class": { - "id": { - "type": "psa.impl-id", - "value": "YWNtZS1pbXBsZW1lbnRhdGlvbi1pZC0wMDAwMDAwMDE=" + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "PRoT", + "version": "1.3.5", + "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + } }, - "vendor": "ACME", - "model": "RoadRunner" - } - }, - "measurement": { - "key": { - "type": "psa.refval-id", "value": { - "label": "PRoT", - "version": "1.3.5", - "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + "digests": [ + "sha-256:AmOCmYm2/ZVPcrqvL8ZLwuLwHWktTecphuqAj26ZgT8=" + ] } }, - "value": { - "digests": [ - "sha-256:AmOCmYm2/ZVPcrqvL8ZLwuLwHWktTecphuqAj26ZgT8=" - ] - } - } - }, - { - "environment": { - "class": { - "id": { - "type": "psa.impl-id", - "value": "YWNtZS1pbXBsZW1lbnRhdGlvbi1pZC0wMDAwMDAwMDE=" + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "ARoT", + "version": "0.1.4", + "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + } }, - "vendor": "ACME", - "model": "RoadRunner" - } - }, - "measurement": { - "key": { - "type": "psa.refval-id", "value": { - "label": "ARoT", - "version": "0.1.4", - "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + "digests": [ + "sha-256:o6XnFfDMV0pzw/m+u2vCTzL/1bZ7OHJEwskJ2neaFHg=" + ] } }, - "value": { - "digests": [ - "sha-256:o6XnFfDMV0pzw/m+u2vCTzL/1bZ7OHJEwskJ2neaFHg=" - ] - } - } - }, - { - "environment": { - "class": { - "id": { - "type": "psa.impl-id", - "value": "YWNtZS1pbXBsZW1lbnRhdGlvbi1pZC0wMDAwMDAwMDE=" + { + "key": { + "type": "cca.platform-config-id", + "value": "any-value" }, - "vendor": "ACME", - "model": "RoadRunner" - } - }, - "measurement": { - "key": { - "type": "cca.platform-config-id", - "value": "any-value" - }, - "value": { - "raw-value": { - "type": "bytes", - "value": "cmF3dmFsdWUKcmF3dmFsdWUK" + "value": { + "raw-value": { + "type": "bytes", + "value": "cmF3dmFsdWUKcmF3dmFsdWUK" + } } } - } + ] } ] } -} +} \ No newline at end of file diff --git a/scheme/arm-cca/test/corim/src/comidCcaRefValOne.json b/scheme/arm-cca/test/corim/src/comidCcaRefValOne.json index a02a8b02..0871e7ea 100644 --- a/scheme/arm-cca/test/corim/src/comidCcaRefValOne.json +++ b/scheme/arm-cca/test/corim/src/comidCcaRefValOne.json @@ -29,18 +29,20 @@ "model": "RoadRunner" } }, - "measurement": { - "key": { - "type": "cca.platform-config-id", - "value": "any-label" - }, - "value": { - "raw-value": { - "type": "bytes", - "value": "cmF3dmFsdWUKcmF3dmFsdWUK" + "measurements": [ + { + "key": { + "type": "cca.platform-config-id", + "value": "any-label" + }, + "value": { + "raw-value": { + "type": "bytes", + "value": "cmF3dmFsdWUKcmF3dmFsdWUK" + } } } - } + ] } ] } diff --git a/scheme/arm-cca/test/corim/unsignedCorimCcaComidCcaRefValFour.cbor b/scheme/arm-cca/test/corim/unsignedCorimCcaComidCcaRefValFour.cbor index 8a8cc36afbc75002d3a8da8949daa59298e81f84..9fd1f414e2352b57b7e5a3142a35a9ff21e8a4de 100644 GIT binary patch delta 34 pcmX@lHivbB7!%{^i4wkyjT8UbFt$uw6f@b1F>dk|AkJfY2msjv4Hy6b delta 40 pcmbQkdY)~97!y<7Li#Dxz5EBOX3 delta 14 VcmZo>ZepGw#<*#sc-O>54*?>*1*-r6 diff --git a/scheme/arm-cca/test/corim/unsignedCorimCcaNoProfileComidCcaRefValFour.cbor b/scheme/arm-cca/test/corim/unsignedCorimCcaNoProfileComidCcaRefValFour.cbor index 04a63a5aa532e08582238581fff4ad93e7999965..21acf3fc64f4eb43143881fcb01ecaa509e39658 100644 GIT binary patch delta 34 pcmdnO*2p?RjEV8|L05_Nh+5i9m delta 14 WcmaFC^qgse7~`gi;$0IL9RmO?%m!Eh diff --git a/scheme/arm-cca/test/corim/unsignedCorimCcaRealmComidCcaRealm.cbor b/scheme/arm-cca/test/corim/unsignedCorimCcaRealmComidCcaRealm.cbor index c41ff5e42046297f6470b8d238393d68a31856ee..e921e628236f270cbad8b2d6d7b45ca14b08dd94 100644 GIT binary patch delta 17 ZcmbQqI*WCJIHSo#iQ|lo8}IL81OPJl23G(8 delta 15 XcmbQmI+JyRIHU1IiQ^j|>|z7}DOLs5 diff --git a/scheme/arm-cca/test/corim/unsignedCorimCcaRealmComidCcaRealmInvalidClass.cbor b/scheme/arm-cca/test/corim/unsignedCorimCcaRealmComidCcaRealmInvalidClass.cbor index b48479b763ee4f207d90c8786e744fcb4c65612f..793fe376780ccf72d61b63143aef20b8b722d22d 100644 GIT binary patch delta 17 ZcmbQkI+t~VIHUPQiBpV?8z1dr1OPLX24(;N delta 15 XcmbQsI)`%=shiHl=EH`3_ CH6FkK diff --git a/scheme/parsec-tpm/test/corim/unsignedCorimMiniComidParsecTpmPcrsNoClass.cbor b/scheme/parsec-tpm/test/corim/unsignedCorimMiniComidParsecTpmPcrsNoClass.cbor index 12157714c3e1fcd9dfc4065123d7a8cadb19ba76..e3c5cf1970e004f247f266647b28cd06cfbc56ee 100644 GIT binary patch delta 25 hcmZ3<+{ipZoY88cL?C11#4Jt5riqi|CrdN-0RUom2lfB} delta 25 ecmZoy4+)k4 diff --git a/scheme/parsec-tpm/test/corim/unsignedCorimMiniComidParsecTpmPcrsNoDigests.cbor b/scheme/parsec-tpm/test/corim/unsignedCorimMiniComidParsecTpmPcrsNoDigests.cbor index 42c253fc89cd48561a7f3b910b4f3080cceed7bd..855125790ba2b991367a6c662ad2fe2d630be5e3 100644 GIT binary patch delta 16 XcmdnZxQB6q7-QK)@hry1iH%kOE~5o^ delta 14 VcmdnPxSMf;7-Q)~@vMnWRsbbM1oZ#_ diff --git a/scheme/parsec-tpm/test/corim/unsignedCorimMiniComidParsecTpmPcrsNoPCR.cbor b/scheme/parsec-tpm/test/corim/unsignedCorimMiniComidParsecTpmPcrsNoPCR.cbor index 890396d75b34714b3ad0642bfbd59f2ea4aa9ddf..47b070d79ee99f73e9353b67db19b1855df2475b 100644 GIT binary patch delta 24 gcmZo>e#10DoKbb6L?C11#QPGAO%t19Cw}h%0Azv*O#lD@ delta 68 zcmaFE)XY3VoY7{YM4)6-(?W)Y3^!B*&dT$Js{M51-Ff5t--m@2H4~d-C2-0;=m7w- C=^m~C diff --git a/scheme/parsec-tpm/test/corim/unsignedCorimMiniComidParsecTpmPcrsUnknownPCRType.cbor b/scheme/parsec-tpm/test/corim/unsignedCorimMiniComidParsecTpmPcrsUnknownPCRType.cbor index 93422612177a7f58a0f57699aad3c9f7732f76d4..c8b7314f33845bd1c1ecccc8eb603241ebdf632c 100644 GIT binary patch delta 45 zcmV+|0Mh@f1C#@h7XeL?7*QI5f}sGR0N5o^%^wa`CizAUx!Cvp;c<9;f{}u8lM4Z$ Dg8&k; delta 68 zcmbQjyqbA}IAh90i9pGwriBa(8E&WsoR#MbRr~42yYt5PzYhy5Y9=-pO5l|HvH$?G CBp%}c diff --git a/scheme/psa-iot/corim_extractor.go b/scheme/psa-iot/corim_extractor.go index df2aec52..185ec7da 100644 --- a/scheme/psa-iot/corim_extractor.go +++ b/scheme/psa-iot/corim_extractor.go @@ -20,7 +20,7 @@ type CorimExtractor struct { func (o CorimExtractor) RefValExtractor(rvs comid.ValueTriples) ([]*handler.Endorsement, error) { refVals := make([]*handler.Endorsement, 0, len(rvs.Values)) - for i, rv := range rvs.Values { + for _, rv := range rvs.Values { var classAttrs platform.ClassAttributes var refVal *handler.Endorsement var err error @@ -36,33 +36,34 @@ func (o CorimExtractor) RefValExtractor(rvs comid.ValueTriples) ([]*handler.Endo return nil, fmt.Errorf("could not extract PSA class attributes: %w", err) } - if rv.Measurement.Key == nil { - return nil, fmt.Errorf("measurement key is not present") - } + // Each measurement is encoded in a measurement-map of a CoMID + // reference-triple-record. Since a measurement-map can encode one or more + // measurements, a single reference-triple-record can carry as many + // measurements as needed, provided they belong to the same PSA RoT + // identified in the subject of the "reference value" triple. A single + // reference-triple-record SHALL completely describe the updatable PSA RoT. + for i, m := range rv.Measurements.Values { + if m.Key == nil { + return nil, fmt.Errorf("measurement key is not present") + } - if !rv.Measurement.Key.IsSet() { - return nil, fmt.Errorf("measurement key is not set") - } + if !m.Key.IsSet() { + return nil, fmt.Errorf("measurement key is not set at index %d ", i) + } - // Check which MKey is present and then decide which extractor to invoke - switch rv.Measurement.Key.Type() { - case comid.PSARefValIDType: - var swCompAttrs platform.SwCompAttributes - refVal, err = o.extractMeas(&swCompAttrs, rv.Measurement, classAttrs) - if err != nil { - return nil, fmt.Errorf( - "unable to extract measurement at index %d, %w", - i, - err, - ) + // Check which MKey is present and then decide which extractor to invoke + switch m.Key.Type() { + case comid.PSARefValIDType: + var swCompAttrs platform.SwCompAttributes + refVal, err = o.extractMeas(&swCompAttrs, m, classAttrs) + if err != nil { + return nil, fmt.Errorf("unable to extract measurement at index %d, %w", i, err) + } + default: + return nil, fmt.Errorf("unknown measurement key: %T", reflect.TypeOf(m.Key)) } - default: - return nil, fmt.Errorf( - "unknown measurement key: %T", - reflect.TypeOf(rv.Measurement.Key), - ) + refVals = append(refVals, refVal) } - refVals = append(refVals, refVal) } if len(refVals) == 0 { diff --git a/scheme/psa-iot/test/corim/src/ComidPsaRefValMultDigest.json b/scheme/psa-iot/test/corim/src/ComidPsaRefValMultDigest.json index 8e82b317..594d9fd6 100644 --- a/scheme/psa-iot/test/corim/src/ComidPsaRefValMultDigest.json +++ b/scheme/psa-iot/test/corim/src/ComidPsaRefValMultDigest.json @@ -28,23 +28,25 @@ "model": "RoadRunner" } }, - "measurement": { - "key": { - "type": "psa.refval-id", + "measurements": [ + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "BL", + "version": "2.1.0", + "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + } + }, "value": { - "label": "BL", - "version": "2.1.0", - "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + "digests": [ + "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=", + "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJYjHl4Hu9eg/eYMTPJcc=" + ] } - }, - "value": { - "digests": [ - "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=", - "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJYjHl4Hu9eg/eYMTPJcc=" - ] } - } + ] } ] } -} +} \ No newline at end of file diff --git a/scheme/psa-iot/test/corim/src/ComidPsaRefValNoImplID.json b/scheme/psa-iot/test/corim/src/ComidPsaRefValNoImplID.json index eaf5efc3..183c77aa 100644 --- a/scheme/psa-iot/test/corim/src/ComidPsaRefValNoImplID.json +++ b/scheme/psa-iot/test/corim/src/ComidPsaRefValNoImplID.json @@ -29,21 +29,23 @@ "index": 0 } }, - "measurement": { - "key": { - "type": "psa.refval-id", + "measurements": [ + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "BL", + "version": "2.1.0", + "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + } + }, "value": { - "label": "BL", - "version": "2.1.0", - "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + "digests": [ + "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" + ] } - }, - "value": { - "digests": [ - "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" - ] } - } + ] } ] } diff --git a/scheme/psa-iot/test/corim/src/ComidPsaRefValNoMkey.json b/scheme/psa-iot/test/corim/src/ComidPsaRefValNoMkey.json index 5b5843f9..f7a38099 100644 --- a/scheme/psa-iot/test/corim/src/ComidPsaRefValNoMkey.json +++ b/scheme/psa-iot/test/corim/src/ComidPsaRefValNoMkey.json @@ -28,21 +28,23 @@ "model": "RoadRunner" } }, - "measurement": { - "value": { - "op-flags": [ - "notSecure", - "debug" - ], - "digests": [ - "sha-256:RKozavTLFKh5Qy5T3WVxx/qbzK+3X0iCWSYtbqOk2Rs=" - ], - "svn": { - "type": "exact-value", - "value": 10 - } + "measurements": [ + { + "value": { + "op-flags": [ + "notSecure", + "debug" + ], + "digests": [ + "sha-256:RKozavTLFKh5Qy5T3WVxx/qbzK+3X0iCWSYtbqOk2Rs=" + ], + "svn": { + "type": "exact-value", + "value": 10 + } + } } - } + ] } ] } diff --git a/scheme/psa-iot/test/corim/src/ComidPsaRefValOne.cbor b/scheme/psa-iot/test/corim/src/ComidPsaRefValOne.cbor new file mode 100644 index 0000000000000000000000000000000000000000..a0db3ba5c041e3a0c4d33a54193d8592e09e4db7 GIT binary patch literal 228 zcmZ3&keZsO>+Zz3kRiZ%_v3oKL~rADmxIrLbm|skYFx~a>FDh1s^C+SqQ`hcp(LZE zq@dVJUq3N9H&rjSA~ClhCzYw0fsu)2Awy%+LWac*H<=fs{GbvD_5=T#Jbe|lrri)_Y)OpQ&95en^2{YRA=Yz^7ss?XVcuzym@ UnP&L(LG|7${(A{W&Z`~=08@=u6951J literal 0 HcmV?d00001 diff --git a/scheme/psa-iot/test/corim/src/ComidPsaRefValOne.json b/scheme/psa-iot/test/corim/src/ComidPsaRefValOne.json index b163e493..26536dd5 100644 --- a/scheme/psa-iot/test/corim/src/ComidPsaRefValOne.json +++ b/scheme/psa-iot/test/corim/src/ComidPsaRefValOne.json @@ -28,21 +28,23 @@ "model": "RoadRunner" } }, - "measurement": { - "key": { - "type": "psa.refval-id", + "measurements": [ + { + "key": { + "type": "psa.refval-id", + "value": { + "label": "BL", + "version": "2.1.0", + "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + } + }, "value": { - "label": "BL", - "version": "2.1.0", - "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + "digests": [ + "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" + ] } - }, - "value": { - "digests": [ - "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" - ] } - } + ] } ] } diff --git a/scheme/psa-iot/test/corim/src/ComidPsaRefValOnlyMandIDAttr.json b/scheme/psa-iot/test/corim/src/ComidPsaRefValOnlyMandIDAttr.json index 8a61d047..7e397360 100644 --- a/scheme/psa-iot/test/corim/src/ComidPsaRefValOnlyMandIDAttr.json +++ b/scheme/psa-iot/test/corim/src/ComidPsaRefValOnlyMandIDAttr.json @@ -28,19 +28,21 @@ "model": "RoadRunner" } }, - "measurement": { - "key": { - "type": "psa.refval-id", + "measurements": [ + { + "key": { + "type": "psa.refval-id", + "value": { + "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + } + }, "value": { - "signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=" + "digests": [ + "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" + ] } - }, - "value": { - "digests": [ - "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" - ] } - } + ] } ] } diff --git a/scheme/psa-iot/test/corim/src/ComidPsaRefValThree.json b/scheme/psa-iot/test/corim/src/ComidPsaRefValThree.json index 41a1f2ec..22a7d24a 100644 --- a/scheme/psa-iot/test/corim/src/ComidPsaRefValThree.json +++ b/scheme/psa-iot/test/corim/src/ComidPsaRefValThree.json @@ -28,7 +28,8 @@ "model": "RoadRunner" } }, - "measurement": { + "measurements": [ + { "key": { "type": "psa.refval-id", "value": { @@ -42,20 +43,8 @@ "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" ] } - } - }, - { - "environment": { - "class": { - "id": { - "type": "psa.impl-id", - "value": "YWNtZS1pbXBsZW1lbnRhdGlvbi1pZC0wMDAwMDAwMDE=" - }, - "vendor": "ACME", - "model": "RoadRunner" - } }, - "measurement": { + { "key": { "type": "psa.refval-id", "value": { @@ -69,20 +58,8 @@ "sha-256:AmOCmYm2/ZVPcrqvL8ZLwuLwHWktTecphuqAj26ZgT8=" ] } - } - }, - { - "environment": { - "class": { - "id": { - "type": "psa.impl-id", - "value": "YWNtZS1pbXBsZW1lbnRhdGlvbi1pZC0wMDAwMDAwMDE=" - }, - "vendor": "ACME", - "model": "RoadRunner" - } }, - "measurement": { + { "key": { "type": "psa.refval-id", "value": { @@ -97,6 +74,7 @@ ] } } + ] } ] } diff --git a/scheme/psa-iot/test/corim/unsignedCorimCorimMiniComidPsaIakPubOne.cbor b/scheme/psa-iot/test/corim/unsignedCorimCorimMiniComidPsaIakPubOne.cbor deleted file mode 100644 index 88f457770f07ab8c69431a37343b08a75456a55b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 383 zcmZ3)5D*jo;)~l^C+UeNInGahX!D1$F_JO;CgZOq45_Jky6#Sl3mF2;a=Ex7J6zwk zbm(h^_$N6rH7;hzbaeK0Rq!cE(PO-!P?AwnQc!HAub-Hlo2r*uk(gVMlgiZ0z{te1 zkh!sG5yN7Jn@kZA3Lt6SOps)5YFy};aS{~`)ogd{{m1W@U7#QgZWxF^ACc6ZtJG#2%8I&aE zJC+9-2jmucXGi*!I2OBD<{OxL2m6}kCZ(tOIj0wt`WU2}g%yN&WJl$g8<%IBI=NKj rhneST`=_R+8f1DFW``Sl_(p{oyM|=uWqPHg+uCx0o#5){g6=8+!_a>J diff --git a/scheme/psa-iot/test/corim/unsignedCorimCorimMiniComidPsaIakPubTwo.cbor b/scheme/psa-iot/test/corim/unsignedCorimCorimMiniComidPsaIakPubTwo.cbor deleted file mode 100644 index 6e93a80a8db4daf4f0e7cf76d8662540b4d1b433..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 664 zcmZ3)5D*jo;)~l^C+UeNInGahX!D1$F_Nj_CgZOq45_Jky6#Sl3mF2;a=Ex7J6zwk zbm(h^_$N6rH7;hzbaeK0Rq!cE(PO-!P?AwnQc!HAub-Hlo2r*uk(gVMlgiZ0z{te1 zkh!U85yN7Jn@kZA3Lt6SOps)5YFy};aS{~`)ogd{{m1W@U7#QgZWxF^ACc6ZtJG#2%8I&aE zJC+9-2jmucXGi*!I2OBD<{OxL2m6}kCZ(tOIj0wt`WU2}g%yN&WJl$g8<%IBI=NKj zhneST`=_R+8f1DFW``Sl_(p{oyM|=uWqPHg+uCx0o#5){g6=9R1dPw(CttZgc^sbJ z&cvJX|3XYhS$W`oHP=&6J+ZxLCLsO=Q$8sZb0<>VJ? zT;v)N7FtXad7~`3V;`xk?6WhuGIm!l@ delta 14 Vcmeyz_?K~l7~|=Q;`tNX%K(||uLb1* diff --git a/scheme/psa-iot/test/corim/unsignedCorimMiniComidPsaRefValOne.cbor b/scheme/psa-iot/test/corim/unsignedCorimMiniComidPsaRefValOne.cbor index 7607f38c63b2f8e5e1541032a3a27ebde125876c..58a38845762c3cbed326c08c75a4ea436eafb869 100644 GIT binary patch delta 16 YcmbQiG?Qt97~}Ja;$4i56Bm{P0597HApigX delta 14 WcmbQqG=ph^7~`{v;$0ILl>-1J;{~4p diff --git a/scheme/psa-iot/test/corim/unsignedCorimMiniComidPsaRefValOnlyMandIDAttr.cbor b/scheme/psa-iot/test/corim/unsignedCorimMiniComidPsaRefValOnlyMandIDAttr.cbor index 0eef1756d44e911e3d6c8715360883a9bedf5470..ce5739cb7cb3dbd4fd10e97bacd2c5dd37809faf 100644 GIT binary patch delta 16 XcmeBW>SLN9#&~Ci#DzHkE+Yl? delta 14 VcmeBU>SdZB#&~<8c-O>5IRGSW1#dk|#!3LH0t;FI delta 33 lcmcb{e3oT`7!#A!L=?y3~B%X diff --git a/scheme/tpm-enacttrust/extractor.go b/scheme/tpm-enacttrust/extractor.go index 79346c2f..376a32a2 100644 --- a/scheme/tpm-enacttrust/extractor.go +++ b/scheme/tpm-enacttrust/extractor.go @@ -31,11 +31,14 @@ func (o Extractor) RefValExtractor(rvs comid.ValueTriples) ([]*handler.Endorseme return nil, fmt.Errorf("could not extract instance attributes: %w", err) } + if len(rv.Measurements.Values) != 1 { + return nil, fmt.Errorf("expecting one measurement only") + } var ( swComponents []*handler.Endorsement swCompAttrs SwCompAttributes - measurement comid.Measurement = rv.Measurement + measurement comid.Measurement = rv.Measurements.Values[0] ) if err := swCompAttrs.FromMeasurement(measurement); err != nil { diff --git a/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustBadInst.json b/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustBadInst.json index f5ffaab3..29ea4d1e 100644 --- a/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustBadInst.json +++ b/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustBadInst.json @@ -22,13 +22,15 @@ "value": "Ac7rrnuJJ6MiflMDz14PH3s0u1Qq1yUKwD+83jbsLxUI" } }, - "measurement": { - "value": { - "digests": [ - "sha-256;h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" - ] + "measurements": [ + { + "value": { + "digests": [ + "sha-256;h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" + ] + } } - } + ] } ] } diff --git a/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustGoldenOne.json b/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustGoldenOne.json index e5163b19..c1e39f83 100644 --- a/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustGoldenOne.json +++ b/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustGoldenOne.json @@ -22,13 +22,15 @@ "value": "DD6661F0-0928-4401-966B-589EA74E3272" } }, - "measurement": { - "value": { - "digests": [ - "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" - ] + "measurements": [ + { + "value": { + "digests": [ + "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" + ] + } } - } + ] } ] } diff --git a/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustGoldenTwo.json b/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustGoldenTwo.json index 395216d9..f8582ab3 100644 --- a/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustGoldenTwo.json +++ b/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustGoldenTwo.json @@ -22,28 +22,22 @@ "value": "DD6661F0-0928-4401-966B-589EA74E3272" } }, - "measurement": { - "value": { - "digests": [ - "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" - ] + "measurements": [ + { + "value": { + "digests": [ + "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" + ] + } + }, + { + "value": { + "digests": [ + "sha-256:AmOCmYm2/ZVPcrqvL8ZLwuLwHWktTecphuqAj26ZgT8=" + ] + } } - } - }, - { - "environment": { - "instance": { - "type": "uuid", - "value": "DD6661F0-0928-4401-966B-589EA74E3272" - } - }, - "measurement": { - "value": { - "digests": [ - "sha-256:AmOCmYm2/ZVPcrqvL8ZLwuLwHWktTecphuqAj26ZgT8=" - ] - } - } + ] } ] } diff --git a/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustMultDigest.json b/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustMultDigest.json index 8616bfbb..758a25eb 100644 --- a/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustMultDigest.json +++ b/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustMultDigest.json @@ -22,14 +22,16 @@ "value": "DD6661F0-0928-4401-966B-589EA74E3272" } }, - "measurement": { - "value": { - "digests": [ - "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=", - "sha-256:h0KPxSKAPTEGXnvOPPB/5HUJYjHl4Hu9eg/eYMTPJcc=" - ] + "measurements": [ + { + "value": { + "digests": [ + "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=", + "sha-256:h0KPxSKAPTEGXnvOPPB/5HUJYjHl4Hu9eg/eYMTPJcc=" + ] + } } - } + ] } ] } diff --git a/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustNoDigest.json b/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustNoDigest.json index b3f1804b..2e1200f1 100644 --- a/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustNoDigest.json +++ b/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustNoDigest.json @@ -22,12 +22,14 @@ "value": "DD6661F0-0928-4401-966B-589EA74E3272" } }, - "measurement": { - "value": { - "mac-addr": "00:00:5e:00:53:01", - "ip-addr": "2001:4860:0:2001::68" + "measurements": [ + { + "value": { + "mac-addr": "00:00:5e:00:53:01", + "ip-addr": "2001:4860:0:2001::68" + } } - } + ] } ] } diff --git a/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustNoInst.json b/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustNoInst.json index 5328077e..1c001a82 100644 --- a/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustNoInst.json +++ b/scheme/tpm-enacttrust/test/corim/src/ComidTpmEnactTrustNoInst.json @@ -26,13 +26,15 @@ "model": "RoadRunner" } }, - "measurement": { - "value": { - "digests": [ - "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" - ] + "measurements": [ + { + "value": { + "digests": [ + "sha-256:h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=" + ] + } } - } + ] } ] } diff --git a/scheme/tpm-enacttrust/test/corim/unsignedCorimMiniComidTpmEnactTrustBadInst.cbor b/scheme/tpm-enacttrust/test/corim/unsignedCorimMiniComidTpmEnactTrustBadInst.cbor index c4a56d8cab7d4c4d0003f621664e01ac1278cdcf..b89f0bd3db42e6322aeac31419f62ee00e2bf1bb 100644 GIT binary patch delta 16 Xcmcc3c!zO<7~|ZD;>C=O6T1QdG$95D delta 14 Vcmcb^c$;y87~`CY;>8oY0|6=H1%&_r diff --git a/scheme/tpm-enacttrust/test/corim/unsignedCorimMiniComidTpmEnactTrustGoldenOne.cbor b/scheme/tpm-enacttrust/test/corim/unsignedCorimMiniComidTpmEnactTrustGoldenOne.cbor index ef444fda8baa87fb49020d8434d07551fe091282..a1628870d722eba61e74f0ca09a3b99f1a5715ac 100644 GIT binary patch delta 16 XcmX@Xc#?5~7-QE&@dU=kiRFO+Fr)>j delta 14 VcmX@fc!F_)7-Q!|@q~#LfdD4{1ttIh diff --git a/scheme/tpm-enacttrust/test/corim/unsignedCorimMiniComidTpmEnactTrustGoldenTwo.cbor b/scheme/tpm-enacttrust/test/corim/unsignedCorimMiniComidTpmEnactTrustGoldenTwo.cbor index 86178fe5268677f01deaad4f7fabbaa707e443ec..dd0efc1ccf71f3bb7e3d3a94b805a9d72bd24b72 100644 GIT binary patch delta 24 gcmZo?`ouUvjB)csaZkp^iHTy2O%uyCCvFP_0B2MPo&W#< delta 25 ecmeyw*v>RTjPb-oaZkpkiHTwpD>Omm!ax9Ye+eZ3 diff --git a/scheme/tpm-enacttrust/test/corim/unsignedCorimMiniComidTpmEnactTrustMultDigest.cbor b/scheme/tpm-enacttrust/test/corim/unsignedCorimMiniComidTpmEnactTrustMultDigest.cbor index 2e8a2d96571c3c6eab44dc869f630adb595995fb..c7da9918a3196c0a1e9b9c54aa49a44c401e4c72 100644 GIT binary patch delta 16 XcmaFE_?B^k7~{H$;t7n66U$2hHbe$E delta 14 VcmaFM_=a(U7~|TB;t3NgN&zdz1-1YH diff --git a/scheme/tpm-enacttrust/test/corim/unsignedCorimMiniComidTpmEnactTrustNoDigest.cbor b/scheme/tpm-enacttrust/test/corim/unsignedCorimMiniComidTpmEnactTrustNoDigest.cbor index 06e3a1ed6469396fe92fcb44c77b4711fbc4b013..40f947b60f2b54237001b7c7ba6fe6af7b8ec695 100644 GIT binary patch delta 16 XcmdnPxR-H)7-QW;@dU=kiRG>UF2n_R delta 14 VcmdnXxQB6q7-Q{3@q~#Lt^g%w1oi*` diff --git a/scheme/tpm-enacttrust/test/corim/unsignedCorimMiniComidTpmEnactTrustNoInst.cbor b/scheme/tpm-enacttrust/test/corim/unsignedCorimMiniComidTpmEnactTrustNoInst.cbor index 5bfa474d3493ef94273b400f84b1be383775337c..3bafc9e339256b2b07f5d8563f2f7785c8be71a5 100644 GIT binary patch delta 16 YcmaFI_?~fs7~_VC;%$tL6Xym305_fnW&i*H delta 14 WcmaFQ_>OUc7~}eh;%yV>1p)vp$OYs8