Skip to content

Commit

Permalink
tools: tweak previous
Browse files Browse the repository at this point in the history
  • Loading branch information
LDVG committed Mar 22, 2024
1 parent a1e9f87 commit 48087f5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tools/credman.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ print_rk(const fido_credman_rk_t *rk, size_t idx)
char *user_id = NULL;
const char *type;
const char *prot;
int r = -1;

if ((cred = fido_credman_rk(rk, idx)) == NULL) {
warnx("fido_credman_rk");
Expand All @@ -127,10 +128,8 @@ print_rk(const fido_credman_rk_t *rk, size_t idx)
if (base64_encode(fido_cred_id_ptr(cred), fido_cred_id_len(cred),
&id) < 0 || base64_encode(fido_cred_user_id_ptr(cred),
fido_cred_user_id_len(cred), &user_id) < 0) {
free(user_id);
free(id);
warnx("output error");
return -1;
goto out;
}

type = cose_string(fido_cred_type(cred));
Expand All @@ -139,10 +138,12 @@ print_rk(const fido_credman_rk_t *rk, size_t idx)
printf("%02u: %s %s %s %s %s\n", (unsigned)idx, id,
fido_cred_display_name(cred), user_id, type, prot);

r = 0;
out:
free(user_id);
free(id);

return 0;
return r;
}

int
Expand Down

0 comments on commit 48087f5

Please sign in to comment.