Since "Add GCC format checking attributes to log functions" commit GCC
warns us about problems with format strings and their arguments provided
to OpenSC message logging functions.
This commit fixes all cases where GCC warned about incorrect format on
64-bit Linux, 32-bit and 64-bit mingw builds (with SM and OpenSSL enabled).
Well, almost all since on mingw GCC does not recognize "ll" size specifier
(present at least since Visual Studio 2005, also in mingw own CRT) so these
(few) warnings about it remain.
In most cases format size specifier for size_t type was missing (usually
size was left at default int level, with is different on 64-bit x86).
Some formats had too few / too many arguments.
In some cases pointers were printed as integers.
Some long variables were missing "l" prefix (especially with regard to %x
format).
Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
The special value still needs to be handled for commands that are issued
during card initialization. This especially concerns T=0 cards that need
to use iso_get_response.
fixes#533
regression of 85b79a3332
If the reader announces extended length support, but the card driver
leaves max_send_size/max_recv_size at `0`, max_send_size/max_recv_size
previously would have been overwritten with the reader's size though the
card might not have set SC_CARD_CAP_APDU_EXT. This commit fixes this
behavior.
Additionally card->max_send_size/max_recv_size is always initialized to
a value different from 0 after the card initialization. This removes the
need to check for this special value in all subsequent calls.
For some cards some APDUs are always transmitted in a plain mode,
even if SM session is opened.
For these APDUs the 'get_sm_apdu' card's handler returns SUCCESS without wrapped APDU version.
In such cases 'transmit' is called for the plain APDU.
apdu.c:166:5: warning: Value stored to 'p' is never read
*p++ = (u8)apdu->le;
^~~
apdu.c:156:4: warning: Value stored to 'p' is never read
p += apdu->lc & 0xff;
^ ~~~~~~~~~~~~~~~
apdu.c:147:5: warning: Value stored to 'p' is never read
*p++ = (u8)apdu->le;
^~~
apdu.c:139:3: warning: Value stored to 'p' is never read
p += apdu->lc;
^ ~~~~~~~~
apdu.c:118:3: warning: Value stored to 'p' is never read
p += apdu->lc;
^ ~~~~~~~~
apdu.c:112:5: warning: Value stored to 'p' is never read
*p++ = (u8)apdu->le;
^~~
apdu.c:107:5: warning: Value stored to 'p' is never read
*p++ = (u8)apdu->le;
^~~
apdu.c:102:4: warning: Value stored to 'p' is never read
*p++ = (u8)apdu->le;
^~~
apdu.c:99:5: warning: Value stored to 'p' is never read
*p++ = (u8)0x00;
^~~
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5157 c6295689-39f2-0310-b995-f0e70906c6a9
r4761 added a test in the wrong place. Second fix
r4804 added the test in the correct place. This fix
removes one of the tests added by r4761
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4806 c6295689-39f2-0310-b995-f0e70906c6a9
* reduce to a few, supported functions.
* change all functions to take the debug level as parameter.
* use symbolic names for the debug levels.
* fix tools to pass "verbose"/"opt_debug" as ctx->debug.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4118 c6295689-39f2-0310-b995-f0e70906c6a9
- Remove slot abstraction from internal API and all reader drivers. CT-API (from where it all comes from) readers with multiple slots (if still found) can be presented as separate readers, OpenCT should remove the slot abstraction, PC/SC never knew about it. None of the tools knew how to use slots.
- Add sc_cancel (translates to SCardCancel)
- Re-implement sc_wait_for_event; support a blocking call.
- Replace the "int reader" API with "* sc_reader_t" style; add "Get reader by name" functionality.
- Remove "action" parameter from sc_disconnect_card() (was not used)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3931 c6295689-39f2-0310-b995-f0e70906c6a9
- log APDUs only if DEBUG is defined (sensitive APDUs should
never be logged and we cannot know whether a APDU is sensitive
or not => enable APDU logging only in a non-production debug
build)
- remove OPENSC_DONT_LOG_SENSITIVE configure option as it's
needed anymore
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2868 c6295689-39f2-0310-b995-f0e70906c6a9