PeculiarVentures / webcrypto-core

A input validation layer for WebCrypto polyfills.
MIT License
28 stars 13 forks source link

Fix nullability checks #65

Open shamilovtim opened 6 months ago

shamilovtim commented 6 months ago

In JS the following holds true:

const foo = { maybe: undefined };
const bar = {};

> "maybe" in foo;
true
> "maybe" in bar;
false

This library uses nullability checks such that (e.g.)!("tagLength" in algorithm) which causes unhandled exceptions when the key exists but is undefined