Skip to content

Commit

Permalink
SecurePINVerify(): restore timeont in case of error
Browse files Browse the repository at this point in the history
If the communication fails we also must restore the default read
timeout.
  • Loading branch information
LudovicRousseau committed May 24, 2024
1 parent bbb5327 commit 8c6a55f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,13 +574,13 @@ RESPONSECODE SecurePINVerify(unsigned int reader_index,

ret = CCID_Transmit(t1 -> lun, slen, RxBuffer, 0, t1->wtx);
if (ret != IFD_SUCCESS)
return ret;
goto end;

/* I guess we have at least 6 bytes in RxBuffer */
*RxLength = 6;
ret = CCID_Receive(reader_index, RxLength, RxBuffer, NULL);
if (ret != IFD_SUCCESS)
return ret;
goto end;

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

0 comments on commit 8c6a55f

Please sign in to comment.