[Bug] Wrong if-then-else logic when issuing "secure enable" #199

Closed
opened 2025-11-07 21:09:10 +08:00 by m-meltner · 0 comments
m-meltner commented 2025-11-07 21:09:10 +08:00 (Migrated from github.com)

Hello,

I have a fresh install of pico-fido2 (master branch), set a fido pin 123456 and I try to issue "python3 pico-fido-tool.py -p 123456 secure enable". this command results in CTAP2_ERR_INVALID_SUBCOMMAND. I think the logic in cbor_config.c is wrong. If no emulation is configured then the "else" in line 245 relates to the "if" in 216. But I assume it is intended to relate to the "if" in line 153. As the command CTAP_CONFIG_AUT_ENABLE works the "if" in line 216 is false so the code jumps to line "else" in 245. The logic works as intended, though, if ENABLE_EMULATION is defined.

I hope I made no mistake in looking through the code and reporting this bug.

  • Michael
Hello, I have a fresh install of pico-fido2 (master branch), set a fido pin 123456 and I try to issue "python3 pico-fido-tool.py -p 123456 secure enable". this command results in CTAP2_ERR_INVALID_SUBCOMMAND. I think the logic in cbor_config.c is wrong. If no emulation is configured then the "else" in line 245 relates to the "if" in 216. But I assume it is intended to relate to the "if" in line 153. As the command CTAP_CONFIG_AUT_ENABLE works the "if" in line 216 is false so the code jumps to line "else" in 245. The logic works as intended, though, if ENABLE_EMULATION is defined. I hope I made no mistake in looking through the code and reporting this bug. - Michael
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dearsky/pico-fido#199