return null on error with signed objects

This commit is contained in:
2020-03-10 13:37:12 +01:00
parent 3715ec5183
commit 38542bb422
2 changed files with 15 additions and 1 deletions

View File

@ -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');