Skip to content

Commit

Permalink
Fix packing sub_cmd.
Browse files Browse the repository at this point in the history
sub_cmd is an unsigned char, since VENDOR_PROTOTYPE is 0xff. If not, it cannot be encoded.

Signed-off-by: Pol Henarejos <[email protected]>
  • Loading branch information
polhenarejos committed Nov 2, 2023
1 parent 032dd8b commit 4abb4a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fido2/ctap2/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def _call(self, sub_cmd, params=None):
msg = (
b"\xff" * 32
+ b"\x0d"
+ struct.pack("<b", sub_cmd)
+ struct.pack("<B", sub_cmd)
+ (cbor.encode(params) if params else b"")
)
pin_uv_protocol = self.pin_uv.protocol.VERSION
Expand Down

0 comments on commit 4abb4a5

Please sign in to comment.