@@ -31,6 +31,7 @@ import Modal from "../Modal";
3131import InteractiveAuthDialog from "../components/views/dialogs/InteractiveAuthDialog" ;
3232import { _t } from "../languageHandler" ;
3333import { SdkContextClass } from "../contexts/SDKContext" ;
34+ import { asyncSome } from "../utils/arrays" ;
3435
3536export enum Phase {
3637 Loading = 0 ,
@@ -108,20 +109,12 @@ export class SetupEncryptionStore extends EventEmitter {
108109 // do we have any other verified devices which are E2EE which we can verify against?
109110 const dehydratedDevice = await cli . getDehydratedDevice ( ) ;
110111 const ownUserId = cli . getUserId ( ) ! ;
111- const crossSigningInfo = cli . getStoredCrossSigningForUser ( ownUserId ) ;
112- this . hasDevicesToVerifyAgainst = cli . getStoredDevicesForUser ( ownUserId ) . some ( ( device ) => {
112+ this . hasDevicesToVerifyAgainst = await asyncSome ( cli . getStoredDevicesForUser ( ownUserId ) , async ( device ) => {
113113 if ( ! device . getIdentityKey ( ) || ( dehydratedDevice && device . deviceId == dehydratedDevice ?. device_id ) ) {
114114 return false ;
115115 }
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 ( ) ;
116+ const verificationStatus = await cli . getCrypto ( ) ?. getDeviceVerificationStatus ( ownUserId , device . deviceId ) ;
117+ return ! ! verificationStatus ?. signedByOwner ;
125118 } ) ;
126119
127120 this . phase = Phase . Intro ;
0 commit comments