Skip to content

Commit

Permalink
Fix SignMessage usage in test with new canonicalization pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan-lowman-dd committed Apr 14, 2022
1 parent 722aa3e commit e481cd3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2521,7 +2521,9 @@ func (rs *RepoSuite) TestAddOrUpdateSignatureWithDelegations(c *C) {
c.Assert(r.Snapshot(), DeepEquals, ErrInsufficientSignatures{"role1.json", verify.ErrNoSignatures})

// Sign role1.json.
sig, err := role1Key.SignMessage(role1Meta.Signed)
canonical, err := cjson.EncodeCanonical(role1Meta.Signed)
c.Assert(err, IsNil)
sig, err := role1Key.SignMessage(canonical)
c.Assert(err, IsNil)
err = r.AddOrUpdateSignature("role1.json", data.Signature{
KeyID: role1Key.PublicData().IDs()[0],
Expand Down

0 comments on commit e481cd3

Please sign in to comment.