Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
setrofim committed Sep 7, 2023
1 parent a9366af commit 329195b
Show file tree
Hide file tree
Showing 15 changed files with 883 additions and 117 deletions.
2 changes: 1 addition & 1 deletion comid/attestverifkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
type AttestVerifKey struct {
_ struct{} `cbor:",toarray"`
Environment Environment `json:"environment"`
VerifKeys VerifKeys `json:"verification-keys"`
VerifKeys CryptoKeys `json:"verification-keys"`
}

func (o AttestVerifKey) Valid() error {
Expand Down
11 changes: 6 additions & 5 deletions comid/attestverifkey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,27 @@ import (
)

func TestAttestVerifKey_Valid_empty(t *testing.T) {
invalidKey := CryptoKey{TaggedPKIXBase64Key("")}

tvs := []struct {
env Environment
verifkey VerifKeys
verifkey CryptoKeys
testerr string
}{
{
env: Environment{},
verifkey: VerifKeys{},
verifkey: CryptoKeys{},
testerr: "environment validation failed: environment must not be empty",
},
{
env: Environment{Instance: NewInstanceUEID(TestUEID)},
verifkey: VerifKeys{},
verifkey: CryptoKeys{},
testerr: "verification keys validation failed: no verification key to validate",
},
{
env: Environment{Instance: NewInstanceUEID(TestUEID)},
verifkey: VerifKeys{{Key: ""}},
testerr: "verification keys validation failed: invalid verification key at index 0: verification key not set",
verifkey: CryptoKeys{&invalidKey},
testerr: "verification keys validation failed: invalid verification key at index 0: key value not set",
},
}
for _, tv := range tvs {
Expand Down
7 changes: 7 additions & 0 deletions comid/cbor.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ func comidTags() cbor.TagSet {
//551: To Do see: https://github.com/veraison/corim/issues/32
552: TaggedSVN(0),
553: TaggedMinSVN(0),
554: TaggedPKIXBase64Key(""),
555: TaggedPKIXBase64Cert(""),
556: TaggedPKIXBase64CertPath(""),
557: TaggedThumbprint(""),
558: TaggedCOSEKey{},
559: TaggedCertThumbprint(""),
560: TaggedRawValueBytes{},
561: TaggedCertPathThumbprint(""),
// PSA profile tags
600: TaggedImplID{},
601: TaggedPSARefValID{},
Expand Down
Loading

0 comments on commit 329195b

Please sign in to comment.