-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix(PublicSessionKeyStore): Include nodeId in scope #306
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
🎉 This PR is included in version 1.68.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
gnarea
added a commit
to relaycorp/awala-keystore-file-jvm
that referenced
this pull request
Dec 17, 2023
kodiakhq bot
pushed a commit
to relaycorp/awala-keystore-file-jvm
that referenced
this pull request
Dec 17, 2023
gnarea
added a commit
to relaycorp/awala-endpoint-android
that referenced
this pull request
Dec 18, 2023
…e third-party endpoint Due to bugs in the key stores (relaycorp/awala-jvm#306, relaycorp/awala-jvm#310), we were accidentally reusing the same session keys, which the third-party endpoint rightfully refused. This PR will integrate the two breaking changes above, plus one additional change needed to make this work. A consequence of this change is that **we'll now need to pass the linked first-party endpoint when importing and deleting a third-party endpoint**, so that we know which session keys to delete in case the same third-party endpoint is used by another first-party endpoint. # TODO - [ ] Pass first-party endpoint to every function call inside `ThirdPartyEndpoint.delete()`: https://github.com/relaycorp/awala-endpoint-android/blob/6ecb5345d67bf29033b0e27a02d91e7d1b35c02a/lib/src/main/java/tech/relaycorp/awaladroid/endpoint/ThirdPartyEndpoint.kt#L31-L36 This should look like this, roughly (untested): ``` public open suspend fun delete(linkedFirstPartyEndpoint: FirstPartyEndpoint) { val context = Awala.getContextOrThrow() context.privateKeyStore.deleteBoundSessionKeys(linkedFirstPartyEndpoint.nodeId, nodeId) context.sessionPublicKeyStore.delete(linkedFirstPartyEndpoint.nodeId, nodeId) context.channelManager.delete(linkedFirstPartyEndpoint, this) } ``` - Replace `delete(ThirdPartyEndpoint)` in `ChannelManager` with `delete(FirstPartyEndpoint, ThirdPartyEndpoint)`, and only delete the items for the given first-/third-party endpoint pair. This change is needed by the previous task. - Replace `import(ByteArray)` in `PrivateThirdPartyEndpoint` with `import(ByteArray, FirstPartyEndpoint)`, and pass the first-party endpoint to https://github.com/relaycorp/awala-endpoint-android/blob/6ecb5345d67bf29033b0e27a02d91e7d1b35c02a/lib/src/main/java/tech/relaycorp/awaladroid/endpoint/ThirdPartyEndpoint.kt#L183 - Replace `import(ByteArray)` in `PublicThirdPartyEndpoint` with `import(ByteArray, FirstPartyEndpoint)`, and pass the first-party endpoint to https://github.com/relaycorp/awala-endpoint-android/blob/6ecb5345d67bf29033b0e27a02d91e7d1b35c02a/lib/src/main/java/tech/relaycorp/awaladroid/endpoint/ThirdPartyEndpoint.kt#L249-L252
4 tasks
kodiakhq bot
pushed a commit
to relaycorp/awala-endpoint-android
that referenced
this pull request
Dec 26, 2023
…e third-party endpoint (#361) Due to bugs in the key stores (relaycorp/awala-jvm#306, relaycorp/awala-jvm#310), we were accidentally reusing the same session keys, which the third-party endpoint rightfully refused. This PR will integrate the two breaking changes above, plus one additional change needed to make this work. A consequence of this change is that **we'll now need to pass the linked first-party endpoint when importing and deleting a third-party endpoint**, so that we know which session keys to delete in case the same third-party endpoint is used by another first-party endpoint. # TODO Each of the following require updating the respective test suite. - [x] Pass first-party endpoint to every function call inside `ThirdPartyEndpoint.delete()`: https://github.com/relaycorp/awala-endpoint-android/blob/6ecb5345d67bf29033b0e27a02d91e7d1b35c02a/lib/src/main/java/tech/relaycorp/awaladroid/endpoint/ThirdPartyEndpoint.kt#L31-L36 This should look like this, roughly (untested): ```kotlin public open suspend fun delete(linkedFirstPartyEndpoint: FirstPartyEndpoint) { val context = Awala.getContextOrThrow() context.privateKeyStore.deleteBoundSessionKeys(linkedFirstPartyEndpoint.nodeId, nodeId) context.sessionPublicKeyStore.delete(linkedFirstPartyEndpoint.nodeId, nodeId) context.channelManager.delete(linkedFirstPartyEndpoint, this) } ``` - [x] Replace `delete(ThirdPartyEndpoint)` in `ChannelManager` with `delete(FirstPartyEndpoint, ThirdPartyEndpoint)`, and only delete the items for the given first-/third-party endpoint pair. This change is needed by the previous task. - [x] Replace `import(ByteArray)` in `PrivateThirdPartyEndpoint` with `import(ByteArray, FirstPartyEndpoint)`, and pass the first-party endpoint to https://github.com/relaycorp/awala-endpoint-android/blob/6ecb5345d67bf29033b0e27a02d91e7d1b35c02a/lib/src/main/java/tech/relaycorp/awaladroid/endpoint/ThirdPartyEndpoint.kt#L183 - [x] Replace `import(ByteArray)` in `PublicThirdPartyEndpoint` with `import(ByteArray, FirstPartyEndpoint)`, and pass the first-party endpoint to https://github.com/relaycorp/awala-endpoint-android/blob/6ecb5345d67bf29033b0e27a02d91e7d1b35c02a/lib/src/main/java/tech/relaycorp/awaladroid/endpoint/ThirdPartyEndpoint.kt#L249-L252
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.
No description provided.