Skip to content

Commit c85f053

Browse files
committed
Check support for config subcommands
1 parent 3594d0d commit c85f053

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fido2/ctap2/config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,14 @@ def __init__(
7777
if pin_uv_protocol and pin_uv_token
7878
else None
7979
)
80+
self._subcommands = self.ctap.info.authenticator_config_commands
8081
# TODO: Implement feature detection for pin_complexity_policy,
8182
# which is currently ambiguous in the spec.
8283

8384
def _call(self, sub_cmd, params=None):
85+
if self._subcommands is not None and sub_cmd not in self._subcommands:
86+
raise ValueError(f"Config command {sub_cmd} not supported by Authenticator")
87+
8488
if self.pin_uv:
8589
msg = b"\xff" * 32 + b"\x0d" + struct.pack("<B", sub_cmd)
8690
if params is not None:

0 commit comments

Comments
 (0)