Skip to content

Commit

Permalink
Fix type error that could not happen in practice
Browse files Browse the repository at this point in the history
  • Loading branch information
sosthene-nitrokey committed Apr 17, 2024
1 parent 740442b commit b73dd4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion pynitrokey/cli/fido2.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,6 @@ def version(serial: Optional[str], udp: bool) -> None:
res = nkfido2.find(serial, udp=udp).solo_version()
major, minor, patch = res[:3]
locked = ""
# @todo:
if len(res) > 3:
if res[3]:
locked = "locked"
Expand Down
4 changes: 2 additions & 2 deletions pynitrokey/fido2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,12 @@ def bootloader_version(self) -> Tuple[int, int, int]:
return (data[0], data[1], data[2])
return (0, 0, data[0])

def solo_version(self) -> Union[bytes, Tuple[int, int, int]]:
def solo_version(self) -> bytes:
try:
return self.send_data_hid(0x61, b"")
except CtapError:
data = self.exchange(SoloExtension.version)
return (data[0], data[1], data[2])
return data[:3]

def write_flash(self, addr: int, data: bytes) -> None:
self.exchange(SoloBootloader.write, addr, data)
Expand Down

0 comments on commit b73dd4c

Please sign in to comment.