allow pin removal
This commit is contained in:
parent
d0124c615a
commit
65dc8de490
@ -2443,6 +2443,15 @@ uint8_t ctap_is_pin_set()
|
||||
*/
|
||||
void ctap_update_pin(uint8_t * pin, int len)
|
||||
{
|
||||
|
||||
// Remove PIN if the new PIN is either "" or 4321
|
||||
if (len == 0 || strncmp(pin, "4321", len) == 0) {
|
||||
STATE.is_pin_set = 0;
|
||||
memset(STATE.PIN_CODE_HASH, 0, sizeof(STATE.PIN_CODE_HASH));
|
||||
authenticator_write_state(&STATE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (len >= NEW_PIN_ENC_MIN_SIZE || len < 4)
|
||||
{
|
||||
printf2(TAG_ERR, "Update pin fail length\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user