Skip to content

Commit e4b76b8

Browse files
committed
Add test for enveloped vp with bad signature.
1 parent 9b021b5 commit e4b76b8

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

test/mocha/10-api.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,32 @@ describe('http API', () => {
128128
result.should.include.keys(['presentation', 'verified']);
129129
result.verified.should.equal(true);
130130
});
131+
132+
it('fails to verify a VCB barcode containing an enveloped VP' +
133+
'with a VC with a bad signature', async () => {
134+
let err;
135+
let result;
136+
try {
137+
const response = await httpClient.post(url, {
138+
agent: httpsAgent,
139+
json: {
140+
barcode: {
141+
data: mockData.badSignatureVcbPresentationText,
142+
format: 'qr_code'
143+
}
144+
}
145+
});
146+
result = response.data;
147+
} catch(e) {
148+
err = e;
149+
}
150+
assertNoError(err);
151+
should.exist(result);
152+
result.should.include.keys(['presentation', 'verified', 'error' ]);
153+
result.verified.should.equal(false);
154+
result.presentation.should.be.an('object');
155+
result.error.should.be.an('object');
156+
});
131157
});
132158

133159
describe('(legacy) verify a VCB', () => {

0 commit comments

Comments
 (0)