Commit Graph

47 Commits

Author SHA1 Message Date
Peter Popovec ba85ae75e3 opensc-explorer, command "info" - added information about LCS
Information about "Life cycle status byte" is now available in listing.
Also src/libopensc/types.h update - added more LCSB definitions.
iso7816_process_fci () update: improved tag 0x8A parsing.

Fixes in card-flex.c and card-miocos.c - SC_FILE_STATUS_xxx is not
bitfield.
2021-01-22 19:04:22 +01:00
Frank Morgner a899a46b09 replaced SC_TEST_RET with LOG_TEST_RET 2018-12-06 09:26:42 +01:00
Frank Morgner 00a150f74c replaced SC_FUNC_RETURN with LOG_FUNC_RETURN 2018-12-06 09:26:42 +01:00
Frank Morgner 24b50a4277 replace sc_debug with sc_log 2018-12-06 09:26:42 +01:00
Priit Laes 45f407c021 Mark driver-specific global sc_atr_table structures as const
As most of the drivers do not modify these, we can mark them as const.
Two drivers that we cannot convert are dnie and masktech.

section                 size
.data                  35232 ->   25472
.data.rel.ro           36928 ->   46688
2018-08-22 22:50:30 +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 2ed4c8ae6c Adds error checking 2015-10-14 22:16:44 +02:00
Frank Morgner bcb5fc15e5 honour HAVE_CONFIG_H 2015-04-22 23:55:33 +02:00
Frank Morgner d21830344f fixed a ton of compiler warnings 2013-08-03 19:15:55 +02:00
martin a5ca648afd Revert r4668. Change the way limitations on max send and receive sizes are set.
See http://www.opensc-project.org/pipermail/opensc-devel/2010-September/014836.html

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4706 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-09 18:58:44 +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 38ba3ad18d Remove card->finish() functions that do nothing
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3839 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 11:32:12 +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
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
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
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
nils 2db63b17f9 signed vs. unsigned
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2034 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-21 15:00:57 +00:00
okir 5dda541b7e - made apdu_masquerade functionality available to all readers, not just pcsc
- added new parameters max_send_size and max_recv_size, roughly corresponding
  to the old max_le (SC_APDU_CHOP_SIZE) parameter. You can now set this
  chop limit per driver class (pcsc, openct, ctapi), which sets
  driver->max_{send,recv}_size. This value is copied to
  card->max_{send,recv}_size in sc_connect_card, and can be overridden
  by the card driver.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1683 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-18 16:35:28 +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 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
okir 30c094395a - it seems the upper limit for r/w binary is 244
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1130 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-15 15:42:45 +00:00
okir 877423b7ec - restrict max read/write size to 128
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1106 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-14 12:25:13 +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
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
jey 28b4a1b9f8 - iso7816_set_security_env now has correct values for P1
- Improved detection of SetCOS cards
- Changed the default CLA byte in card-setcos.c to 0x80


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@616 c6295689-39f2-0310-b995-f0e70906c6a9
2002-06-03 15:05:58 +00:00
jey 728928401a - Some fixes to the MioCOS driver
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@576 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-19 17:02:49 +00:00
aet 3dccd63989 - C++ support. Compiles with gcc/g++ for Linux, otherwise
completely untested.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@574 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-19 14:23:31 +00:00
jey 43ecd78941 - Fixed ACL handling in MioCOS driver
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@521 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-14 12:43:47 +00:00
jey 5259182d3e - Changed CLA byte to 0xA0 in miocos_delete_file()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@483 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-06 15:04:14 +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
jey e172e6678d - Cleaned up MioCOS driver and added PIN code creation
- Added an error message in case ODF parsing fails


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@449 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-04 20:40:40 +00:00
jey 7ddcb3d692 - sec_attr and prop_attr are now dynamically allocated in
struct sc_file


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@404 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-28 14:13:36 +00:00
jey 23e956cf9b - Fixed PKCS #15 structure generation on Cryptoflex cards
and implemented a default profile
- Cryptoflex now reports its supported PK algorithms
  correctly
- Various pkcs15-init fixes


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@295 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-12 13:00:57 +00:00
jey ae306cf06f - GPK now reports it's PK abilities correctly
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@286 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-10 11:48:57 +00:00
aet 2a4afb8319 Include stdlib.h where needed
Warning fixes for various OS's
mcheck.h is not portable, so remove it


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@285 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-09 17:54:16 +00:00
jey 7d2171c1d2 - Improved support for MioCOS cards
- Removed PKCS #15 creation from cryptoflex-tool
- Added PIN pad character option to profile.c


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@282 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-09 15:11:46 +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 04dfc47d92 - added a driver for MioCOS cards by Miotec
- implemented EF(DIR) updating


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@242 c6295689-39f2-0310-b995-f0e70906c6a9
2002-02-26 11:23:25 +00:00