Skip to content

Commit

Permalink
Merge pull request #360 from Nitrokey/list-credentials-total
Browse files Browse the repository at this point in the history
fido2 list-credentials: Skip enumerating RPs when empty
  • Loading branch information
szszszsz authored May 10, 2023
2 parents 32a9850 + 4679869 commit 9141c09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pynitrokey/cli/fido2.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,6 @@ def list_credentials(serial, pin):
CredentialManagement.RESULT.MAX_REMAINING_COUNT
)

reliable_party_list = cred_manager.enumerate_rps()

if cred_count == 0:
local_print("There are no registered credentials")
local_print(
Expand All @@ -230,6 +228,8 @@ def list_credentials(serial, pin):
# Get amount of registered creds from first key in list (Same trick is used in the CredentialManager)
local_print(f"There are {cred_count} registered credentials")

reliable_party_list = cred_manager.enumerate_rps()

for reliable_party_result in reliable_party_list:
reliable_party = reliable_party_result.get(CredentialManagement.RESULT.RP)
reliable_party_hash = reliable_party_result.get(
Expand Down

0 comments on commit 9141c09

Please sign in to comment.