Use ZXing library to generate QR codes #6360
Merged
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.
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 useZXing
instead (as it already does for reading a QR code). With this switch iOS <> iOS as well as iOS <> Android cross-signing works correctly.