Skip to content

Commit b34e924

Browse files
ikerexxejustin-stephenson
authored andcommitted
passkey: propagate error code for power cycle
When performing a passkey authentication and the PIN is entered 3 times incorrectly the FIDO2 device requires a power cycle (disconnect and reconnect the device to the USB port). libfido2 recognizes this with a special error code and the passkey child should return it so that the SSSD responder is aware of it. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
1 parent c53e297 commit b34e924

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/passkey_child/passkey_child.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ int main(int argc, const char *argv[])
104104
done:
105105
talloc_free(main_ctx);
106106

107-
if (ret != EOK) {
107+
if (ret == FIDO_ERR_PIN_AUTH_BLOCKED) {
108+
return PIN_AUTH_BLOCKED_EXIT_CODE;
109+
} else if (ret != EOK) {
108110
return EXIT_FAILURE;
109111
} else {
110112
return EXIT_SUCCESS;

src/util/util.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ extern int socket_activated;
122122
enum sssd_exit_status {
123123
CHILD_TIMEOUT_EXIT_CODE = 7,
124124
CA_DB_NOT_FOUND_EXIT_CODE = 50,
125+
PIN_AUTH_BLOCKED_EXIT_CODE = 52, /* to match FIDO_ERR_PIN_AUTH_BLOCKED in fido2 error codes */
125126
SSS_WATCHDOG_EXIT_CODE = 70 /* to match EX_SOFTWARE in sysexits.h */
126127
};
127128

0 commit comments

Comments
 (0)