Added a check to determine HHD version
This commit is contained in:
parent
9aad2a5101
commit
65d983a5e7
|
@ -444,7 +444,7 @@ Log.info { "Terminating waiting for TAN input" } // TODO: remove again
|
||||||
return when (tanMethod.type) {
|
return when (tanMethod.type) {
|
||||||
TanMethodType.ChipTanFlickercode ->
|
TanMethodType.ChipTanFlickercode ->
|
||||||
FlickerCodeTanChallenge(
|
FlickerCodeTanChallenge(
|
||||||
FlickerCodeDecoder().decodeChallenge(challenge, tanMethod.hhdVersion ?: HHDVersion.HHD_1_4), // HHD 1.4 is currently the most used version
|
FlickerCodeDecoder().decodeChallenge(challenge, tanMethod.hhdVersion ?: getFallbackHhdVersion(challenge)),
|
||||||
forAction, messageToShowToUser, challenge, tanMethod, tanResponse.tanMediaIdentifier, bank, account, tanResponse.tanExpirationTime)
|
forAction, messageToShowToUser, challenge, tanMethod, tanResponse.tanMediaIdentifier, bank, account, tanResponse.tanExpirationTime)
|
||||||
|
|
||||||
TanMethodType.ChipTanQrCode, TanMethodType.ChipTanPhotoTanMatrixCode,
|
TanMethodType.ChipTanQrCode, TanMethodType.ChipTanPhotoTanMatrixCode,
|
||||||
|
@ -455,6 +455,14 @@ Log.info { "Terminating waiting for TAN input" } // TODO: remove again
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected open fun getFallbackHhdVersion(challenge: String): HHDVersion {
|
||||||
|
if (challenge.length <= 35) { // is this true in all circumstances?
|
||||||
|
return HHDVersion.HHD_1_3
|
||||||
|
}
|
||||||
|
|
||||||
|
return HHDVersion.HHD_1_4 // HHD 1.4 is currently the most used version
|
||||||
|
}
|
||||||
|
|
||||||
protected open suspend fun mayRetrieveAutomaticallyIfUserEnteredDecoupledTan(context: JobContext, tanChallenge: TanChallenge, tanResponse: TanResponse) {
|
protected open suspend fun mayRetrieveAutomaticallyIfUserEnteredDecoupledTan(context: JobContext, tanChallenge: TanChallenge, tanResponse: TanResponse) {
|
||||||
context.bank.selectedTanMethod.decoupledParameters?.let { decoupledTanMethodParameters ->
|
context.bank.selectedTanMethod.decoupledParameters?.let { decoupledTanMethodParameters ->
|
||||||
if (decoupledTanMethodParameters.periodicStateRequestsAllowed) {
|
if (decoupledTanMethodParameters.periodicStateRequestsAllowed) {
|
||||||
|
|
Loading…
Reference in New Issue