mirror of
https://github.com/denoland/deno.git
synced 2024-12-28 01:59:06 -05:00
52da60ed53
Fixes a bug I noticed when deriving a key based from `ECDH`. Similar issue is also mentioned in #14693, where they derive a key using `PBKDF2` - In the WebCrypto API, `deriveKey()` is equivalent to `deriveBits()` followed by `importKey()` - But, `deriveKey()` requires just `deriveKey` in the `usages` of the `baseKey` parameter. The `deriveBits` usage is not required to be allowed. This is the uniform behaviour in Node, Chrome and Firefox. - The impl currently has userland-accessible `SubtleCrypto.deriveKey()` and `SubtleCrypto.deriveBits()`, as well as an internal `deriveBits()` (this is the one that accesses the ffi). - Also, `SubtleCrypto.deriveKey()` checks if `deriveKey` is an allowed usage and `SubtleCrypto.deriveBits()` checks if `deriveBits` is an allowed usage, as required. - However, the impl currently calls the userland accessible `SubtleCrypto.deriveBits()` in `SubtleCrypto.deriveKey()`, leading to an error being thrown if the `deriveBits` usage isn't present. - Fixed this by making it call the internal `deriveBits()` instead. |
||
---|---|---|
.. | ||
broadcast_channel | ||
cache | ||
console | ||
crypto | ||
fetch | ||
ffi | ||
fs | ||
http | ||
io | ||
kv | ||
napi | ||
net | ||
node | ||
tls | ||
url | ||
web | ||
webidl | ||
websocket | ||
webstorage |