mirror of
https://codeberg.org/timelimit/timelimit-android.git
synced 2025-10-04 10:19:18 +02:00
Fix parsing u2f counter bytes >= 0x80
This commit is contained in:
parent
2e68798e2c
commit
de0b6d1c8f
1 changed files with 5 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* TimeLimit Copyright <C> 2019 - 2022 Jonas Lochmann
|
* TimeLimit Copyright <C> 2019 - 2025 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -64,10 +64,10 @@ object U2FResponse {
|
||||||
|
|
||||||
val flags = rawResponse.payload[0]
|
val flags = rawResponse.payload[0]
|
||||||
|
|
||||||
val counter = rawResponse.payload[4].toUInt() or
|
val counter = rawResponse.payload[4].toUByte().toUInt() or
|
||||||
rawResponse.payload[3].toUInt().shl(8) or
|
rawResponse.payload[3].toUByte().toUInt().shl(8) or
|
||||||
rawResponse.payload[2].toUInt().shl(16) or
|
rawResponse.payload[2].toUByte().toUInt().shl(16) or
|
||||||
rawResponse.payload[1].toUInt().shl(24)
|
rawResponse.payload[1].toUByte().toUInt().shl(24)
|
||||||
|
|
||||||
val signature = rawResponse.payload.sliceArray(5 until rawResponse.payload.size)
|
val signature = rawResponse.payload.sliceArray(5 until rawResponse.payload.size)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue