Skip to content

Commit

Permalink
Add config nullable params
Browse files Browse the repository at this point in the history
  • Loading branch information
dainnilsson committed Oct 9, 2024
1 parent a4bdbae commit c45a1ae
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions fido2/ctap2/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from .base import Ctap2, Info
from .pin import PinProtocol, _PinUv

from typing import Optional, List
from typing import Optional, List, Dict, Any
from enum import IntEnum, unique
import struct

Expand Down Expand Up @@ -117,11 +117,9 @@ def set_min_pin_length(
:param force_change_pin: True if the Authenticator should enforce changing the
PIN before the next use.
"""
self._call(
Config.CMD.SET_MIN_PIN_LENGTH,
{
Config.PARAM.NEW_MIN_PIN_LENGTH: min_pin_length,
Config.PARAM.MIN_PIN_LENGTH_RPIDS: rp_ids,
Config.PARAM.FORCE_CHANGE_PIN: force_change_pin,
},
)
params: Dict[int, Any] = {Config.PARAM.FORCE_CHANGE_PIN: force_change_pin}
if min_pin_length is not None:
params[Config.PARAM.NEW_MIN_PIN_LENGTH] = min_pin_length
if rp_ids is not None:
params[Config.PARAM.MIN_PIN_LENGTH_RPIDS] = rp_ids
self._call(Config.CMD.SET_MIN_PIN_LENGTH, params)

0 comments on commit c45a1ae

Please sign in to comment.