Repository navigation
[Cocoa] AES-CBC decryption accepts empty ciphertext instead of rejecting with OperationError - #77402
Open
jpowersdev wants to merge 1 commit into
Open
jpowersdev wants to merge 1 commit into
jpowersdev wants to merge 1 commit into
Conversation
…ing with OperationError https://bugs.webkit.org/show_bug.cgi?id=327956 Reviewed by NOBODY (OOPS!). The Cocoa backend decrypts without CommonCrypto padding and then validates PKCS#7 padding itself. It currently skips that validation when the decrypted data is empty, allowing empty ciphertext to succeed. Reject empty decrypted data when padding is required, before reading the padding byte. Preserve unpadded decryption for WebAuthn callers and successful decryption of a full padding block to empty plaintext. Add Cocoa API tests for all three cases with 128-, 192-, and 256-bit keys. These tests allow this fix to land independently of the GCrypt fix and its layout tests in WebKit#77307. Validation: WebKit style checks and a C++ syntax check of the new API tests using the GTK developer build pass. Cocoa runtime tests have not been run locally; they require Apple CI or a macOS developer build. Tests: TestWebKitAPI.CryptoAlgorithmAESCBC.DecryptEmptyCipherText TestWebKitAPI.CryptoAlgorithmAESCBC.EncryptDecryptEmptyPlainText TestWebKitAPI.CryptoAlgorithmAESCBC.DecryptEmptyCipherTextWithoutPadding * Source/WebCore/crypto/cocoa/CryptoAlgorithmAESCBCCocoa.cpp: (WebCore::CryptoAlgorithmAESCBC::platformDecrypt): * Tools/TestWebKitAPI/PlatformCocoa.cmake: * Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * Tools/TestWebKitAPI/Tests/WebCore/cocoa/CryptoAlgorithmAESCBC.cpp: Added. (TestWebKitAPI::TEST):
Collaborator
|
EWS run on current version of this PR (hash 56a8a1f) Details |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🧪 webkitpy
56a8a1f
56a8a1f
🛠 playstation