Commit Graph

53 Commits

Author SHA1 Message Date
Frank Morgner 4444d24f59 win32: generate PDB files for releases
https://msdn.microsoft.com/fsk896zz.aspx

fixes https://github.com/OpenSC/OpenSC/issues/1191
2017-11-21 10:54:48 +01:00
Frank Morgner 0502a839c6 unified reading of EF.GDO 2017-10-27 19:48:22 +02:00
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 b96ba14aae added fall through comment 2015-10-30 12:15:06 +01:00
Frank Morgner 7fe4819a02 card-tcos: fixed resource leak 2015-09-17 22:32:06 +02:00
Frank Morgner bcb5fc15e5 honour HAVE_CONFIG_H 2015-04-22 23:55:33 +02:00
Frank Morgner 2e04fa99c1 fixed pointless array comparisons 2015-01-28 07:39:35 +01:00
pk c97fc2e719 support for TCOS3 IdKey cards and fix for bug #256
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5508 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-28 14:24:27 +00:00
andre b21eeb46b9 libopensc: Removes unused flag SC_CARD_CAP_RSA_2048.
Relates to [http://www.opensc-project.org/opensc/ticket/296#comment:1 #296].

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5308 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-07 18:16:40 +00:00
ludovic.rousseau f47416d60e Do not cast the return value of malloc(3) and calloc(3)
From http://en.wikipedia.org/wiki/Malloc#Casting_and_type_safety
" Casting and type safety

malloc returns a void pointer (void *), which indicates that it is a
pointer to a region of unknown data type. One may "cast" (see type
conversion) this pointer to a specific type, as in

int *ptr = (int*)malloc(10 * sizeof (int));

When using C, this is considered bad practice; it is redundant under the
C standard. Moreover, putting in a cast may mask failure to include the
header stdlib.h, in which the prototype for malloc is found. In the
absence of a prototype for malloc, the C compiler will assume that
malloc returns an int, and will issue a warning in a context such as the
above, provided the error is not masked by a cast. On certain
architectures and data models (such as LP64 on 64 bit systems, where
long and pointers are 64 bit and int is 32 bit), this error can actually
result in undefined behavior, as the implicitly declared malloc returns
a 32 bit value whereas the actually defined function returns a 64 bit
value. Depending on calling conventions and memory layout, this may
result in stack smashing.

The returned pointer need not be explicitly cast to a more specific
pointer type, since ANSI C defines an implicit conversion between the
void pointer type and other pointers to objects. An explicit cast of
malloc's return value is sometimes performed because malloc originally
returned a char *, but this cast is unnecessary in standard C
code.[4][5] Omitting the cast, however, creates an incompatibility with
C++, which does require it.

The lack of a specific pointer type returned from malloc is type-unsafe
behaviour: malloc allocates based on byte count but not on type. This
distinguishes it from the C++ new operator that returns a pointer whose
type relies on the operand. (see C Type Safety). "

See also
http://www.opensc-project.org/pipermail/opensc-devel/2010-August/014586.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4636 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-18 15:08:51 +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 56fb57603b Merge [3758:3783/trunk]
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3785 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-22 09:18:16 +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
ludovic.rousseau e928d5565c convert C++ in C comment
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3502 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-28 07:57:03 +00:00
pk 513a3dde0a support for TCOS3
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3309 c6295689-39f2-0310-b995-f0e70906c6a9
2007-12-28 18:18:57 +00:00
aj ad79822134 convert to utf-8.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3085 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-19 21:32:31 +00:00
aj 1810d4d3fb tcos updates by Peter Koch.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2891 c6295689-39f2-0310-b995-f0e70906c6a9
2006-04-24 18:41:57 +00:00
aj e0465478e7 update by Peter Koch.
still one problem left in pkcs11-tool, but lots of improvements.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2650 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-17 08:00:44 +00:00
aj 06e1239a89 new tcos atr provided by Gerald Richter.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2623 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-24 17:45:54 +00:00
nils f6c95792fe let src/libopensc/ compile with -Wall -W -Wno-unused-parameter -Werror
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2546 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-07 08:33:55 +00:00
nils b143ac5637 add support for signature generation with a decryption key; patch supplied by Peter Koch <pk_opensc@web.de>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2491 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-16 21:35:13 +00:00
nils 45a9d05830 cleanup, mostly signed/unsigned issues
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2469 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-08 10:22:14 +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
aet 32b417cbf3 - First stab towards standardized card types
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2172 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-10 10:07:13 +00:00
aet 73aa989875 - Unify a bit the output of commands like opensc-tool -D
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2166 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-09 14:47:46 +00:00
aet ece96aff98 - Add atrmask to sc_atr_table
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2160 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-09 11:33:37 +00:00
aet 69d2e9014d - Optimize a few cpu cycles from _sc_match_atr_hex
- Replace struct sc_atr_table / _sc_match_atr with
  recently introduced _hex variants
- Rewrote _add_atr
- Introduce int type variable to sc_card_t, so that
  every other card driver won't have to glue around
  with this
- Card driver cleanups, optimize the number of
  sc_match_atr called per card driver. Also
  always try direct match with _sc_match_atr
  first, before relying on eg. historical bytes
  information on some card drivers
- Fixed a memory leak from the miocos driver


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2145 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-06 19:40:40 +00:00
aet bd0f86f69c - Unify all card drivers ATR matching code to use _sc_match_atr_hex,
untested as of yet.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2134 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-04 20:29:35 +00:00
aet 55e170e0ac - Build / warning fixes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2014 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-15 13:53:36 +00:00
nils 60eeadb962 add support for sc_card_ctl(*, SC_CARDCTL_GET_SERIALNR, *) for
TCOS cards (and use it in the netkey support)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1901 c6295689-39f2-0310-b995-f0e70906c6a9
2004-09-17 19:27:49 +00:00
nils 84f08c9544 fix TCOS decipher operation
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1808 c6295689-39f2-0310-b995-f0e70906c6a9
2004-06-30 17:26:05 +00:00
okir aae679b28a - tcos_card_ctl shoudlnt complain about unknown cardctls
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1543 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-19 18:02:37 +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
okir 2abc504051 - remove signedness warnings printed by new gcc
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1176 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-30 08:54:42 +00:00
okir 48a61e95c0 - added card name to struct sc_card to allow upper level apps to identify
card type more precisely


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1173 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-28 20:52:33 +00:00
sth 9631ef3636 removed const in sc_card_driver (caused win32 crash)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@918 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-20 12:51:07 +00:00
jey 0810ccf4af - Removed error list
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@683 c6295689-39f2-0310-b995-f0e70906c6a9
2002-08-21 10:15:58 +00:00
fabled 7635468ed9 - Initial support for win32
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@654 c6295689-39f2-0310-b995-f0e70906c6a9
2002-06-14 12:52:56 +00:00
aet e681dc4165 Warning fixes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@602 c6295689-39f2-0310-b995-f0e70906c6a9
2002-05-13 12:23:21 +00:00
jey d9a788350d - Applied a patch by Werner Koch that brings the TCOS driver
up-to-speed


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@601 c6295689-39f2-0310-b995-f0e70906c6a9
2002-05-09 10:34:18 +00:00
jey 03d58e7956 - Applied a patch by Matthias Bruestle <m@mbsks.franken.de>:
- Changed the case of GET RESPONSE in card-default.c to 2 short
- Added ATRs to Flex, GPK and TCOS drivers
- Changed value of maximum Lc in card.c to be 255


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@600 c6295689-39f2-0310-b995-f0e70906c6a9
2002-05-09 10:22:42 +00:00
jey 22636c2df9 - Added SC_ERROR_FILE_ALREADY_EXISTS
- Changed call convention for reader finish()
- CT-API driver now frees its resources correctly
- Added year 2002 to some of the copyright statements
- sc_pkcs15_decipher() and sc_pkcs15_compute_signature()
  now select only the parent DF of the private key file


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@463 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-05 14:46:44 +00:00
aet d81d10ba90 Upgrade sources to use new headers, part #1
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@458 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-05 10:44:51 +00:00
okir 5006b0d151 - added some #include string.h statements for RH 7.2
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@357 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-21 09:36:38 +00:00
jey 3416461c4b - Added X.509 algorithm id decoding and encoding to asn1.c
- Implemented a generic ATR matching helper function
- Made signing much smarter (should even work now)
- Added info about supported crypto algorithms to struct sc_card


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@276 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-08 05:59:57 +00:00
jey 4ac49d6e88 - intermediary checkin
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@249 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-01 11:52:55 +00:00
jey 4fa7283ae2 - added some missing files
- renamed card-setec.c to card-setcos.c


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@243 c6295689-39f2-0310-b995-f0e70906c6a9
2002-02-26 11:27:49 +00:00
jey 3fa1b27736 - implemented reader abstraction layer; now it's easier to
add support for e.g. CT-API
- renamed ops_data field to drv_data in struct sc_card
- copied coding style document from Linux kernel


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@221 c6295689-39f2-0310-b995-f0e70906c6a9
2002-02-24 19:32:14 +00:00