Fix keepalive msg.

Only sent when CBOR is initiatied.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2022-09-27 22:09:16 +02:00
parent 286858c907
commit 2aff75a3ec

View File

@@ -326,7 +326,8 @@ void send_keepalive() {
} }
void driver_exec_timeout() { void driver_exec_timeout() {
send_keepalive(); if (thread_type == 2)
send_keepalive();
} }
uint8_t *driver_prepare_response() { uint8_t *driver_prepare_response() {
@@ -338,10 +339,12 @@ uint8_t *driver_prepare_response() {
} }
void driver_exec_finished(size_t size_next) { void driver_exec_finished(size_t size_next) {
if (thread_type == 2 && apdu.sw != 0) if (size_next > 0) {
ctap_error(apdu.sw & 0xff); if (thread_type == 2 && apdu.sw != 0)
else ctap_error(apdu.sw & 0xff);
driver_exec_finished_cont(size_next, 7); else
driver_exec_finished_cont(size_next, 7);
}
apdu.sw = 0; apdu.sw = 0;
} }