parse remainingAttempts from wrong pin error

This commit is contained in:
Andrea Franz 2021-10-07 10:33:56 +02:00
parent 8d449ac5df
commit f6fa69e9dc
No known key found for this signature in database
GPG Key ID: 4F0D2F2D9DE7F29D
2 changed files with 2 additions and 2 deletions

View File

@ -65,7 +65,7 @@ method keycardVerifyPin*(self: StatusGoBackend, pin: string) =
let response = keycard_go.verifyPin($inputJSON) let response = keycard_go.verifyPin($inputJSON)
let parsedResponse = parseJson(response) let parsedResponse = parseJson(response)
if not parsedResponse{"ok"}.getBool(): if not parsedResponse{"ok"}.getBool():
raise KeycardVerifyPINException(error: parsedResponse{"error"}.getStr()) raise KeycardVerifyPINException(error: parsedResponse{"error"}.getStr(), remainingAttempts: parsedResponse{"remainingAttempts"}.getInt())
method keycardExportKey*(self: StatusGoBackend, derive: bool, makeCurrent: bool, onlyPublic: bool, path: string): KeycardExportedKey = method keycardExportKey*(self: StatusGoBackend, derive: bool, makeCurrent: bool, onlyPublic: bool, path: string): KeycardExportedKey =
let inputJSON = %* { let inputJSON = %* {

View File

@ -18,7 +18,7 @@ type KeycardUnpairException* = ref object of KeycardException
type KeycardGenerateKeyException* = ref object of KeycardException type KeycardGenerateKeyException* = ref object of KeycardException
type KeycardVerifyPINException* = ref object of KeycardException type KeycardVerifyPINException* = ref object of KeycardException
pinRetry*: int64 remainingAttempts*: int64
type KeycardExportKeyException* = ref object of KeycardException type KeycardExportKeyException* = ref object of KeycardException