Skip to content

Commit

Permalink
SecurePINVerify: the previous timeoue is already saved and restored
Browse files Browse the repository at this point in the history
No need to save it again in the special case WTX S-block.
  • Loading branch information
LudovicRousseau committed May 24, 2024
1 parent 8c6a55f commit 7f3cc53
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,12 +550,10 @@ RESPONSECODE SecurePINVerify(unsigned int reader_index,
unsigned char sblk[1]; /* we only need 1 byte of data */
t1_state_t *t1 = &get_ccid_slot(reader_index)->t1;
unsigned int slen;
int oldReadTimeout;

DEBUG_COMM2("CT sent S-block with wtx=%u", RxBuffer[DATA]);
t1->wtx = RxBuffer[DATA];

oldReadTimeout = ccid_descriptor->readTimeout;
if (t1->wtx > 1)
{
/* set the new temporary timeout at WTX card request */
Expand All @@ -581,9 +579,6 @@ RESPONSECODE SecurePINVerify(unsigned int reader_index,
ret = CCID_Receive(reader_index, RxLength, RxBuffer, NULL);
if (ret != IFD_SUCCESS)
goto end;

/* Restore initial timeout */
ccid_descriptor->readTimeout = oldReadTimeout;
}

/* this should not happen. It will make coverity happy */
Expand All @@ -600,7 +595,9 @@ RESPONSECODE SecurePINVerify(unsigned int reader_index,
}

end:
/* Restore initial timeout */
ccid_descriptor -> readTimeout = old_read_timeout;

return ret;
} /* SecurePINVerify */

Expand Down

0 comments on commit 7f3cc53

Please sign in to comment.