-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accept EcdsaCompact signatures for legacy keys (#508)
Changes include: - Update example app to use v2 legacy signing flow - Update error messages in libxmtp to be more descriptive, as well as add more logging - Prefix libxmtp logs with `[libxmtp]` to make filtering easier - Accept `EcdsaCompact` signatures for legacy keys in addition to the existing `WalletEcdsaCompact` I'm not sure if there is an interop bug in Android somewhere, but it's better for Rust to just be permissive with the signatures here, and we can loop back if there is truly an issue in Android. _____ My notes on `EcdsaCompact` for posterity: it looks like JS will throw if WalletEcdsaCompact is not set: https://github.com/xmtp/xmtp-js/blob/main/src/crypto/PublicKey.ts#L145. However, they map ecdsaCompact from the legacy key to walletEcdsaCompact when translating from PrivateKeyBundleV1 to a PrivateKeyBundleV2 : https://github.com/xmtp/xmtp-js/blob/main/src/crypto/PublicKey.ts#L204 I think the bug in Android is the translation step from V1 to V2, which is copying the old signature as-is: https://github.com/xmtp/xmtp-android/blob/edd7eb27dd30a557be6ef81f0a4221c5ebfbb259/library/src/main/java/org/xmtp/android/library/messages/SignedPrivateKey.kt#L17 I'm not sure whether this breaks anything in practice, because I'm not sure whether Android uploads the resulting V2 bundle to the network afterwards, or just consumes it locally on the client. ____ Also for the V2 bundles, it seems we're leaving it up to the integrator to implement SigningKey: https://github.com/xmtp/xmtp-android?tab=readme-ov-file#create-a-client The SigningKey interface basically leaves it up to them whether they set EcdsaCompact or WalletEcdsaCompact, for example this is a SigningKey implementation: https://github.com/xmtp/xmtp-android/blob/edd7eb27dd30a557be6ef81f0a4221c5ebfbb259/library/src/main/java/org/xmtp/android/library/messages/PrivateKey.kt#L88 I'm not sure whether or not the SDK gracefully handles that case
- Loading branch information
1 parent
f37b2a6
commit 8c182f5
Showing
13 changed files
with
149 additions
and
56 deletions.
There are no files selected for viewing
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
Binary file not shown.
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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
plugins { | ||
id 'com.android.application' version '7.3.1' apply false | ||
id 'com.android.library' version '7.3.1' apply false | ||
id 'com.android.application' version '8.0.0-rc01' apply false | ||
id 'com.android.library' version '8.0.0-rc01' apply false | ||
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false | ||
} |
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
2 changes: 1 addition & 1 deletion
2
examples/android/xmtpv3_example/gradle/wrapper/gradle-wrapper.properties
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Wed Mar 29 17:13:20 PDT 2023 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip | ||
distributionPath=wrapper/dists | ||
zipStorePath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME |
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 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 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 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
Oops, something went wrong.