@@ -109,14 +109,20 @@ export class SetupEncryptionStore extends EventEmitter {
109109 const dehydratedDevice = await cli . getDehydratedDevice ( ) ;
110110 const ownUserId = cli . getUserId ( ) ! ;
111111 const crossSigningInfo = cli . getStoredCrossSigningForUser ( ownUserId ) ;
112- this . hasDevicesToVerifyAgainst = cli
113- . getStoredDevicesForUser ( ownUserId )
114- . some (
115- ( device ) =>
116- device . getIdentityKey ( ) &&
117- ( ! dehydratedDevice || device . deviceId != dehydratedDevice . device_id ) &&
118- crossSigningInfo ?. checkDeviceTrust ( crossSigningInfo , device , false , true ) . isCrossSigningVerified ( ) ,
119- ) ;
112+ this . hasDevicesToVerifyAgainst = cli . getStoredDevicesForUser ( ownUserId ) . some ( ( device ) => {
113+ if ( ! device . getIdentityKey ( ) || ( dehydratedDevice && device . deviceId == dehydratedDevice ?. device_id ) ) {
114+ return false ;
115+ }
116+ // check if the device is signed by the cross-signing key stored for our user. Note that this is
117+ // *different* to calling `cryptoApi.getDeviceVerificationStatus`, because even if we have stored
118+ // a cross-signing key for our user, we don't necessarily trust it yet (In legacy Crypto, we have not
119+ // yet imported it into `Crypto.crossSigningInfo`, which for maximal confusion is a different object to
120+ // `Crypto.getStoredCrossSigningForUser(ownUserId)`).
121+ //
122+ // TODO: figure out wtf to to here for rust-crypto
123+ const verificationStatus = crossSigningInfo ?. checkDeviceTrust ( crossSigningInfo , device , false , true ) ;
124+ return ! ! verificationStatus ?. isCrossSigningVerified ( ) ;
125+ } ) ;
120126
121127 this . phase = Phase . Intro ;
122128 this . emit ( "update" ) ;
0 commit comments