Skip to content

Commit

Permalink
Add 64 byte tag to cbor and lint verify.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Jun 28, 2024
1 parent bb51e6b commit a550227
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 3 additions & 1 deletion tests/assertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ export const checkHmacKeyLength = ({proof, keyLength}) => {
export const shouldNotUseCborTags = ({proof}) => {
let error;
let result;
const tags = [];
tags[64] = bytes => bytes;
try {
// try to parse the base proof with no cbor tags
result = parseBaseProofValue({proof, tags: {}});
result = parseBaseProofValue({proof, tags});
} catch(e) {
error = e;
}
Expand Down
9 changes: 3 additions & 6 deletions tests/suites/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,11 @@ export function verifySuite({
verifier
});
await verificationFail({
credential: cloneTestVector(
disclosed?.invalid?.noProofType),
credential: cloneTestVector(disclosed?.invalid?.noProofType),
verifier
});
await verificationFail({
credential: cloneTestVector(
disclosed?.invalid?.noCryptosuite),
credential: cloneTestVector(disclosed?.invalid?.noCryptosuite),
verifier
});
});
Expand All @@ -133,8 +131,7 @@ export function verifySuite({
'to proofValue.', async function() {
this.test.link = 'https://w3c.github.io/vc-di-bbs/#base-proof-transformation-bbs-2023:~:text=and%20pseudonym.-,CBOR%2Dencode%20components%20per%20%5BRFC8949%5D%20where%20CBOR%20tagging%20MUST%20NOT%20be%20used%20on%20any%20of%20the%20components.%20Append%20the%20produced%20encoded%20value%20to%20proofValue.,-Return%20the%20derived';
await verificationFail({
credential: cloneTestVector(
disclosed?.invalid?.cborg),
credential: cloneTestVector(disclosed?.invalid?.cborg),
verifier
});
});
Expand Down

0 comments on commit a550227

Please sign in to comment.