| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* script: Generate trait for all DOM interfaces and parameterize generated Methods traits over it.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Update trait implementations with new generic type.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Formatting.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix 192-bit key length check for AES-GCM encrypt/decrypt
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Update expectations
- Regenerated legacy ones as they had outdated expectations
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Add missed expectations
Signed-off-by: Daniel Adams <msub2official@gmail.com>
---------
Signed-off-by: Daniel Adams <msub2official@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Improve JWK handling, HMAC import
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Update expectations
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Fix logic in parse_jwk, properly stringify key_ops
Signed-off-by: Daniel Adams <msub2official@gmail.com>
---------
Signed-off-by: Daniel Adams <msub2official@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Support normalizing AES-GCM for encryption
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Implement "encrypt" operation for AES-GCM
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Allow importing AES-GCM keys
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Implement AES-GCM decryption
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Allow normalizing AES-GCM for "generate key"
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update WPT expectations
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* fmt
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Fix clippy errors
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Remove silly checks
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Support AES-GCM 128-bit encryption with 128 bit IV
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Support AES-GCM with wrapKey/unwrapKey
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update WPT expectations (again)
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Support key wrapping operations + AES-KW
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Update expectations
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* tidy
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Add allow for clippy
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Add missing spec links
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Improve JWK handling
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Fix clippy warnings
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* ./mach fmt
Signed-off-by: Daniel Adams <msub2official@gmail.com>
---------
Signed-off-by: Daniel Adams <msub2official@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Implement HMAC key generation
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update WPT expectations
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
object (#34239)
* Don't throw exceptions twice when converting to Algorithm object
Removes match statements like
```rust
let Ok(ConversionResult::Success(algorithm)) = Algorithm::new(cx, value.handle())
else {
return Err(Error::Syntax);
};
```
These don't cause issues if `Algorithm::new` returns `Ok(ConversionResult::Failure`,
but in the case of `Err(())` the implementation already called `throw_type_error`
and we must not throw an additional Syntax error, otherwise we'll crash.
Luckily, this case is already handled elsewhere by the
`value_from_js_object` macro.
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Test that calling subtlecrypto methods with empty algorithm objects throws a TypeError
The WebCryptoAPI spec does not tell us which error to throw exactly, but
according to https://webidl.spec.whatwg.org/ it should be a TypeError.
This previously crashed servo.
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Implement "get key length" for HMAC keys
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update WPT expectations
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Allow importing HMAC keys
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Implement crypto.subtle.sign with HMAC
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Implement crypto.subtle.verify with HMAC
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update WPT expectations
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Implement subtlecrypto.deriveBits with HKDF
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update WPT expectations
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Implement specialized normalize_algorithm for "get key length" operation
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Implement specialized normalize_algorithm for "digest"
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Implement specialized normalize_algorithm for "importKey"
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Implement specialized normalize_algorithm for "deriveBits"
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Implement specialized normalize_algorithm for "decrypt"
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Implement specialized normalize_algorithm for "generateKey"
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Implement specialized normalize_algorithm for "encrypt"
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Remove normalize_algorithm
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update WPT expectations
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Replace obj.get_unsafe() with obj.get()
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Replace BitwiseOr with LogicalOr (typo)
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update more WPT expectations outside of WebCryptoAPI
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Implement NormalizedAlgorithm::get_key_length
This is a minimal implementation, which will make
the DeriveKey operation work for AES-CTR keys in
the future.
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Implement SubtleCrypto.deriveKey
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update WPT expectations
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Start implementing SubtleCrypto.deriveBits
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Move shared crypto operations into their own functions
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update some doclinks
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Remove note about potential no-op
It is, indeed, a no-op.
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Move normalized algorithm digest operation into its own function
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Implement mvp for pbkdf2 derivation
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Add missing division to derive bytes instead of bits
The length argument specifies the number of bits that
we need to derive, so we should divide it by 8 to
get the number of bytes.
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Allow using PBKDF2 with usage "importKey"
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update WPT expectations
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Fix test-tidy errors
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Fix clippy warnings
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Return cached object from CryptoKey.algorithm getter
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Test that CryptoKey.algorithm returns a cached object
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Move duplicated code into a helper function
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Implement SubtleCrypto.digest
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update WPT expectations
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add support for AES-CTR operations
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Update expectations
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* clippy
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Consolidate encrypt/decrypt for AES-CTR
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Update expectations
Signed-off-by: Daniel Adams <msub2official@gmail.com>
---------
Signed-off-by: Daniel Adams <msub2official@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add CanGc annotations to promise constructor.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Propagate CanGc arguments for Promise::new_in_current_realm.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Fix out-of-order entries.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Propagate CanGc from Promise::new.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Suppress clippy warning.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Formatting.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
|
|
|
| |
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
| |
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
|
|
|
| |
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
|
|
* Update IDLs and Bindings conf
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Add AES crate
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Implement DOM interfaces
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* IDL tidy
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Remove deriveKey from inRealms for now until implemented
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Fix CryptoKey rustdoc comments
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Move string constants to top of file
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Use properly rooted CryptoKey
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Code clarity
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Rework NormalizedAlgorithm to not hold a DOMString
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Add Rustdoc for CryptoKey interface
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Move ignore mallocsizeof to rand crate, remove from crypto
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Update cargo lock
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Fix key handling, implement exportKey with JWK TODO
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Add missing spec link
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Use create_buffer_source, remove aes dep from libservo
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Fix crash when running in worker
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Update expectations
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* fmt
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Move CryptoKey and SubtleCrypto behind pref for now
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Update expectations
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Readd timeout expectation
Signed-off-by: Daniel Adams <msub2official@gmail.com>
---------
Signed-off-by: Daniel Adams <msub2official@gmail.com>
|