add tests for signature without timeout
This commit is contained in:
parent
cb9c142547
commit
8f227d8c0e
@ -107,6 +107,16 @@ test ('verify_signature', (t) => {
|
||||
t.deepEqual (obj, dec);
|
||||
});
|
||||
|
||||
test ('do not fail verification if timeout unspecified', async (t) => {
|
||||
const obj = { foo: 'bar' };
|
||||
const str = crypto.sign_object (obj, 'baz');
|
||||
await new Promise ((res) => {
|
||||
setTimeout (res, 10);
|
||||
});
|
||||
const dec = crypto.verify_signature (str, 'baz');
|
||||
t.deepEqual (obj, dec);
|
||||
});
|
||||
|
||||
test ('reject tampered signatures', (t) => {
|
||||
const obj = { foo: 'bar' };
|
||||
const str = crypto.sign_object (obj, 'baz');
|
||||
|
Loading…
x
Reference in New Issue
Block a user