Skip to content

Commit 31e6d79

Browse files
committed
Start on invalid disclosure proofValue header.
1 parent f2563cd commit 31e6d79

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

tests/suites/algorithms-sd.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,11 @@ import {
77
generators,
88
issueCloned
99
} from 'data-integrity-test-suite-assertion';
10-
import {
11-
shouldBeBaseProofValue,
12-
shouldBeBs64UrlNoPad,
13-
shouldHaveHeaderBytes,
14-
} from '../assertions.js';
15-
import {createInitialVc} from '../helpers.js';
16-
import {expect} from 'chai';
10+
import {createInitialVc, getBs64UrlBytes} from '../helpers.js';
1711
import {getMultiKey} from '../vc-generator/key-gen.js';
1812
import {getSuites} from './helpers.js';
1913
import {invalidCborTagProxy} from './proxies.js';
14+
import {shouldBeBaseProofValue} from '../assertions.js';
2015

2116
export function sd2023Algorithms({
2217
credential,
@@ -164,16 +159,12 @@ export function sd2023Algorithms({
164159
'MUST be raised and SHOULD convey an error type of ' +
165160
'PROOF_VERIFICATION_ERROR.', async function() {
166161
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#selective-disclosure-functions:~:text=If%20the%20decodedProofValue%20does%20not%20start%20with%20the%20ECDSA%2DSD%20disclosure%20proof%20header%20bytes%200xd9%2C%200x5d%2C%20and%200x01%2C%20an%20error%20MUST%20be%20raised%20and%20SHOULD%20convey%20an%20error%20type%20of%20PROOF_VERIFICATION_ERROR.';
167-
this.test.cell.skipMessage = 'Not Implemented';
168-
this.skip();
169-
/*
170162
await assertions.verificationFail({
171163
verifier,
172164
credential: fixtures.get('invalidDisclosureProofHeader'),
173165
reason: 'Should not verify VC with invalid disclosure proof ' +
174166
'header'
175167
});
176-
*/
177168
});
178169
it('If the result is not an array of the following five elements ' +
179170
'— a byte array of length 64; a byte array of length 36; an array ' +
@@ -341,5 +332,9 @@ async function _setup({
341332
nonbase64ProofValue.proof.proofValue =
342333
nonbase64ProofValue.proof.proofValue.substring(1);
343334
credentials.set('invalidProofValuePrefix', nonbase64ProofValue);
335+
const invalidProofValueHeader = structuredClone(securedCredential);
336+
const disclosureBytes = getBs64UrlBytes(
337+
invalidProofValueHeader?.proof?.proofValue);
338+
credentials.set('invalidDisclosureProofHeader', null);
344339
return credentials;
345340
}

0 commit comments

Comments
 (0)