Skip to content

Commit

Permalink
Strip CBOR tags off signed CoRIM.
Browse files Browse the repository at this point in the history
Signed-off-by: Dionna Glaze <[email protected]>
  • Loading branch information
deeglaze committed Oct 22, 2024
1 parent 4eada92 commit d8251a8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/corimDisplay.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ func display(signedCorimFile string, showTags bool) error {
return fmt.Errorf("error loading signed CoRIM from %s: %w", signedCorimFile, err)
}

// If a tagged-corim-type-choice #6.500 of tagged-signed-corim #6.502, strip the prefix.
corimTypeChoice := []byte("\xd9\x01\xf4\xd9\x01\xf6")
signedCorimCBOR, _ = bytes.CutPrefix(signedCorimCBOR, corimTypeChoice)

if err = s.FromCOSE(signedCorimCBOR); err != nil {
return fmt.Errorf("error decoding signed CoRIM from %s: %w", signedCorimFile, err)
}
Expand Down

0 comments on commit d8251a8

Please sign in to comment.