fix: comment FIDO2 code #304

This commit is contained in:
J-Jamet
2022-10-14 13:59:20 +02:00
parent 1707d3c3ba
commit 1514dbb1de
2 changed files with 8 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
package com.kunzisoft.keepass.hardware
enum class HardwareKey(val value: String) {
FIDO2_SECRET("FIDO2 secret"),
// FIDO2_SECRET("FIDO2 secret"),
CHALLENGE_RESPONSE_YUBIKEY("Yubikey challenge-response");
override fun toString(): String {
@@ -9,7 +9,7 @@ enum class HardwareKey(val value: String) {
}
companion object {
val DEFAULT = FIDO2_SECRET
val DEFAULT = CHALLENGE_RESPONSE_YUBIKEY
fun getStringValues(): List<String> {
return values().map { it.value }
@@ -17,8 +17,8 @@ enum class HardwareKey(val value: String) {
fun fromPosition(position: Int): HardwareKey {
return when (position) {
0 -> FIDO2_SECRET
1 -> CHALLENGE_RESPONSE_YUBIKEY
// 0 -> FIDO2_SECRET
0 -> CHALLENGE_RESPONSE_YUBIKEY
else -> DEFAULT
}
}

View File

@@ -13,7 +13,6 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.lifecycle.lifecycleScope
import com.kunzisoft.keepass.R
import com.kunzisoft.keepass.activities.dialogs.UnderDevelopmentFeatureDialogFragment
import com.kunzisoft.keepass.utils.UriUtil
import kotlinx.coroutines.launch
@@ -64,10 +63,12 @@ class HardwareKeyResponseHelper {
fun launchChallengeForResponse(hardwareKey: HardwareKey, seed: ByteArray?) {
when (hardwareKey) {
/*
HardwareKey.FIDO2_SECRET -> {
// TODO FIDO2 under development
throw Exception("FIDO2 not implemented")
}
*/
HardwareKey.CHALLENGE_RESPONSE_YUBIKEY -> {
// Transform the seed before sending
var challenge: ByteArray? = null
@@ -101,6 +102,7 @@ class HardwareKeyResponseHelper {
showDialog: Boolean = true
): Boolean {
return when (hardwareKey) {
/*
HardwareKey.FIDO2_SECRET -> {
// TODO FIDO2 under development
if (showDialog)
@@ -108,6 +110,7 @@ class HardwareKeyResponseHelper {
.show(activity.supportFragmentManager, "underDevFeatureDialog")
false
}
*/
HardwareKey.CHALLENGE_RESPONSE_YUBIKEY -> {
// Check available intent
val yubikeyDriverAvailable =