This repository has been archived by the owner on Jul 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 52
fix: deriveKey in webkit linux (workaround) #313
Merged
Merged
Conversation
This file contains 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
Nice. This surfaced a proper error in macos webkit. Surprisingly, that test passes in linux webkit. |
Per sync discussion: A better fix will be to use a static key that is generated from a working implementation when the password is "". When the password is "" we know what the derived password is, so we can fill it in with a constant. This works around the issue in webkit linux by not having it try to generate that constant which fill fail. |
achingbrain
approved these changes
Apr 3, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a couple of nits for the types.
github-actions bot
pushed a commit
that referenced
this pull request
Apr 4, 2023
## [1.0.15](v1.0.14...v1.0.15) (2023-04-04) ### Bug Fixes * deriveKey in webkit linux (workaround) ([#313](#313)) ([4905944](4905944))
🎉 This PR is included in version 1.0.15 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
After some painful debugging (see: libp2p/js-libp2p#1627 (comment)) I've found out why js-libp2p fails on webkit in Linux. The subtlecrypto implementation doesn't like to derive a key from an empty imported key. This works on all other browsers, so it seems like the webkit implementation is doing the wrong thing. Maybe worth opening a bug and writing a test for them. In the mean time here's a workaround.
This unblocks webkit testing in the interop tester (which runs on linux). This also lets folks use js-libp2p from webkit based linux browsers, although it doesn't seem like anyone else ran into this issue.