From a015eda72cbce56de8dfe47a0c5f78cfd723c0cd Mon Sep 17 00:00:00 2001 From: Valere Date: Tue, 3 Oct 2023 11:29:50 +0200 Subject: [PATCH] code review --- .../matrix/android/sdk/api/rendezvous/Rendezvous.kt | 4 ++-- .../android/sdk/internal/crypto/SecretShareManager.kt | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/rendezvous/Rendezvous.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/rendezvous/Rendezvous.kt index c2cc95855c..d5596ce56f 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/rendezvous/Rendezvous.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/rendezvous/Rendezvous.kt @@ -218,8 +218,8 @@ class Rendezvous( Timber.tag(TAG).i("No master key given by verifying device") } - // request secrets from the verifying device - Timber.tag(TAG).i("Requesting secrets from $verifyingDeviceId") + // request secrets from other sessions. + Timber.tag(TAG).i("Requesting secrets from other sessions") session.sharedSecretStorageService().requestMissingSecrets() } else { diff --git a/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/SecretShareManager.kt b/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/SecretShareManager.kt index c7b299cce2..ba46776663 100644 --- a/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/SecretShareManager.kt +++ b/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/SecretShareManager.kt @@ -28,13 +28,9 @@ internal class SecretShareManager @Inject constructor( private val outgoingRequestsProcessor: OutgoingRequestsProcessor) { suspend fun requestSecretTo(deviceId: String, secretName: String) { - Timber.v("SecretShareManager requesting $deviceId, $secretName") - if (this.olmMachine.get().requestMissingSecretsFromOtherSessions()) { - // immediately send the requests - outgoingRequestsProcessor.processOutgoingRequests(this.olmMachine.get()) { - it is Request.ToDevice && it.eventType == EventType.REQUEST_SECRET - } - } + Timber.w("SecretShareManager requesting custom secrets not supported $deviceId, $secretName") + // rust stack only support requesting secrets defined in the spec (not custom secret yet) + requestMissingSecrets() } suspend fun requestMissingSecrets() {