Skip to content

Commit

Permalink
revert encodeCanonical
Browse files Browse the repository at this point in the history
  • Loading branch information
noway committed Nov 10, 2021
1 parent 8a57e28 commit bef8fa3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function validateCOSESignature(
// payload : bstr
// ]
const SigStructure = ["Signature1", Buffer.from(protected_ as Buffer), Buffer.alloc(0), Buffer.from(payload_ as Buffer)];
const ToBeSigned = cbor.encodeCanonical(SigStructure);
const ToBeSigned = cbor.encode(SigStructure);
const messageHash = sha256.digest(ToBeSigned);
const signature = {
r: signature_.slice(0, signature_.length / 2),
Expand Down

0 comments on commit bef8fa3

Please sign in to comment.