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 /src/winhello.c | |
parent | Adding upstream version 1.14.0. (diff) | |
download | libfido2-31acb164b1ffc24a287b1fe97eea5e4beeaf5f5a.tar.xz libfido2-31acb164b1ffc24a287b1fe97eea5e4beeaf5f5a.zip |
Adding upstream version 1.15.0.upstream/1.15.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/winhello.c')
-rw-r--r-- | src/winhello.c | 50 |
1 files changed, 2 insertions, 48 deletions
diff --git a/src/winhello.c b/src/winhello.c index ff969a4..2b2a5d1 100644 --- a/src/winhello.c +++ b/src/winhello.c @@ -740,50 +740,6 @@ translate_fido_cred(struct winhello_cred *ctx, const fido_cred_t *cred, } static int -decode_attobj(const cbor_item_t *key, const cbor_item_t *val, void *arg) -{ - fido_cred_t *cred = arg; - char *name = NULL; - int ok = -1; - - if (cbor_string_copy(key, &name) < 0) { - fido_log_debug("%s: cbor type", __func__); - ok = 0; /* ignore */ - goto fail; - } - - if (!strcmp(name, "fmt")) { - if (cbor_decode_fmt(val, &cred->fmt) < 0) { - fido_log_debug("%s: cbor_decode_fmt", __func__); - goto fail; - } - } else if (!strcmp(name, "attStmt")) { - if (cbor_decode_attstmt(val, &cred->attstmt) < 0) { - fido_log_debug("%s: cbor_decode_attstmt", __func__); - goto fail; - } - } else if (!strcmp(name, "authData")) { - if (fido_blob_decode(val, &cred->authdata_raw) < 0) { - fido_log_debug("%s: fido_blob_decode", __func__); - goto fail; - } - if (cbor_decode_cred_authdata(val, cred->type, - &cred->authdata_cbor, &cred->authdata, &cred->attcred, - &cred->authdata_ext) < 0) { - fido_log_debug("%s: cbor_decode_cred_authdata", - __func__); - goto fail; - } - } - - ok = 0; -fail: - free(name); - - return (ok); -} - -static int translate_winhello_cred(fido_cred_t *cred, const WEBAUTHN_CREDENTIAL_ATTESTATION *att) { @@ -800,10 +756,8 @@ translate_winhello_cred(fido_cred_t *cred, fido_log_debug("%s: cbor_load", __func__); goto fail; } - if (cbor_isa_map(item) == false || - cbor_map_is_definite(item) == false || - cbor_map_iter(item, cred, decode_attobj) < 0) { - fido_log_debug("%s: cbor type", __func__); + if (cbor_decode_attobj(item, cred) != 0) { + fido_log_debug("%s: cbor_decode_attobj", __func__); goto fail; } |