Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update go-cose to v1.3.1-rc.1 #33

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/lestrrat-go/jwx/v2 v2.0.8
github.com/stretchr/testify v1.8.1
github.com/veraison/eat v0.0.0-20220117140849-ddaf59d69f53
github.com/veraison/go-cose v1.2.1
github.com/veraison/go-cose v1.3.0-rc.1
github.com/veraison/psatoken v1.2.1-0.20240719122628-26fe500fd5d4
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKs
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/veraison/eat v0.0.0-20220117140849-ddaf59d69f53 h1:5gnX2TrGd/Xz8DOp2OaLtg/jLoIubSUTrgz6iZ58pJ4=
github.com/veraison/eat v0.0.0-20220117140849-ddaf59d69f53/go.mod h1:+kxt8iuFiVvKRs2VQ1Ho7bbAScXAB/kHFFuP5Biw19I=
github.com/veraison/go-cose v1.2.1 h1:Gj4x20D0YP79J2+cK3anjGEMwIkg2xX+TKVVGUXwNAc=
github.com/veraison/go-cose v1.2.1/go.mod h1:t6V8WJzHm1PD5HNsuDjW3KLv577uWb6UTzbZGvdQHD8=
github.com/veraison/go-cose v1.3.0-rc.1 h1:j7mMBdwkbq4c+pgEZVbbWG8UwVIgGHPp6+TAAYJj+UY=
github.com/veraison/go-cose v1.3.0-rc.1/go.mod h1:df09OV91aHoQWLmy1KsDdYiagtXgyAwAl8vFeFn1gMc=
github.com/veraison/psatoken v1.2.1-0.20240719122628-26fe500fd5d4 h1:N7qg7vDF2mUg7I+8AoU+ieJ20cgcShwFHXHkV5b2YAA=
github.com/veraison/psatoken v1.2.1-0.20240719122628-26fe500fd5d4/go.mod h1:6+WZzXr0ACXYiUAJJqTaCxW43gY2+gEaCoVNdDv3+Bw=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
Expand Down
15 changes: 2 additions & 13 deletions realm/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,10 @@ func ValidateRealmPubKeyCOSE(b []byte) error {
)
}

if k.KeyType != cose.KeyTypeEC2 {
if k.Type != cose.KeyTypeEC2 {
return fmt.Errorf("%w: realm public key is not EC2", psatoken.ErrWrongSyntax)
}

if err := k.Validate(); err != nil {
return fmt.Errorf(
"%w: validating EC2 realm public key: %v",
psatoken.ErrWrongSyntax, err,
)
}

return nil
}

Expand Down Expand Up @@ -155,14 +148,10 @@ func ECDSAPublicKeyFromCOSEKey(buf []byte) (*ecdsa.PublicKey, error) {
return nil, err
}

if k.KeyType != cose.KeyTypeEC2 {
if k.Type != cose.KeyTypeEC2 {
return nil, errors.New("key type is not EC2")
}

if err := k.Validate(); err != nil {
return nil, err
}

pk, err := k.PublicKey()
if err != nil {
return nil, err
Expand Down
Loading