mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -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. |
||
---|---|---|
.. | ||
00_crypto.js | ||
Cargo.toml | ||
decrypt.rs | ||
ed25519.rs | ||
encrypt.rs | ||
export_key.rs | ||
generate_key.rs | ||
import_key.rs | ||
key.rs | ||
lib.deno_crypto.d.ts | ||
lib.rs | ||
README.md | ||
shared.rs | ||
x25519.rs |
deno_crypto
This crate implements the Web Cryptography API.