allow pin removal

either change to PIN to an empty one or "4321"
This commit is contained in:
shimun 2020-08-30 17:02:35 +02:00
parent 72063049a7
commit 78f7a7a979
Signed by: shimun
GPG Key ID: E81D8382DC2F971B

View File

@ -2350,6 +2350,9 @@ uint8_t ctap_request(uint8_t * pkt_raw, int length, CTAP_RESPONSE * resp)
dump_hex1(TAG_DUMP,buf, resp->length); dump_hex1(TAG_DUMP,buf, resp->length);
break; break;
case CTAP_VENDOR_LOAD:
//TODO: load secret
break;
default: default:
status = CTAP1_ERR_INVALID_COMMAND; status = CTAP1_ERR_INVALID_COMMAND;
printf2(TAG_ERR,"error, invalid cmd: 0x%02x\n", cmd); 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) 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) if (len >= NEW_PIN_ENC_MIN_SIZE || len < 4)
{ {
printf2(TAG_ERR, "Update pin fail length\n"); printf2(TAG_ERR, "Update pin fail length\n");