summaryrefslogtreecommitdiff
path: root/sk-usbhid.c
diff options
context:
space:
mode:
Diffstat (limited to 'sk-usbhid.c')
-rw-r--r--sk-usbhid.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sk-usbhid.c b/sk-usbhid.c
index 0305683fe..0b11e40aa 100644
--- a/sk-usbhid.c
+++ b/sk-usbhid.c
@@ -41,6 +41,17 @@
41#include <fido.h> 41#include <fido.h>
42#include <fido/credman.h> 42#include <fido/credman.h>
43 43
44/* backwards compat for libfido2 */
45#ifndef HAVE_FIDO_DEV_SUPPORTS_CRED_PROT
46#define fido_dev_supports_cred_prot(x) (0)
47#endif
48#ifndef HAVE_FIDO_DEV_GET_TOUCH_BEGIN
49#define fido_dev_get_touch_begin(x) (FIDO_ERR_UNSUPPORTED_OPTION)
50#endif
51#ifndef HAVE_FIDO_DEV_GET_TOUCH_STATUS
52#define fido_dev_get_touch_status(x, y, z) (FIDO_ERR_UNSUPPORTED_OPTION)
53#endif
54
44#ifndef SK_STANDALONE 55#ifndef SK_STANDALONE
45# include "log.h" 56# include "log.h"
46# include "xmalloc.h" 57# include "xmalloc.h"
@@ -377,6 +388,11 @@ sk_select_by_touch(const fido_dev_info_t *devlist, size_t ndevs)
377 size_t skvcnt, idx; 388 size_t skvcnt, idx;
378 int touch, ms_remain; 389 int touch, ms_remain;
379 390
391#ifndef HAVE_FIDO_DEV_GET_TOUCH_STATUS
392 skdebug(__func__, "libfido2 version does not support a feature needed for multiple tokens. Please upgrade to >=1.5.0");
393 return NULL;
394#endif
395
380 if ((skv = sk_openv(devlist, ndevs, &skvcnt)) == NULL) { 396 if ((skv = sk_openv(devlist, ndevs, &skvcnt)) == NULL) {
381 skdebug(__func__, "sk_openv failed"); 397 skdebug(__func__, "sk_openv failed");
382 return NULL; 398 return NULL;
@@ -705,6 +721,11 @@ sk_enroll(uint32_t alg, const uint8_t *challenge, size_t challenge_len,
705 goto out; 721 goto out;
706 } 722 }
707 if ((flags & (SSH_SK_RESIDENT_KEY|SSH_SK_USER_VERIFICATION_REQD)) != 0) { 723 if ((flags & (SSH_SK_RESIDENT_KEY|SSH_SK_USER_VERIFICATION_REQD)) != 0) {
724#ifndef HAVE_FIDO_DEV_SUPPORTS_CRED_PROT
725 skdebug(__func__, "libfido2 version does not support a feature required for this operation. Please upgrade to >=1.5.0");
726 ret = SSH_SK_ERR_UNSUPPORTED;
727 goto out;
728#endif
708 if (!fido_dev_supports_cred_prot(sk->dev)) { 729 if (!fido_dev_supports_cred_prot(sk->dev)) {
709 skdebug(__func__, "%s does not support credprot, " 730 skdebug(__func__, "%s does not support credprot, "
710 "refusing to create unprotected " 731 "refusing to create unprotected "