From 78f7a7a979fdce481dd6ca31c772413a8fc3428b Mon Sep 17 00:00:00 2001 From: shimun Date: Sun, 30 Aug 2020 17:02:35 +0200 Subject: [PATCH] allow pin removal either change to PIN to an empty one or "4321" --- fido2/ctap.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fido2/ctap.c b/fido2/ctap.c index 240b00a..8f81635 100644 --- a/fido2/ctap.c +++ b/fido2/ctap.c @@ -2350,6 +2350,9 @@ uint8_t ctap_request(uint8_t * pkt_raw, int length, CTAP_RESPONSE * resp) dump_hex1(TAG_DUMP,buf, resp->length); break; + case CTAP_VENDOR_LOAD: + //TODO: load secret + break; default: status = CTAP1_ERR_INVALID_COMMAND; printf2(TAG_ERR,"error, invalid cmd: 0x%02x\n", cmd); @@ -2475,6 +2478,11 @@ uint8_t ctap_is_pin_set() */ void ctap_update_pin(uint8_t * pin, int len) { + if(len == 0 || strncmp(pin, "4321", len) == 0) { + STATE.is_pin_set = 0; + authenticator_write_state(&STATE); + return; + } if (len >= NEW_PIN_ENC_MIN_SIZE || len < 4) { printf2(TAG_ERR, "Update pin fail length\n");