Skip to content
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

Use ZXing library to generate QR codes #6360

Merged
merged 1 commit into from
Jun 29, 2022
Merged

Conversation

Anderas
Copy link
Contributor

@Anderas Anderas commented Jun 29, 2022

Resolves #6358

I do not have a ton of historical context here ...

At the moment cross-signing works between most clients but when scanning QR code generated on iOS by an Android device, the cross-signing fails (the opposite direction works). Both clients use ZXing library to scan QR code image, but only Android uses it to also generate one. On iOS we (used to) use native CIFilter.

After some rabbit hole investigation as to why Android cannot parse the iOS image I found that parsing works correctly if all data is a so-called byte mode. This is similar to an issue discovered in Rust-SDK. When using CIFilter however the client has no control over the format of the data and in fact it gets scanned as a series of alphanumeric, numeric and byte modes. As a result not all tokens get parsed properly and verification fails.

I could not find out whether the parsing failure is due to bad parsing implementation or flaky QR code format that we use. The simplest solution for the time being is simply to swap CIFilter to use ZXing instead (as it already does for reading a QR code). With this switch iOS <> iOS as well as iOS <> Android cross-signing works correctly.

@sonarcloud
Copy link

sonarcloud bot commented Jun 29, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@github-actions
Copy link

📱 Scan the QR code below to install the build for this PR.
🔒 This build is for internal testing purpose. Only devices listed in the ad-hoc provisioning profile can install Element Alpha.

QR code

If you can't scan the QR code you can install the build via this link: https://i.diawi.com/xykYRx

Copy link
Member

@BillCarsonFr BillCarsonFr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Anderas Anderas merged commit 8890369 into develop Jun 29, 2022
@Anderas Anderas deleted the andy/6358_cross_sign branch June 29, 2022 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android <> iOS Cross-signing
3 participants