From a5502276a443b35e56a83c594ecb058faa6fb554 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 28 Jun 2024 20:39:18 +0000 Subject: [PATCH] Add 64 byte tag to cbor and lint verify. --- tests/assertions.js | 4 +++- tests/suites/verify.js | 9 +++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/assertions.js b/tests/assertions.js index b9d9fa7..d82eee1 100644 --- a/tests/assertions.js +++ b/tests/assertions.js @@ -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; } diff --git a/tests/suites/verify.js b/tests/suites/verify.js index d7b74c2..42403dd 100644 --- a/tests/suites/verify.js +++ b/tests/suites/verify.js @@ -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 }); }); @@ -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 }); });