1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00
denoland-deno/ext/crypto
Santhanam 52da60ed53
fix(deno/ext): Fix WebCrypto API's deriveKey (#19545)
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.
2023-06-19 13:26:58 +05:30
..
00_crypto.js fix(deno/ext): Fix WebCrypto API's deriveKey (#19545) 2023-06-19 13:26:58 +05:30
Cargo.toml chore: forward v1.34.3 release commit to main (#19526) 2023-06-16 01:55:31 +02:00
decrypt.rs refactor(core): bake single-thread assumptions into spawn/spawn_blocking (#19056) 2023-05-14 15:40:01 -06:00
ed25519.rs refactor: prefix ops w/ crate they are defined in (#19044) 2023-05-08 23:07:45 +02:00
encrypt.rs refactor(core): bake single-thread assumptions into spawn/spawn_blocking (#19056) 2023-05-14 15:40:01 -06:00
export_key.rs chore: add copyright_checker tool and add the missing copyright (#17285) 2023-01-13 16:51:32 +09:00
generate_key.rs refactor(core): bake single-thread assumptions into spawn/spawn_blocking (#19056) 2023-05-14 15:40:01 -06:00
import_key.rs chore: add copyright_checker tool and add the missing copyright (#17285) 2023-01-13 16:51:32 +09:00
key.rs chore: update copyright year to 2023 (#17247) 2023-01-02 21:00:42 +00:00
lib.deno_crypto.d.ts chore: update copyright year to 2023 (#17247) 2023-01-02 21:00:42 +00:00
lib.rs fix(ext/crypto): fix JWK import of Ed25519 (#19279) 2023-06-05 14:52:02 +02:00
README.md Rename extensions/ directory to ext/ (#11643) 2021-08-11 12:27:05 +02:00
shared.rs chore: add copyright_checker tool and add the missing copyright (#17285) 2023-01-13 16:51:32 +09:00
x25519.rs refactor: prefix ops w/ crate they are defined in (#19044) 2023-05-08 23:07:45 +02:00

deno_crypto

This crate implements the Web Cryptography API.

Spec: https://www.w3.org/TR/WebCryptoAPI/