Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.x8bit.bitwarden.data.platform.manager.sdk.statebridge
import com.bitwarden.core.MasterPasswordUnlockData
import com.bitwarden.core.StateBridgeForeignImpl
import com.bitwarden.core.V2UpgradeToken
import com.bitwarden.core.WebAuthnPrfUnlockData
import com.bitwarden.core.WrappedAccountCryptographicState
import com.bitwarden.crypto.EncString
import com.bitwarden.crypto.Kdf
Expand Down Expand Up @@ -156,17 +155,4 @@ internal class SdkStateBridge(
kdf = null,
)
}

override suspend fun getWebauthnPrfUnlockData(): WebAuthnPrfUnlockData? {
// We do not support unlock with WebAuthn, so we can just return null
return null
}

override suspend fun setWebauthnPrfUnlockData(value: WebAuthnPrfUnlockData) {
// We do not support unlock with WebAuthn, so this is a no-op
}

override suspend fun clearWebauthnPrfUnlockData() {
// We do not support unlock with WebAuthn, so this is a no-op
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.x8bit.bitwarden.data.platform.manager.sdk.statebridge

import com.bitwarden.core.MasterPasswordUnlockData
import com.bitwarden.core.V2UpgradeToken
import com.bitwarden.core.WebAuthnPrfUnlockData
import com.bitwarden.crypto.Kdf
import com.bitwarden.network.model.KdfJson
import com.bitwarden.network.model.KdfTypeJson
Expand Down Expand Up @@ -427,33 +426,6 @@ class SdkStateBridgeTest {

assertNull(authDiskSource.userState)
}

@Test
fun `getWebauthnPrfUnlockData should return null since unlock is unsupported`() = runTest {
authDiskSource.userState = USER_STATE

assertNull(stateBridge.getWebauthnPrfUnlockData())
}

@Test
fun `setWebauthnPrfUnlockData should do nothing since unlock is unsupported`() = runTest {
authDiskSource.userState = USER_STATE

stateBridge.setWebauthnPrfUnlockData(value = WEBAUTHN_PRF_UNLOCK_DATA)

assertNull(stateBridge.getWebauthnPrfUnlockData())
assertEquals(USER_STATE, authDiskSource.userState)
}

@Test
fun `clearWebauthnPrfUnlockData should do nothing since unlock is unsupported`() = runTest {
authDiskSource.userState = USER_STATE

stateBridge.clearWebauthnPrfUnlockData()

assertNull(stateBridge.getWebauthnPrfUnlockData())
assertEquals(USER_STATE, authDiskSource.userState)
}
}

private const val USER_ID: String = "userId"
Expand Down Expand Up @@ -486,10 +458,6 @@ private val MASTER_PASSWORD_UNLOCK_DATA_JSON: MasterPasswordUnlockDataJson =
salt = "salt",
)

private val WEBAUTHN_PRF_UNLOCK_DATA: WebAuthnPrfUnlockData = WebAuthnPrfUnlockData(
options = emptyList(),
)

private val ACCOUNT: AccountJson = AccountJson(
profile = AccountJson.Profile(
userId = USER_ID,
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ androidxRoom = "2.8.4"
androidxSecurityCrypto = "1.1.0"
androidxSplash = "1.2.0"
androidxWork = "2.11.2"
bitwardenSdk = "3.0.0-8157-eb825d59"
bitwardenSdk = "3.0.0-8144-cf7ad654"
crashlytics = "3.0.7"
detekt = "1.23.8"
firebaseBom = "34.15.0"
Expand Down
Loading