From 3d1c68fa40d7b883ca3feaf7efe0f2b6e7288f0a Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Thu, 30 Mar 2023 00:52:08 +0200 Subject: [PATCH] Added support for APPEND_CR. Signed-off-by: Pol Henarejos --- pico-hsm-sdk | 2 +- src/fido/otp.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pico-hsm-sdk b/pico-hsm-sdk index ef0fb29..630da66 160000 --- a/pico-hsm-sdk +++ b/pico-hsm-sdk @@ -1 +1 @@ -Subproject commit ef0fb29f2919477231d125c245ec6d4be7e49fac +Subproject commit 630da663c4bef29d938f238d77016a9c84ddae6d diff --git a/src/fido/otp.c b/src/fido/otp.c index d23c603..9e32c64 100644 --- a/src/fido/otp.c +++ b/src/fido/otp.c @@ -176,12 +176,18 @@ int otp_button_pressed(uint8_t slot) { flash_write_data_to_file(ef, new_otp_config, sizeof(new_otp_config)); low_flash_available(); } + if (otp_config->tkt_flags & APPEND_CR) { + append_keyboard_buffer((const uint8_t *)"\r", 1); + } } else if (otp_config->cfg_flags & SHORT_TICKET || otp_config->cfg_flags & STATIC_TICKET) { if (otp_config->cfg_flags & SHORT_TICKET) { otp_config->fixed_size /= 2; } add_keyboard_buffer(otp_config->fixed_data, otp_config->fixed_size, false); + if (otp_config->tkt_flags & APPEND_CR) { + append_keyboard_buffer((const uint8_t *)"\x28", 1); + } } else {