summaryrefslogtreecommitdiffstats
path: root/src/credman.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:20:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:20:30 +0000
commit31acb164b1ffc24a287b1fe97eea5e4beeaf5f5a (patch)
tree3aab995beff7993d741c493392c0e1f14376d79b /src/credman.c
parentAdding upstream version 1.14.0. (diff)
downloadlibfido2-upstream/1.15.0.tar.xz
libfido2-upstream/1.15.0.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/credman.c')
-rw-r--r--src/credman.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/credman.c b/src/credman.c
index c364242..898de14 100644
--- a/src/credman.c
+++ b/src/credman.c
@@ -111,6 +111,15 @@ fail:
return (ok);
}
+static uint8_t
+credman_get_cmd(const fido_dev_t *dev)
+{
+ if (dev->flags & FIDO_DEV_CREDMAN)
+ return (CTAP_CBOR_CRED_MGMT);
+
+ return (CTAP_CBOR_CRED_MGMT_PRE);
+}
+
static int
credman_tx(fido_dev_t *dev, uint8_t subcmd, const void *param, const char *pin,
const char *rp_id, fido_opt_t uv, int *ms)
@@ -120,7 +129,7 @@ credman_tx(fido_dev_t *dev, uint8_t subcmd, const void *param, const char *pin,
fido_blob_t hmac;
es256_pk_t *pk = NULL;
cbor_item_t *argv[4];
- const uint8_t cmd = CTAP_CBOR_CRED_MGMT_PRE;
+ const uint8_t cmd = credman_get_cmd(dev);
int r = FIDO_ERR_INTERNAL;
memset(&f, 0, sizeof(f));