From: Frida F. <no...@gi...> - 2021-12-20 19:00:34
|
Branch: refs/heads/master Home: https://github.com/OpenSC/OpenSC Commit: 2364980534750e3a946b43cbd6d55063c014f3fb https://github.com/OpenSC/OpenSC/commit/2364980534750e3a946b43cbd6d55063c014f3fb Author: Frida Flodin <fr...@ce...> Date: 2021-12-20 (Mon, 20 Dec 2021) Changed paths: M src/libopensc/reader-pcsc.c Log Message: ----------- Fix detect_card_presence return value In opensc.h the documentation states that the function detect_card_presence should return 0 if no card is present, which is reasonable. This was not the case before since more flags could be set even if SC_READER_CARD_PRESENT is not. This was probably missed before since more flags has been added since this function was first written. Signed-off-by: Frida Flodin <fr...@ce...> Commit: 348552e03508895ac483a4e1497b350b9822e0dd https://github.com/OpenSC/OpenSC/commit/348552e03508895ac483a4e1497b350b9822e0dd Author: Frida Flodin <fr...@ce...> Date: 2021-12-20 (Mon, 20 Dec 2021) Changed paths: M src/libopensc/reader-pcsc.c Log Message: ----------- Handle when reader is detached on macOS refresh_attributes returns SC_SUCCESS if we can't detect the reader. The same should happen if the reader is unknown/detached. This was found when detaching reader on macOS. Then we don't get SCARD_E_UNKNOWN_READER from SCardGetStatusChange. We notice it later from that the state of the reader is SCARD_STATE_UNKNOWN. This resulted in C_WaitForSlotEvent not noticing that the reader, and thus the card, was removed. Signed-off-by: Frida Flodin <fr...@ce...> Commit: 738588fd2b1c69794ba9ebe7bdb898486e001ecb https://github.com/OpenSC/OpenSC/commit/738588fd2b1c69794ba9ebe7bdb898486e001ecb Author: Frida Flodin <fr...@ce...> Date: 2021-12-20 (Mon, 20 Dec 2021) Changed paths: M src/libopensc/reader-pcsc.c Log Message: ----------- Fix incorrect use of SC_READER_CARD_CHANGED Looking in opensc.h the flag SC_READER_CARD_CHANGED should be set if the card was exchanged. In other words if a card is present but it is not the same card as before. It looks like SC_READER_CARD_CHANGED was misinterpreted as a flag for when the card was removed and thus that the status has changed. Signed-off-by: Frida Flodin <fr...@ce...> Commit: 2630de7d6c0648dc4c91abef0adf61926534515d https://github.com/OpenSC/OpenSC/commit/2630de7d6c0648dc4c91abef0adf61926534515d Author: Frida Flodin <fr...@ce...> Date: 2021-12-20 (Mon, 20 Dec 2021) Changed paths: M src/libopensc/sc.c Log Message: ----------- Sanity check detect_card_presence return value The return value from detect_card_presence should be 0 if no card is present. Therefore the flag SC_READER_CARD_PRESENT is not allowed to be 0 if detect_card_presence has non-zero return value. Signed-off-by: Frida Flodin <fr...@ce...> Compare: https://github.com/OpenSC/OpenSC/compare/846ee3736c2d...2630de7d6c06 |