Commit graph

66189 commits

Author SHA1 Message Date
Jelle Raaijmakers
03aafda788 CI: Post comment when PR has a merge conflict
Switch out the action with another one that actually supports posting
comments :^)
2024-12-17 07:07:16 -08:00
Jelle Raaijmakers
25e05e76c4 CI: Remove always() from job conditionals
These jobs have no dependencies on other jobs, nor should they be
uncancelable.
2024-12-17 05:20:58 -08:00
Jelle Raaijmakers
cf9bf59550 CI: Remove branch conditional from nightly Android build
Apart from the fact that this workflow is failing every time, we don't
need to check the branch we're on since it's only invoked for the
default branch of the repository. We can also remove the `always()`
since there are no job dependencies nor do we want this to be
uncancelable.
2024-12-17 05:20:58 -08:00
Jelle Raaijmakers
b00bb05b6b CI: Refactor branch matching in jobs
Matching `master` can be a bit simpler and prevent invoking the job
altogether. Additionally, we don't need an `always()` here: we don't
have job dependencies and we want these jobs to be cancelable.
2024-12-17 05:20:58 -08:00
Jelle Raaijmakers
8ddd9ea5f4 CI: Convert paths-ignore into separate job that checks changed paths
We need to invoke the CI jobs every time, even if nothing relevant has
changed, because we marked them as required status checks for PRs. If
they are not invoked, the associated status checks remain in a 'pending'
state indefinitely not allowing us to (auto-)merge the PR.
2024-12-17 05:20:58 -08:00
Jelle Raaijmakers
1b01464e41 CI: Add permissions to merge conflict labeler
This was not necessary in my own test repository, but maybe we need it
here regardless.
2024-12-17 13:58:34 +01:00
Jelle Raaijmakers
9ccaa3b7eb CI: Automatically label PRs with merge conflicts
This action adds and removes the new "conflicts" label to indicate
whether a pull request is in need of conflict resolution. This both
automatically informs the author of the PR that this is the case, if
they have notifications enabled that is, and makes for an easier
evaluation of the PR queue.
2024-12-17 13:53:23 +01:00
Feng Yu
e0c0668f3d LibWeb: Avoid re-encoding response headers
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
2024-12-17 13:44:10 +01:00
Luke Wilde
3063be11a9 LibWeb/WebAudio: Implement BaseAudioContext#createPanner
Required by Unity Web games.
2024-12-17 13:38:20 +01:00
Luke Wilde
4f691c2410 LibWeb/WebAudio: Implement PannerNode
Required by https://scottts.itch.io/different-strokes
2024-12-17 13:38:20 +01:00
stasoid
27a654c739 LibGC: Port to Windows 2024-12-17 12:14:41 +01:00
stasoid
969fb1a3a8 LibRequests: Port to Windows 2024-12-17 11:07:53 +01:00
stasoid
212cea4535 LibCore: Add System::getpid 2024-12-17 11:07:53 +01:00
devgianlu
94374f0d19 LibWeb: Implement AES-KW in WebCryptoAPI
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`!
2024-12-17 11:00:14 +01:00
devgianlu
1d94d678b3 LibCrypto: Implement AES-KW
Add the AES-KW (Key Wrap) implementation as of
https://www.rfc-editor.org/rfc/rfc3394#section-4.2.

Tests are taken from section 4 of RFC3394.
2024-12-17 11:00:14 +01:00
Luke Warlow
0a02eb639d LibWeb: Implement popover's close watcher
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.
2024-12-17 04:55:55 +01:00
InvalidUsernameException
09a55e56ee LibWeb: Add support for object-fit: scale-down 2024-12-16 20:47:32 +01:00
sideshowbarker
1b165d887b LibWeb: Support the ARIA “sectionheader” & “sectionfooter” roles 2024-12-16 06:56:31 -08:00
Timothy Flynn
203267fcc2 LibWeb: Do not worry about small OOM in JsonWebKey::parse
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.
2024-12-16 06:46:36 -08:00
Shannon Booth
e5436ce593 LibWeb/HTML: Remove uneeded FIXME about use of USVString
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.
2024-12-16 05:03:00 -08:00
Shannon Booth
a5bdc56063 LibWeb/HTML: Make ErrorEvent::create a trusted event
Matching DOM::Event.
2024-12-16 05:03:00 -08:00
sideshowbarker
aa5207199f Tests: Import remaining HTML-AAM tests (no code)
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.
2024-12-16 04:59:46 -08:00
devgianlu
6ef8b54d21 LibWeb: Add support for AES-GCM encrypt and decrypt
Adds ~400 WPT test passes.
2024-12-16 13:27:53 +01:00
devgianlu
1ae28324bd LibCrypto: Accept correct IV sizes for AES-GCM
AES-GCM should accept 96-bits keys as is. Any other key should be
preprocessed with GHASH.
2024-12-16 13:27:53 +01:00
devgianlu
3167d4f06b LibCrypto: Move GHash hashing routine to separate function
This allows for the function to be used outside `GHash`. In particular,
it'll be used for IV preparation in AES-GCM.
2024-12-16 13:27:53 +01:00
Glenn Skrzypczak
e18fb7fc93 LibWeb/Fetch: Handle streams on abort
When aborting fetch, the request stream now gets closed and the
response stream errors.
2024-12-16 12:43:16 +01:00
Glenn Skrzypczak
b263cd11f7 LibWeb/Fetch: Deserialize abort reason
Deserialize the fetch controllers abort reason according to the spec.
Currently fetch does not support a scenario where this actually happens.
2024-12-16 12:43:16 +01:00
Tim Ledbetter
2b1725ea51 LibWeb: Collapse selection when selecting text inside a text control 2024-12-16 11:43:28 +01:00
devgianlu
584cbcf3ef LibWeb: Implement wrapKey and unwrapKey methods
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.
2024-12-16 11:35:00 +01:00
devgianlu
c1a65f3d53 LibWeb: Parse JsonWebKey from string
Add the ability to parse a `JsonWebKey` structure from a raw string.
2024-12-16 11:35:00 +01:00
devgianlu
06733bea48 LibWeb: Fix X448 PCKS#8 key export format
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.
2024-12-16 11:35:00 +01:00
devgianlu
89f1f3f31c LibWeb: Fix X25519 PCKS#8 key export format
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.
2024-12-16 11:35:00 +01:00
devgianlu
880401030d LibWeb: Fix X448 JWK key export format
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.
2024-12-16 11:35:00 +01:00
devgianlu
ac99e2791f LibWeb: Fix X25519 JWK key export format
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.
2024-12-16 11:35:00 +01:00
devgianlu
08af878466 LibCrypto+LibWeb: Allow serializing key info without params
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.
2024-12-16 11:35:00 +01:00
devgianlu
718b78dd43 LibWeb: Import WPT RSA.importKey tests
This serves as a control for the changes in the next commits. I
originally had a regression, but did not notice because the tests were
missing.
2024-12-16 11:35:00 +01:00
devgianlu
9613b87b12 LibWeb: Fix ED25519 PCKS#8 key export format
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.
2024-12-16 11:35:00 +01:00
devgianlu
6e33dbb533 LibWeb: Fix ED25519 JWK key export format
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.
2024-12-16 11:35:00 +01:00
devgianlu
a65110ec06 LibWeb: Define HmacKeyAlgorithm native accessor for length property
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.
2024-12-16 11:35:00 +01:00
devgianlu
1e98fa96d7 LibWeb: Fix bogus AesGcm and AesCtr key import length validation
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.
2024-12-16 11:35:00 +01:00
Lucas CHOLLET
2174e5dfcc LibGfx: Remove ICC::Profile and friends
This is not really used anymore since the fork.
2024-12-16 07:39:49 +01:00
devgianlu
57cc248883 LibCrypto: Add optimized RSA decryption with CRT method
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.
2024-12-15 23:31:49 +01:00
devgianlu
ec990d620f LibCrypto: Cleanup Crypto::PK::RSA constructors to avoid pitfalls
- 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
2024-12-15 23:31:49 +01:00
devgianlu
f49a55d089 LibCrypto: Update ModularInverse implementation to use extended GCD
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.
2024-12-15 23:31:49 +01:00
devgianlu
b35764da0e LibCrypto: Add extended GCD algorithm 2024-12-15 23:31:49 +01:00
devgianlu
a74ef5df3d LibCrypto: Reset cached trimmed length after add_into_accumulator
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.
2024-12-15 23:31:49 +01:00
Pavel Shliak
40bf8dde88 LibWeb: Remove unnecessary Quad.h include 2024-12-15 23:27:42 +01:00
Aaron Van Doren
7824721107 LibGfx: Verify Rect and Quad are consistent in boundary point inclusions 2024-12-15 23:27:42 +01:00
Aaron Van Doren
5c4e162ba9 LibGfx: Implement even-odd method for Quad::contains() and add tests 2024-12-15 23:27:42 +01:00
Gustavo Ramirez
108701c899 LibWeb/CSS: Refactor phase() method to reduce redundancy
The function AnimationEffect::phase() contained duplicated condition
checks for the animation phase determination. This refactor eliminates
the redundant checks by simplifying the logic.
2024-12-15 10:05:08 +00:00