From 9cefafe4e843cd178cb105f3590a3da78dfde488 Mon Sep 17 00:00:00 2001 From: James Zhang Date: Fri, 13 Sep 2024 10:21:00 -0700 Subject: [PATCH] U2F key_lookup: do not fail upon SW_WRONG_LENGTH (0x6700) --- src/fido/param.h | 1 + src/u2f.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/fido/param.h b/src/fido/param.h index fb66abfd..1c22cc28 100644 --- a/src/fido/param.h +++ b/src/fido/param.h @@ -74,6 +74,7 @@ /* ISO7816-4 status words. */ #define SW1_MORE_DATA 0x61 +#define SW_WRONG_LENGTH 0x6700 #define SW_CONDITIONS_NOT_SATISFIED 0x6985 #define SW_WRONG_DATA 0x6a80 #define SW_NO_ERROR 0x9000 diff --git a/src/u2f.c b/src/u2f.c index b1f7bce3..2620a2eb 100644 --- a/src/u2f.c +++ b/src/u2f.c @@ -260,6 +260,7 @@ key_lookup(fido_dev_t *dev, const char *rp_id, const fido_blob_t *key_id, *found = 1; /* key exists */ break; case SW_WRONG_DATA: + case SW_WRONG_LENGTH: *found = 0; /* key does not exist */ break; default: