From ccb8a2203755c7e79811b2b40a90e7e771254b0c Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 20 Mar 2016 13:37:11 +0100 Subject: [PATCH] card_emu: Avoid PTS related race-condition We should not set the new Fi/Di values before we actually transmitted the PTSS PCK at the old baud rate first. --- firmware/src_simtrace/card_emu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/firmware/src_simtrace/card_emu.c b/firmware/src_simtrace/card_emu.c index 8454bc12..5f0ee7ca 100644 --- a/firmware/src_simtrace/card_emu.c +++ b/firmware/src_simtrace/card_emu.c @@ -364,7 +364,7 @@ from_pts3: } -static enum iso7816_3_card_state +static int process_byte_pts(struct card_handle *ch, uint8_t byte) { switch (ch->pts.state) { @@ -406,6 +406,7 @@ process_byte_pts(struct card_handle *ch, uint8_t byte) flush_pts(ch); /* activate UART TX to transmit PTS response */ card_emu_uart_enable(ch->uart_chan, ENABLE_TX); + return -1; } return ISO_S_IN_PTS;