LibWeb: Implement and test WebCrypto AES-CBC #1971
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.