Checklist
In which Project did the bug appear?
Matrix Dart SDK
On which platform did the bug appear?
All
SDK Version
6.1.1
Describe the problem caused by this bug
Suppose this Flutter device started the verification, and a remote device (Element web) accepts it.
When the user reaches the KeyVerificationState.askChoice stage, the "Emoji / SAS" verification method can be chosen.
If the user (this device) chooses the emoji method, the sas bytes are calculated correctly and the emojis correspond with the remote device.
However, if the remote device chooses the emoji method first, the emoji will be completely wrong and not correspond anymore.
This is caused by makeSas(int bytes) using the wrong order of users info, because this device started the verification, request.startedVerification will be true. However, because the remote device chose the emoji method instead, request.startedVerification should be false. (The opposite also applies).
If I manually set request.startedVerification to false in this Flutter device, the emoji will display correctly.
Client-side pseudo code:
_continuedVerification is set to true if this device chose the emoji method.
@override
bool shouldPopOnState(KeyVerificationState state) {
if (state == KeyVerificationState.askSas) {
verificationRequest.startedVerification = _continuedVerification; // FIX
}
return super.shouldPopOnState(state) || state == KeyVerificationState.askSas;
}
Checklist
In which Project did the bug appear?
Matrix Dart SDK
On which platform did the bug appear?
All
SDK Version
6.1.1
Describe the problem caused by this bug
Suppose this Flutter device started the verification, and a remote device (Element web) accepts it.
When the user reaches the
KeyVerificationState.askChoicestage, the "Emoji / SAS" verification method can be chosen.If the user (this device) chooses the emoji method, the sas bytes are calculated correctly and the emojis correspond with the remote device.
However, if the remote device chooses the emoji method first, the emoji will be completely wrong and not correspond anymore.
This is caused by
makeSas(int bytes)using the wrong order of users info, because this device started the verification,request.startedVerificationwill be true. However, because the remote device chose the emoji method instead,request.startedVerificationshould be false. (The opposite also applies).If I manually set
request.startedVerificationto false in this Flutter device, the emoji will display correctly.Client-side pseudo code:
_continuedVerificationis set to true if this device chose the emoji method.