From: GitHub <no...@gi...> - 2015-05-13 07:25:56
|
Branch: refs/heads/master Home: https://github.com/OpenSC/OpenSC Commit: c7af08c68a5bb3e753b008822e947d52016266c0 https://github.com/OpenSC/OpenSC/commit/c7af08c68a5bb3e753b008822e947d52016266c0 Author: Doug Engert <dee...@gm...> Date: 2015-05-13 (Wed, 13 May 2015) Changed paths: M src/libopensc/card-piv.c Log Message: ----------- PIV - read just length of object to get size card-piv.c tries to read the first 8 bytes of an object to get object size so it can allocate a buffer. It then reads the whole object. apdu.c has changed over the years, and apdu.c will keep reading as long as the card returns status of 61 XX thus apdu.c will read the whole object while discarding the extra data and returning to the caller only the first part of the data. This in effect causes a double read of objects. This patch sets SC_APDU_FLAGS_NO_GET_RESP to tell apdu to stop doing the extra get-response commands thus avoiding most of the extra overhead. This in not an optimal patch as it only works with T=1 cards/readers but the patch is confined to just card-piv.c. A better patch is in the works. Fixes #462 |