diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:20:30 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:20:30 +0000 |
commit | 31acb164b1ffc24a287b1fe97eea5e4beeaf5f5a (patch) | |
tree | 3aab995beff7993d741c493392c0e1f14376d79b /tools | |
parent | Adding upstream version 1.14.0. (diff) | |
download | libfido2-upstream.tar.xz libfido2-upstream.zip |
Adding upstream version 1.15.0.upstream/1.15.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/credman.c | 7 | ||||
-rw-r--r-- | tools/token.c | 9 |
2 files changed, 14 insertions, 2 deletions
diff --git a/tools/credman.c b/tools/credman.c index a0a3149..9f6072f 100644 --- a/tools/credman.c +++ b/tools/credman.c @@ -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"); @@ -128,7 +129,7 @@ print_rk(const fido_credman_rk_t *rk, size_t idx) &id) < 0 || base64_encode(fido_cred_user_id_ptr(cred), fido_cred_user_id_len(cred), &user_id) < 0) { warnx("output error"); - return -1; + goto out; } type = cose_string(fido_cred_type(cred)); @@ -137,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 diff --git a/tools/token.c b/tools/token.c index 366d5a1..12fcb2d 100644 --- a/tools/token.c +++ b/tools/token.c @@ -170,6 +170,12 @@ print_maxcredcntlst(uint64_t maxcredcntlst) } static void +print_maxcredblob(uint64_t maxcredblob) +{ + printf("maxcredblob: %d\n", (int)maxcredblob); +} + +static void print_maxcredidlen(uint64_t maxcredidlen) { printf("maxcredlen: %d\n", (int)maxcredidlen); @@ -388,6 +394,9 @@ token_info(int argc, char **argv, char *path) /* print maximum length of a credential ID */ print_maxcredidlen(fido_cbor_info_maxcredidlen(ci)); + /* print maximum length of credBlob */ + print_maxcredblob(fido_cbor_info_maxcredbloblen(ci)); + /* print maximum length of serialized largeBlob array */ print_maxlargeblob(fido_cbor_info_maxlargeblob(ci)); |