isomorphic encoding a value that has already been encoded will
result in garbage data. `response_headers` is already encoded in
ISO-8859-1/latin1, we cannot use `from_string_pair`, as it triggers
ISO-8859-1/latin1 encoding.
Follow-up of https://github.com/LadybirdBrowser/ladybird/pull/1893
Add support for AES-KW for key wrapping/unwrapping. Very similar
implementation to other AES modes.
Added generic tests for symmetric import and specific AES-KW ones.
Adds ~400 test passes on WPT. Now we do better than Firefox in
`WebCryptoAPI/wrapKey_unwrapKey`!
Auto popovers now correctly establish a close watcher when shown.
This means popovers now correctly close with an escape key press.
Also correctly hide open popovers when removed from the document.
We do not concern ourselves with small OOM handling any longer. But the
main point of this patch is that we are for some reason getting a build
error with clang-19 here about ignoring a nodiscard return type inside
JsonArray::try_for_each.
An AK::String works fine for a USVString as a USVString is just a more
strict version of DOMString. Maybe we will have a different String type
for it in the future, but for now using an AK::String is fine and we do
not need this FIXME.
This change imports the remaining HTML-AAM tests from WPT that haven’t
yet been imported in any previous PRs — giving us complete in-tree
regression-testing coverage for all available WPT tests for the
requirements in the HTML-AAM spec.
This implements the last WebCryptoAPI methods `wrapKey` and `unwrapKey`.
Most of the functionality is already there because they rely on
`encrypt` and `decrypt`. The only test failures are for `AES-GCM` which
is not implemented yet.
The ASN1 structure for PCKS#8 was wrong and missing one wrapping of the
key in a OctetString.
The issue was discovered while implementing `wrapKey` and `unwrapKey` in
the next commits.
The ASN1 structure for PCKS#8 was wrong and missing one wrapping of the
key in a OctetString.
The issue was discovered while implementing `wrapKey` and `unwrapKey` in
the next commits.
The presence of padding in the base64 fields made plenty of WPT tests
fail. Additionally, export was performed with the wrong public key.
The issue was discovered while implementing `wrapKey` and `unwrapKey` in
the next commits.
The presence of padding in the base64 fields made plenty of WPT tests
fail.
The issue was discovered while implementing `wrapKey` and `unwrapKey` in
the next commits.
Previously, if `nullptr` was passed as params for
`wrap_in_private_key_info` or `wrap_in_subject_public_key_info` an ASN1
null was serialized. This was not the intended behaviour for many.
The issue was discovered while implementing `wrapKey` and `unwrapKey` in
the next commits.
The ASN1 structure for PCKS#8 was wrong and missing one wrapping of the
key in a OctetString.
The issue was discovered while implementing `wrapKey` and `unwrapKey` in
the next commits.
The presence of padding in the base64 fields and the typo made plenty of
WPT tests fail.
The issue was discovered while implementing `wrapKey` and `unwrapKey` in
the next commits.
The property was not accessible because it was not exposed to JS.
The issue was discovered while implementing `wrapKey` and `unwrapKey` in
the next commits.
The validation of the key size and specified algorithm was out of spec.
It is now implemented correctly like in `AesCbc`.
The issue was discovered while implementing `wrapKey` and `unwrapKey` in
the next commits.
The textbook RSA decryption method of `c^d % n` is quite slow. If the
necessary parameters are present, the CRT variant will be used.
Performing RSA decryption this way is ~3 times faster.
- Removed the constructor taking a (n, d, e) tuple and moved
it to `RSAPrivateKey`
- Removed default constructor with key generation because it was always
misused and the default key size is quite small
- Added utility constructors to accept a key pair, public key, private
key or both
- Made constructor parameters const
- Updated test to use generated random keys where possible
The previous implementation of `ModularInverse` was flaky and did not
compute the correct value in many occasions, especially with big numbers
like in RSA.
Also added a bunch of tests with big numbers.
The trimmed cache length of the `UnsignedBigInteger` was not reset after
an `add_into_accumulator_without_allocation` operation because the
function manipulates the words directly.
This meant that if the trimmed length was calculated before this
operation it would be wrong after.
The function AnimationEffect::phase() contained duplicated condition
checks for the animation phase determination. This refactor eliminates
the redundant checks by simplifying the logic.