return null on error with signed objects
This commit is contained in:
@ -107,6 +107,13 @@ test ('verify_signature', (t) => {
|
||||
t.deepEqual (obj, dec);
|
||||
});
|
||||
|
||||
test ('return null on invalid input', (t) => {
|
||||
const ver = crypto.verify_signature (null, 'foo');
|
||||
t.is (ver, null);
|
||||
const dec = crypto.decode_signed (null, 'foo');
|
||||
t.is (dec, null);
|
||||
});
|
||||
|
||||
test ('do not fail verification if timeout unspecified', async (t) => {
|
||||
const obj = { foo: 'bar' };
|
||||
const str = crypto.sign_object (obj, 'baz');
|
||||
|
Reference in New Issue
Block a user