Fix another race condition around ack button and usb communication.
authorNIIBE Yutaka <gniibe@fsij.org>
Wed, 21 Nov 2018 05:56:56 +0000 (14:56 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Wed, 21 Nov 2018 05:56:56 +0000 (14:56 +0900)
ChangeLog
src/usb-ccid.c

index 9ce03f1..d25e678 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,13 @@
+2018-11-21  NIIBE Yutaka  <gniibe@fsij.org>
+
+       * src/usb-ccid.c (ccid_thread): Fix a race condition sending
+       result APDU by ack button, time out, sending time extension block
+       again while tx_busy=1.
+
 2018-11-17  NIIBE Yutaka  <gniibe@fsij.org>
 
-       * src/main.c (device_initialize_once): Depends on MHZ.
+       * src/main.c (device_initialize_once): Depends on MHZ to
+       distinguish GD32F103.
        * src/openpgp-do.c (do_openpgpcard_aid): Ditto.
 
 2018-11-12  NIIBE Yutaka  <gniibe@fsij.org>
index c86a74d..8d21a48 100644 (file)
@@ -1766,7 +1766,7 @@ ccid_thread (void *arg)
     {
       eventmask_t m;
 
-      if (bDeviceState == USB_DEVICE_STATE_CONFIGURED)
+      if (!c->tx_busy && bDeviceState == USB_DEVICE_STATE_CONFIGURED)
        timeout_p = &timeout;
       else
        timeout_p = NULL;