Skip to content

Commit

Permalink
fix: comment FIDO2 code #304
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Jamet committed Oct 14, 2022
1 parent 1707d3c commit 1514dbb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
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 {
return value
}

companion object {
val DEFAULT = FIDO2_SECRET
val DEFAULT = CHALLENGE_RESPONSE_YUBIKEY

fun getStringValues(): List<String> {
return values().map { it.value }
}

fun fromPosition(position: Int): HardwareKey {
return when (position) {
0 -> FIDO2_SECRET
1 -> CHALLENGE_RESPONSE_YUBIKEY
// 0 -> FIDO2_SECRET
0 -> CHALLENGE_RESPONSE_YUBIKEY
else -> DEFAULT
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -101,13 +102,15 @@ class HardwareKeyResponseHelper {
showDialog: Boolean = true
): Boolean {
return when (hardwareKey) {
/*
HardwareKey.FIDO2_SECRET -> {
// TODO FIDO2 under development
if (showDialog)
UnderDevelopmentFeatureDialogFragment()
.show(activity.supportFragmentManager, "underDevFeatureDialog")
false
}
*/
HardwareKey.CHALLENGE_RESPONSE_YUBIKEY -> {
// Check available intent
val yubikeyDriverAvailable =
Expand Down

0 comments on commit 1514dbb

Please sign in to comment.