Skip to content

net: Use aws-lc-rs for subresource integrity instead of sha2 crate - #47214

Merged
kkoyung merged 1 commit into
servo:mainfrom
Narfinger:subresource-aws
Aug 13, 2026
Merged

kkoyung merged 1 commit into
servo:mainfrom
Narfinger:subresource-aws

Conversation

@Narfinger

Copy link
Copy Markdown
Contributor

This switches the subresource integrity system from the sha2 crate to aws-lc-rs.

Aws-lc-rs is currently the backend for tls and tls anyway needs sha2.

This saves us ~0.2Mb of binary size in production-stripped when webcrypto is disabled.

Testing: SHA algorithms should be the same, no matter from which crate they come. Subresource integrity should have WPT tests.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Aug 13, 2026
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Aug 13, 2026
@kkoyung
kkoyung added this pull request to the merge queue Aug 13, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Aug 13, 2026
Merged via the queue into servo:main with commit e0b630f Aug 13, 2026
36 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Aug 13, 2026
@Narfinger
Narfinger deleted the subresource-aws branch August 14, 2026 07:19
pull Bot pushed a commit to AKJUS/servo that referenced this pull request Aug 14, 2026
Needs servo#47214

Subresource integrity was using strings compares at multiple points and
needlessly used allocated strings. This uses an enum which allows us to
enforce the priority with a PartialOrd.
This removes one unit test for checking the order of the hash function
as it is now not necessary.

Testing: WPT test should test subresource integrity
(https://github.com/Narfinger/servo/actions/runs/31698050312)

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
RichardTjokroutomo pushed a commit to RichardTjokroutomo/servo that referenced this pull request Oct 6, 2026
…ervo#47214)

This switches the subresource integrity system from the sha2 crate to
aws-lc-rs.

Aws-lc-rs is currently the backend for tls and tls anyway needs sha2.

This saves us ~0.2Mb of binary size in production-stripped when
webcrypto is disabled.

Testing: SHA algorithms should be the same, no matter from which crate
they come. Subresource integrity should have WPT tests.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
RichardTjokroutomo pushed a commit to RichardTjokroutomo/servo that referenced this pull request Oct 6, 2026
Needs servo#47214

Subresource integrity was using strings compares at multiple points and
needlessly used allocated strings. This uses an enum which allows us to
enforce the priority with a PartialOrd.
This removes one unit test for checking the order of the hash function
as it is now not necessary.

Testing: WPT test should test subresource integrity
(https://github.com/Narfinger/servo/actions/runs/31698050312)

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants