@@ -213,7 +213,6 @@ async function _setup({
213
213
suiteName,
214
214
keyType
215
215
} ) {
216
- // stub suite canonize via Proxy cryptosuite.canonize and set safe to false
217
216
const credentials = new Map ( ) ;
218
217
const keyPair = await getMultiKey ( { keyType} ) ;
219
218
const signer = keyPair . signer ( ) ;
@@ -229,6 +228,7 @@ async function _setup({
229
228
mandatoryPointers
230
229
} )
231
230
} ) ) ) ;
231
+ // stub suite canonize via Proxy cryptosuite.canonize and set safe to false
232
232
credentials . set ( 'noTypeOrCryptosuite' ,
233
233
await issueCloned ( _generateNoTypeCryptosuite ( {
234
234
signer,
@@ -295,6 +295,38 @@ function unsafeProxy(suite) {
295
295
} ) ;
296
296
}
297
297
298
- function _commonSetup ( { } ) {
298
+ async function _commonSetup ( {
299
+ credential,
300
+ mandatoryPointers,
301
+ selectivePointers,
302
+ suiteName,
303
+ keyType
304
+ } ) {
305
+ const credentials = new Map ( ) ;
306
+ const keyPair = await getMultiKey ( { keyType} ) ;
307
+ const signer = keyPair . signer ( ) ;
308
+ const _credential = structuredClone ( credential ) ;
309
+ _credential . issuer = keyPair . controller ;
310
+ const { suite, selectiveSuite} = getSuites ( {
311
+ signer,
312
+ suiteName,
313
+ selectivePointers,
314
+ mandatoryPointers
315
+ } ) ;
316
+ credentials . set ( 'invalidHash' , await issueCloned ( {
317
+ credential : _credential ,
318
+ suite : invalidHashProxy ( { suite, suiteName} ) ,
319
+ selectiveSuite : invalidHashProxy ( { suite : selectiveSuite , suiteName} )
320
+ } ) ) ;
321
+ return credentials ;
322
+ }
323
+
324
+ function invalidHashProxy ( {
325
+ suiteName,
326
+ suite,
327
+ } ) {
328
+ if ( typeof suite !== 'object' ) {
329
+ return suite ;
330
+ }
299
331
300
332
}
0 commit comments