Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibWeb: Implement and test WebCrypto AES-CBC #1971

Merged

Conversation

BenWiederhake
Copy link
Contributor

AES-CBC is one of the recommended suggested algorithms, and also present in a lot of WebCrypto WPT tests.

As such, this PR makes several thousand WPT tests green. It's not all green yet: It seems that all errors are due to other unimplemented features, but due to the sheer quantity it's hard to tell for sure.

One adjustment in LibCrypto is needed, to properly deal with the expanding padding in CMS mode. However, everything else happens only in the "glue" and management code in LibWeb. So even if we change to LibreSSL/WolfSSL/BoringSSL/PolarSSL/OpenSSL/whatever later, this PR will not be made obsolete.

I included a relatively "small" integration test to LibWeb. WPT already provides extensive coverage, and keeping the LibWeb tests relatively quick benefits us all, so only a quick smoke test is needed.

Note that I already incorporated the recent spec changes: w3c/webcrypto#375, w3c/webcrypto#378, w3c/webcrypto#381
These are just things I found while implementing it.

This alone lets us pass around 40 WPT tests:
WebCryptoAPI/import_export/symmetric_importKey.https.any
This lets us pass an additional (roughly) 40 WPT tests:
WebCryptoAPI/import_export/symmetric_importKey.https.any
This is progress towards passing more WPT tests, although none of them
gets green due to this commit.
This lets us pass an additional (roughly) 20 WPT tests:
WebCryptoAPI/encrypt_decrypt/aes_cbc.https.any
This lets us pass an additional (roughly) 15 WPT tests:
WebCryptoAPI/encrypt_decrypt/aes_cbc.https.any
@awesomekling awesomekling merged commit ff3d78f into LadybirdBrowser:master Oct 26, 2024
6 checks passed
@BenWiederhake BenWiederhake deleted the dev-webcrypto-aescbc branch October 26, 2024 16:40
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.

2 participants