Skip to content

Conversation

@thomas-fossati
Copy link
Contributor

Address #53

cc @kentakayama

Signed-off-by: Thomas Fossati <[email protected]>
Signed-off-by: Thomas Fossati <[email protected]>
Copy link
Contributor

@setrofim setrofim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kentakayama
Copy link

@thomas-fossati thank you so much.
It seems that the psa-boot-seed is still encoded as 2397 for CBOR.

diff --git a/claims_9783_test.go b/claims_9783_test.go
index 2e2bae7..0b1d4fc 100644
--- a/claims_9783_test.go
+++ b/claims_9783_test.go
@@ -6,6 +6,8 @@ package psatoken
 import (
        "fmt"
        "log"
+
+       cbor "github.com/fxamacker/cbor/v2"
 )
 
 func ExampleRFC9783Claims_unmarshalCBOR() {
@@ -83,6 +85,15 @@ func ExampleRFC9783Claims_unmarshalJSON() {
                log.Fatalf("not a *RFC9783Claims: %T", claims)
        }
 
+       // Verify that psa-boot-seed is encoded with the expected key.
+       // This check will fail if it is still encoded as 2397 instead of 268.
+       encoded, err := EncodeClaimsToCBOR(claims)
+       var m map[int64]any
+       err = cbor.Unmarshal(encoded, &m)
+       if m[int64(268)] == nil && m[int64(2397)] != nil {
+               log.Fatalf("psa-boot-seed appears to be encoded as 2397")
+       }
+
        // output:
        // Profile: tag:psacertified.org,2023:psa#tfm
 }

Signed-off-by: Thomas Fossati <[email protected]>
@thomas-fossati
Copy link
Contributor Author

@thomas-fossati thank you so much. It seems that the psa-boot-seed is still encoded as 2397 for CBOR.

Thanks for catching this, @kentakayama!

It should be fixed in a33d5a1

@kentakayama
Copy link

@thomas-fossati
It works perfect. Thanks a lot.

@thomas-fossati thomas-fossati merged commit a6e4612 into main Dec 11, 2025
5 checks passed
@thomas-fossati thomas-fossati deleted the rfc9783 branch December 11, 2025 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants