Commit Graph

218 Commits

Author SHA1 Message Date
Frank Morgner bcb5fc15e5 honour HAVE_CONFIG_H 2015-04-22 23:55:33 +02:00
Frank Morgner a7a903fd81 check ATRs even for forced card driver
some card drivers depend on a card type which is initialized by matching the card's ATR
2015-04-15 08:56:22 +02:00
Viktor Tarasov 49598b6016 libopensc: invalid OID comparison for EC keys
Thanks to Peter Popovec <popovec.peter@gmail.com>
2015-04-09 11:49:05 +02:00
vletoux 3b873adad2 win32: allows UNICODE built.
UNICODE is set by default by Visual Studio (but can be deactived)
The trick is to force ANSI version by appending a A to the function calls.
2015-03-29 13:54:51 +02:00
Viktor Tarasov 31124ac4f9 pkcs15init: allocate EC parameters 2015-03-04 19:46:21 +01:00
Viktor Tarasov 1123768ac3 libopensc: invalid 'free' and 'assign NULL' order 2015-03-04 19:45:23 +01:00
Viktor Tarasov fa923831f8 introduce EC curve OID into algorithm info data
needed to store information about EC curve supported by card.
Primary usage is when importing/generating key to get know if particular curve is supported by card.
2015-02-20 13:49:18 +01:00
Martin Campbell d162143964 Updating to fix failure of ePass2003 USB smart card due to failure to re-authenticate secure messaging when card is reset due to multiple applications using PKCS11 sessions 2015-02-07 21:46:44 +01:00
Frank Morgner 7c497b324f fixed not null terminated buffer 2015-01-28 05:51:00 +01:00
Frank Morgner 00330b2c79 fixed resource leak 2015-01-24 22:16:22 +01:00
Frank Morgner 7a34c204c1 fixed dereference before null check
silence warnings reported by coverity-scan
2015-01-22 20:29:33 +01:00
Viktor Tarasov 7a03f1883b libopensc: create and export 'sc_match_atr_block' 2013-12-29 19:46:56 +01:00
Martin Paljak 1acb4adc3e Check for NULL before dereferencing.
Reported by STACK

http://css.csail.mit.edu/stack/

Change-Id: Id7959c8217f46313ecf35a271efaf5f703fde2dc
2013-11-25 19:25:43 +02:00
Frank Morgner 07818329ab made sc_apdu_t.data 'const' (which it used to be)
fixes a lot of warnings which pass a const buffer to the APDU's data

Note that a non-const data member is only required for sc_allocate_apdu
sc_free_apdu. They are currently used with an explicit typecast.
However, sc_allocate_apdu and sc_free_apdu both are not used once in the
entire project. One might also simply throw both functions away.
-- Both are thrown away. (VT)
2013-08-03 18:26:04 +02:00
Viktor Tarasov 1a972920f0 By default 'default' card driver is disabled ...
'Default' card driver is explicitely enabled for 'opensc-explorer' and 'opensc-tool' tools.
https://github.com/OpenSC/OpenSC/pull/175
2013-08-02 22:01:51 +02:00
Viktor Tarasov 8fc679bf40 libopensc: invalid usage of SC_ERROR_MEMORY_FAILURE
Initiated by discussion in https://github.com/OpenSC/OpenSC/pull/134 .

SC_ERROR_MEMORY_FAILURE has to be used as a resulting code of the card related operations,
and not as result of the memory allocation problems.

New 'warning' category of SC_ERRORs introduced -- SC_WARNING_xx .
Error text and SC_ERROR associated with return codes 6300 and 6200 has been changed.
2013-03-02 19:29:14 +01:00
Viktor Tarasov 6a4de6d551 libopensc: APDU 'allocate & copy'and 'free' procedures 2013-01-06 17:30:41 +01:00
Viktor Tarasov da5934a6ff libopensc iso7816: retry SELECT with FCI if SELECT without FCI fails
t457 (https://www.opensc-project.org/opensc/ticket/457)
For some cards that currently use the common iso-7816 operations
only SELECT with return of FCI/FCP can be applied.

In iso-7816 'select-file' handle, if 'SELECT without FCI' fails with error code 6A86,
then retry 'SELECT with FCI'. Other error code can be added.

Sorry for the 'coding style' noise.
2012-11-11 20:38:30 +01:00
Viktor Tarasov cfd5aaba7d SM: initial implementation of secure messaging framework 2012-06-08 20:17:35 +02:00
vtarasov 848180ab50 libopensc: use short debug macros in card.c
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5319 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-10 09:20:15 +00:00
vtarasov 2244d0c96f libopensc: procedure to log the card's cache
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5069 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 09:32:34 +00:00
vtarasov a576582701 libioensc: use 'struct sc_atr' instead of 'u8 *atr, size_t atr_len'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5061 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-07 17:18:58 +00:00
vtarasov bf4aa793af libopensc: parse content of the EF(ATR) file
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5059 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-07 15:49:10 +00:00
martin f8f38e7d86 Reject creating files bigger than 64K.
Most smart cards currently have only 64K or 128K of EEPROM. This will give better errors earlier for people trying to import huge keyfiles with TrueCrypt.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5030 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-02 15:05:42 +00:00
vtarasov 83453633b7 libopensc: remove '\n' from the debug message ...
'sc_do_log_va' takes care of line ending


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5013 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-31 11:09:21 +00:00
vtarasov 8b270205cc libopensc: API for the 'erase-binary' card operation
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5005 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-30 13:25:09 +00:00
vtarasov 92c3e59e16 libopensc: Now 'cache-valid' flag is a member of 'sc_card_cache' ...
add 'current_ef' and 'current_df' member to 'sc_card_cache'.
The main purpose of this is to reduce number of APDU transactions.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5002 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-30 13:04:55 +00:00
s d66b3c71d2 fix: implicit depending on the RSA algo_info for GOSTR3410 algo
add sc_card_find_gostr3410_alg function

Thanks to Douglas E. Engert
http://www.opensc-project.org/pipermail/opensc-devel/2010-December/015408.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4931 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-09 08:23:14 +00:00
dengert e2bd16ecd0 Additional EC routines _sc_card_add_ec_alg and sc_card_find_ec_alg
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4903 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-30 19:30:03 +00:00
martin 7ab591a684 libopensc: make sc_reset() take an additional parameter "do_cold_reset" which will unpower the card.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4896 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-30 11:22:31 +00:00
andre 821f4fef6d card.c: Fixes the overriding of max_x_size limitations. In the result, the limitations of cards are adjusted to fit the limitations imposed by the configured reader.
ctx.c: Lookup conf_block of reader_driver by short_name

Fixes #269

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4878 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-19 18:09:04 +00:00
martin c6eb9d3d92 PC/SC: move protocol (T=0/T=1) selection to reader-pcsc.c, where it is used.
Also, check fot the required protocol before connecting to the card and use the forced prtocol instead of re-connecting.

See http://lists.drizzle.com/pipermail/muscle/2010-November/008671.html

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4873 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-08 12:37:22 +00:00
martin c51156875f libopensc: remove meaningless sc_card_valid()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4785 c6295689-39f2-0310-b995-f0e70906c6a9
2010-10-05 14:58:50 +00:00
martin 39311cb881 libopensc: check for unset max_recv/send_size in all places.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4721 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-15 11:09:28 +00:00
martin 36705f8f10 Add missing piece from r4706.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4713 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-13 07:27:34 +00: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
viktor.tarasov 2db473a160 libopensc: export 'sc_card_find_rsa_alg'
Following proposal of Andre Zepezauer, see
http://www.opensc-project.org/pipermail/opensc-devel/2010-August/014699.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4683 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-04 20:16:54 +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
viktor.tarasov 99c51c6748 libopensc: do not invalidate card cache in sc_unlock()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4360 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-19 08:18:34 +00:00
viktor.tarasov 140f3d0d98 liopensc: fix debug message
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4283 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-03 15:44:27 +00:00
ludovic.rousseau cb5dd59d87 Use a "const char *" to store a const C-string ptr. Fix a lot (162) of
warning: initialization discards qualifiers from pointer target type

Also cast from now (const char *) to (void *) for free()


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4175 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 21:00:41 +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 d006b1845e libopensc:
- 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
2010-01-24 15:25:08 +00:00
martin f6d4da7919 PC/SC: Improve core and pinpad code
* Make opensc-tool -l display pinpad capabilities, if available
 * Detect reader capabilities when a reader is found, not when a connection to a card is opened
 * Fix unpadded PIN block parameters to not be rejected by the latest free CCID driver
 * When locking the card and it has been reset by some other application (or re-attached), clear cache and lock again
 * Enable pinpad detection by default


git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3730 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-14 09:48:56 +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
martin c64fd881e9 Mac OS X 10.5.6 fixes the ATR padding bug.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3610 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-15 20:01:09 +00:00
ludovic.rousseau c1311c8c6a card.c:756: warning: unused variable 'j'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3496 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-28 07:24:57 +00:00
martin 69742ed3a9 circumvent the 'padded with zeros' ATR bug on Mac OS X <=10.5.2
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3388 c6295689-39f2-0310-b995-f0e70906c6a9
2008-02-14 17:02:02 +00:00
aj 6882b13287 fix typo found by Gürer Özen.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3264 c6295689-39f2-0310-b995-f0e70906c6a9
2007-09-04 05:39:15 +00:00
aj 4acfe6b096 fix compiler/sparse warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3177 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 10:07:01 +00:00
aj 6e32cb6e84 improve atr masking code - also mask atr to match.
and add more debugging messages.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3108 c6295689-39f2-0310-b995-f0e70906c6a9
2007-01-09 07:22:58 +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
martin ff5f55417f Have equal number of sc_lock and sc_unlock loglines to aid debugging locking.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3064 c6295689-39f2-0310-b995-f0e70906c6a9
2006-11-28 11:54:51 +00:00
nils 88bae5c923 remove iso logout function, remove dummy logout functions and remove logout call from sc_unlock()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2971 c6295689-39f2-0310-b995-f0e70906c6a9
2006-06-17 12:24:04 +00:00
sth 50490acca0 Added support for MuscleCard applet. Thanks to Thomas Harning, David Corcoran of Identity Alliance
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2968 c6295689-39f2-0310-b995-f0e70906c6a9
2006-06-07 08:33:37 +00:00
aj ab0066b0d7 fix printf size_t problem with "%lu" and (unsigned long) cast.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2923 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-01 10:02:50 +00:00
martin 1180345d75 Threading: Reader locking can fail as well
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2878 c6295689-39f2-0310-b995-f0e70906c6a9
2006-03-24 08:06:19 +00:00
nils 8be396fee3 add function sc_reset() to reset a card; patch supplied by Josep Monés Teixidor <jmt@c3po.es>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2877 c6295689-39f2-0310-b995-f0e70906c6a9
2006-03-22 21:44:09 +00:00
martin e1ef4ec241 Remove the disconnect action from internal reader api
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2861 c6295689-39f2-0310-b995-f0e70906c6a9
2006-03-01 09:45:09 +00:00
martin 9213a29a34 Small fixes for windows compilation (Visual Studio Express 2005)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2855 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-23 11:02:24 +00:00
nils 8e77e87551 sc_mutex_destroy should have a return value
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2832 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-05 19:35:55 +00:00
nils 5c3aed1189 - remove dependence on a specific threading library
- add two new structures: sc_thread_context_t which let
  the user specify the mutex functions to use and
  sc_context_param_t to specify parameters for the sc_context_t
  creation (including mutex functions) using sc_create_context()
- add new function sc_context_create()  
- remove timestamp code from libopensc


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2829 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-01 22:59:42 +00:00
martin 670c0ee063 Rename: _get_conf_block -> sc_get_conf_block and put it into opensc.h
This way it can be used by OpenSC tokend module.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2828 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-31 15:53:44 +00:00
martin 0e9037d12f If, for some reasons, card can not be initialized (broken) then
we must make sure that we release all resources (disconnect the card).

If not we can only have 16 tries with a longrunning application (number
of contexts inside pcsclite).




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2821 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-23 18:09:37 +00:00
nils de4b5c280f - implement thread-safe path printing function sc_path_print() and use
it src/libopensc/ and src/pkcs15init/
- use size_t for the certlen parameter of sc_pkcs15init_update_certificate()


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2811 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-11 23:41:17 +00:00
nils fe3e93b625 summary: -complete rewrite of the APDU/transmission handling
code (should now support extended APDUs and is
          hopefully better documented. Note: support for
          the T0 ENVELOPE command is still missing due to
          a lack of test cards).
         -add new APDU case constants SC_APDU_CASE_2 etc.
          which let OpenSC decides, based on the card
          capabilities, whether to use short or extended
          APDUs.
         -add new capability SC_CARD_CAP_RSA_2048 for
          cards supporting 2048 bit RSA operations (note:
          this is more a preliminary hack)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2795 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-28 20:01:43 +00:00
aj 2a1c6cb87e check if scconf_find_blocks returns NULL;
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2710 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-05 21:36:26 +00:00
nils f74eaee690 fix GET RESPONSE handling
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2678 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-31 18:44:18 +00:00
nils 54046c6c1c fix warning
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2674 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-30 21:17:07 +00:00
nils 43f0118740 summary: - improve support for extended APDUs
- add experimental support for command chaining
         - simplify get_response prototype


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2673 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-30 20:37:03 +00:00
nils 6eeedc7d5f fix typo
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2641 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-09 12:00:34 +00:00
nils 75d8f0492e fix TPDU if T0 is used
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2608 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-20 22:22:31 +00:00
aj 92789b9837 undo change 2397 as it breaks openct and
you can use apd_masquerade = case4as3 instead.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2604 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-18 20:29:36 +00:00
nils 6abeaf1f1c add a new function
void sc_mem_clear(void *ptr, size_t len);
to clear a memory buffer. If OpenSSL is used this function
is a wrapper for OPENSSL_cleanse, otherwise memset is currenlty used.

Use this function to clear memory buffers with sensitive content.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2601 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-17 10:44:45 +00:00
nils 8ba443d1d9 fix parameter type
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2507 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-22 09:22:25 +00:00
martin 7ffd68a9ee Make the pcsc pinpad option work.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2503 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-21 18:44:07 +00:00
nils 69ffd496b2 the apdu error codes are unsigned => change sc_check_sw and the card ops check_sw
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2467 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-05 17:18:10 +00:00
nils b9cf818d56 in case of T0 the Le value is omitted for case 4 APDUs; patch supplied by richard.musil@bigfoot.com
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2397 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-11 21:31:48 +00:00
aj bf6808e3d8 "smart card" not "smartcard" or "SmartCard".
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2354 c6295689-39f2-0310-b995-f0e70906c6a9
2005-06-16 19:35:31 +00:00
sth 5b903845d7 Removed double line -- thx Nils
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2332 c6295689-39f2-0310-b995-f0e70906c6a9
2005-05-02 19:17:12 +00:00
sth 38b9c7e565 atr table reallocation fix by William Wanders
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2331 c6295689-39f2-0310-b995-f0e70906c6a9
2005-05-02 18:48:59 +00:00
pisi 3eec01945a copypaste ****s. Introduce a common internal function that removes several copypastes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2235 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-09 11:14:41 +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 8a8f2cd6bc - Introduce a new powerful card_atr mechanism to opensc
configuration file to handle any configuring related
  to certain card / cards using atrmask.
- Rewrite Martin's force_protocol to _sc_check_forced_protocol()
  to make it possible to share the code with other reader driver
  implementations than pcsc.
- Implement _sc_match_atr_block() to help out with force protocol
  and pkcs15 emulation layers, to find information that's not
  stored directly to sc_atr_table.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2192 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-22 07:59:42 +00:00
aet 7268799d92 - Fix a long-standing issue for user configured atrs
in the configuration file; free allocated memory
  from the card_driver structures.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2188 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-14 09:12:44 +00:00
aet df5e357694 - Whitespace cleanup from me and Martin Paljak
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2181 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-11 20:09:34 +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 8d24aa78c4 - Fix for the previous commit
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2165 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-09 14:09:27 +00:00
aet 3d9b32499a - _sc_match_atr: add support for atrmask field in sc_atr_table
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2164 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-09 14:07:36 +00:00
nils 10569f110e workaround for broken cashmouse driver
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2156 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-07 22:43:51 +00:00
aet bd0cb300f8 - Ahm, fixed a typo in the previous commit
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2146 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-06 20:14:38 +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 cbe2904889 - Introduce _sc_match_atr_hex / struct sc_atr_table_hex.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2130 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-04 15:57:38 +00:00
sth b59fb4597e Have the option add a delay before resending an APDU (after a 6CXX response). Is needed for most current belpic cards on fast readers
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2117 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-30 19:20:38 +00:00
nils 14d1f7f6a6 yet another fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2107 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-28 21:22:40 +00:00
nils 32e5d3fc81 fix lock/unlock mismatch
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2100 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-24 22:10:55 +00:00
aet 8182177a00 - Early ccid pinpad cleanups, more to follow
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2098 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-24 18:30:55 +00:00
nils 69cd0dbb76 make it configurable whether or not allow logging of sensitive apdu command data at all (to please the Belgian EID guys ;-)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2096 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-24 17:19:08 +00:00
nils a82a40e977 some cleanup + improved error checking
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2051 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-03 17:20:17 +00:00