Merge pull request #8352 from vector-im/feature/bca/fix_is_identity_trusted_api

fix rust isCrossSigningVerified
This commit is contained in:
Valere 2023-04-24 16:54:10 +02:00 committed by GitHub
commit 63451611a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

1
changelog.d/8352.bugfix Normal file
View File

@ -0,0 +1 @@
Fix: RustCrossSigning service API confusion (identity trusted vs own device trusted by identity)

View File

@ -24,7 +24,7 @@ import org.matrix.android.sdk.api.util.Optional
interface CrossSigningService { interface CrossSigningService {
/** /**
* Is our own device signed by our own cross signing identity. * Is our published identity trusted.
*/ */
suspend fun isCrossSigningVerified(): Boolean suspend fun isCrossSigningVerified(): Boolean

View File

@ -36,11 +36,11 @@ internal class RustCrossSigningService @Inject constructor(
) : CrossSigningService { ) : CrossSigningService {
/** /**
* Is our own device signed by our own cross signing identity * Is our own identity trusted
*/ */
override suspend fun isCrossSigningVerified(): Boolean { override suspend fun isCrossSigningVerified(): Boolean {
return when (val identity = olmMachine.getIdentity(olmMachine.userId())) { return when (val identity = olmMachine.getIdentity(olmMachine.userId())) {
is OwnUserIdentity -> identity.trustsOurOwnDevice() is OwnUserIdentity -> identity.verified()
else -> false else -> false
} }
} }