Commit Graph

22 Commits

Author SHA1 Message Date
Maciej S. Szmigiero 62cbda6cd9 Fix log messages format and parameter issues flagged by GCC
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>
2017-03-27 11:05:16 +02:00
Frank Morgner bcb5fc15e5 honour HAVE_CONFIG_H 2015-04-22 23:55:33 +02:00
Tim Taylor 2741f23641 Set output buffer len variable if padding removed. 2013-09-29 19:14:01 +02:00
Viktor Tarasov bdd264936c pkcs15: add 'context' parameter to the strip padding procedures
and add debug messages
2013-08-03 21:53:01 +02:00
vtarasov 27f493e6d8 libopensc: fix debug message
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5230 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-14 18:02:50 +00:00
vtarasov a067bf35a3 pkcs15: more of the debug messages
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5228 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-13 18:11:07 +00:00
dengert c2fe4609a9 Modifications to support EC and ECDSA for
emulated cards. True PKCS#15 cards with EC 
will need additional changes. 

Main changes are in framework-pkcs15.c, mechanism.c,
padding.c, pkcs15-algo.c and pkcs15-sec.c 
where switch statements for key type, and testing
of flags was modified to make it easier to add 
additional key types in the future. 

The code was tested using RSA and ECDSA using a PIV card 
from pkcs11-tool, OpenSSL and Thunderbird with 
modifications to NSS-3.12.7 to get ECDSA to sign e-mail. 

Only named curves are supported for ECDSA, ECDH is still 
needed. pkcs11-tool has only minimal changes need to work 
with the -O option to list EC keys. 

One additional line was added to pkcs15-sec.c which 
should get GOSTR sign to work. 

libp11 and engine do not yet have EC support. 

 --This line, and those below, will be ignored--

M    src/tools/piv-tool.c
M    src/tools/pkcs11-tool.c
M    src/pkcs11/framework-pkcs15.c
M    src/pkcs11/mechanism.c
M    src/pkcs11/pkcs11-object.c
M    src/libopensc/pkcs15-prkey.c
M    src/libopensc/card-piv.c
M    src/libopensc/padding.c
M    src/libopensc/cardctl.h
M    src/libopensc/pkcs15-algo.c
M    src/libopensc/libopensc.exports
M    src/libopensc/pkcs15-piv.c
M    src/libopensc/pkcs15-sec.c


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4904 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-01 20:08:42 +00:00
viktor.tarasov 58c1c88efa libopensc: homogenise line ending in the debug messages
continuating r4759


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4774 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-25 20:35:59 +00:00
aj 6545b42c02 cleanup of the debug code:
* 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
2010-03-15 12:17:13 +00:00
aj d22a2483c0 Header file cleanup.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4081 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-04 08:14:36 +00:00
martin d672fde449 Remove sc_error and sc_ctx_suppress_errors_* in favor of sc_debug/fprintf
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3721 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-14 08:46:59 +00:00
nils a2f622a215 implement support for SHA2 (still experimental)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3115 c6295689-39f2-0310-b995-f0e70906c6a9
2007-02-02 22:15:14 +00:00
aj b3ad2f9dd2 convert to utf-8.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3084 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-19 21:31:17 +00:00
nils ac4dfc0e38 cleanup
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2292 c6295689-39f2-0310-b995-f0e70906c6a9
2005-04-04 21:52:31 +00:00
bert 2d97002824 API fixup: use defined type instead of struct for exposed structs
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2232 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-08 20:59:35 +00:00
nils 8e05d3eabb do a memcpy only if source and dest are different
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2009 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-13 20:58:28 +00:00
nils 9953d0b21d fix some compiler warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1905 c6295689-39f2-0310-b995-f0e70906c6a9
2004-09-20 09:47:35 +00:00
sth f017da5102 Fix: no copying done from in to out in case of SC_ALGORITHM_RSA_PAD_NONE padding (by Chaskiel)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1692 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-23 10:48:29 +00:00
aet 5616dba08e - Stop using unflexible automake conditionals when
building PC/SC, OpenCT or USBToken support,
  use ifdef's directly in source.
- Because of above, add HAVE_PCSCLITE for winconfig.h
- Remove unnecessary includes for log.h, opensc.h and
  errors.h in libopensc sources, they're already taken
  care by internal.h.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1406 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-03 09:28:55 +00:00
aet 763fc16704 Rename libopensc specific error/debug to sc_error/sc_debug
We should have done this ages ago.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1392 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-25 14:21:18 +00:00
sth 18ebc833f8 Fix: don't give an error if the hash algo is SC_ALGORITHM_RSA_HASH_NONE
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1302 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-24 14:27:54 +00:00
okir 95e2d8b78a - Change padding functions
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1264 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-15 10:49:28 +00:00