crypto: Implement encrypt/decrypt for AES-CBC + JWK support (#33795)

* Add support for raw importKey with AES-CBC

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Support JWK import/export, importKey for AES-CBC

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Implement encrypt/decrypt for AES-CBC

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update Cargo.lock

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Pass MutableHandleObject as arg instead of returning raw pointer

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Swap order of checks in generate_key_aes_cbc

- Fixes WPT tests that expect to error on algorithm first before usages

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Avoid potential GC hazard with array_buffer_ptr

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update expectations for discards context

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
This commit is contained in:
Daniel Adams 2024-10-20 21:32:19 -10:00 committed by GitHub
parent 397c5adf79
commit 45267c9f28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
55 changed files with 163938 additions and 2799 deletions

View file

@ -85,6 +85,10 @@ impl CryptoKey {
self.algorithm.borrow().to_string()
}
pub fn usages(&self) -> &[KeyUsage] {
&self.usages
}
pub fn handle(&self) -> &Handle {
&self.handle
}