Commit Graph

198 Commits

Author SHA1 Message Date
Frank Morgner a906c6d7b8 Merge pull request #530 from NWilson/yubikey-neo-pin
Yubikey NEO pin functions support
2015-09-12 18:51:10 +02:00
Frank Morgner 2d9802308f reactivate handling of `0` for max_recv/send_size
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
2015-08-26 02:55:35 +02:00
Nicholas Wilson 5a11d0e2fd Add support for C_GetTokenInfo pin status flags for ISO7816 cards
This is already supported for a couple of the card drivers, but
since it's a general feature of ISO7816 it should go in iso7816.c,
rather than the current situation where identical code for this is
copy and pasted in each driver.

However, some cards apparently don't support this feature and count
it as a failed PIN attempt, so I've added a flag for now to indicate
whether the card supports this feature. It future, it could be moved
to blacklist cards rather than whitelist them, subject to more testing.
2015-08-25 15:53:27 +01:00
Frank Morgner 85b79a3332 don't always overwrite max_send_size/max_recv_size
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.
2015-08-11 23:08:41 +02:00
Frank Morgner f71ef838e9 implemented get_data for iso7816
mostly copied over from CardOS implementation
2015-07-30 08:18:07 +02:00
Andreas Kemnade a09ca246a7 libopensc: initialize value returned by sc_select_file
several places in the code expect sc_select_file to set *file_out to NULL
in case of failure. Adjust the function to behave like this.

Fixes #460
2015-05-13 10:19:38 +02:00
vletoux 492ffe0fd7 iso7816.c: allow file length stored in more than 2 bytes
as indicated in iso7816-4 chapter 7.4.3 table 10

Fixes #459
2015-05-13 10:01:29 +02:00
vletoux 1586f240f4 iso7816.c: fix SC_PIN_CMD_IMPLICIT_CHANGE with pinpad
When a pinpad is used, the old pin is asked whatever, even if a previous authentication happenened or if the card doesn't support it.
2015-05-05 09:56:39 +02:00
Dirk-Willem van Gulik 88ec461bc5 tool: RFC4716 compliant key output
Add a comment field to the ssh key output if a label is set on the key. Add RFC4716 compliant key output for the new breed of modern (mobile) SSH clients.

VTA: use short form of log call in iso7816
2015-03-31 19:09:25 +02:00
Frank Morgner 0790969b97 recognize short EF identifier 2015-03-31 18:48:57 +02:00
Viktor Tarasov 3c1d8ad695 accept no output for 'SELECT' MF and 'SELECT' DF_NAME
PR #342
2015-02-07 21:46:44 +01:00
Frank Morgner bd3cfcf5ef fixed copy/paste error 2015-01-28 07:26:34 +01:00
Frank Morgner 45fe96579f added support for sc_path_t with only aid set 2014-12-12 21:45:53 +01:00
Frank Morgner e1fbdc030b iso7816: make select agnosting to sc_path_t's aid 2014-12-12 21:45:52 +01:00
Frank Morgner 3f442c5608 adjust send/receive size accoriding to card capabilities 2014-11-17 21:16:13 +01:00
Frank Morgner 87d430f300 iso7816: propagate the length of the computed signature 2014-08-26 21:21:26 +02:00
Frank Morgner bb92019e53 iso7816: allow extended length APDUs 2014-06-27 08:26:35 +02:00
Frank Morgner 3d0064e983 don't expect the card to specify the file length in generic tools
if sc_file_t.size == 0 we try to read 1024 bytes by default.
2013-09-29 18:52:48 +02:00
Frank Morgner ff637bd02a initialize sm_ctx with 0s for iso7816 driver 2013-08-02 11:41:29 +02:00
Dirk-Willem van Gulik b23060526c Allow for the pin to be entered on the keypad during issuing. For compliance reasons. 2013-04-28 18:56:51 +02:00
Martin Paljak 9901682288 Normalize SC_ERROR_* API and clean up ISO7816-4 errors.
* iso7816_check_sw() emits a "informational message" (from ISO7816-4 table 6)
 * SW-s which are not known or not meaningful for internal API get translated
   to SC_ERROR_CARD_CMD_FAILED by default, so use it also in the SW table
 * Remove undefined SW-s and move generic SW-s to their sequential location.

This commit improves 8fc679bf40
2013-03-15 12:30:38 +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 5140c4a1f1 libopensc: use short form of the debug message calls 2013-02-24 19:37:35 +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
Andreas Schwier ffb20e5916 sc-hsm: Added sc-hsm-tool with DKEK support and key wrap / unwrap 2012-11-11 12:53:03 +01:00
Frank Morgner 4d9ea43ab2 iso driver: select with p2=0x0c when le is missing 2012-05-03 12:58:45 +02:00
Peter Marschall 931e913599 iso7816.c: clean up iso7816_restore_security_env()
No need for response buffers for APDUs of the APDU_CASE_1 type.

This should fix OpenSC Ticket #299.
2011-09-09 13:42:52 +02:00
Peter Marschall 93816b37cd iso7816.c: slightly clean up iso7816_delete_file()
Only set the APDU's data element for the APDU_CASE3_SHORT type;
no need to do it for the APDU_CASE_1 type.
2011-09-09 13:42:52 +02:00
andre 93baf137c3 libopensc: Fix for drivers returning an error if a challenge of length zero was requested. Actually nothing is done when obtaining such a challenge, thus nothing could fail.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5564 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-09 10:59:04 +00:00
vtarasov 36a85ffe5b iso7816: resolve problem 'r5237 breaks support for Belgian eID', thanks to Jean-Pierre.
http://www.opensc-project.org/pipermail/opensc-devel/2011-May/016703.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5538 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-02 17:28:37 +00:00
vtarasov 8098e82b16 libopensc: in 'READ BINARY' ignore the 'FILE_END_REACHED' error ...
see discussion
http://www.opensc-project.org/pipermail/opensc-devel/2011-April/016413.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5405 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-27 14:37:57 +00:00
vtarasov a55f2f098b iso7816: try to read full amount of the requested data ...
actually, if an error 'Wrong Le' happens, the APDU with the reduced size is re-transmitted
(http://www.opensc-project.org/opensc/browser/trunk/src/libopensc/apdu.c#L401) .
iso7816_read_binary() returns this reduced amount of data and do not trying to read the missing part .


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5237 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-15 12:18:51 +00:00
vtarasov 4ab8018781 iso7816: use already defined local variable 'ctx' instead of 'card->ctx'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5073 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 10:42:40 +00:00
martin 2d5c76d3d1 iso7816: Don't translate a returned FCP template from SELECT FILE to "unknown data received"
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5071 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 10:17:08 +00:00
vtarasov ca382fd93b iso7816: accept 'FCP' tag when processing FCI
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5062 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 08:28:38 +00:00
andre 50567141f0 Rename of SC_NO_ERROR to SC_SUCCESS.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4954 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-16 05:04:37 +00:00
andre 2eca7061b4 iso7816.c: Fixes #301.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4945 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-14 01:09:44 +00:00
martin 5d9c02b197 ISO 7816: if decrypting with 2048 keys, non-extended APDU cards require command chaining (Lc would be 257, which is 2 bytes over 255 limit)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4895 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-29 14:22:15 +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
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 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 0fe106e53a libopensc: in a supplement to r4668
Use 'max_recv_size' when building APDU for 'select file'


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4682 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-04 20:08:52 +00:00
ep fbf1d621cb Remove unused give_random operation
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4677 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-02 22:58:34 +00:00
ep 5990d26f80 If a FCI features tag 84h, then the file is a DF
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4639 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-21 20:12:53 +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
ep 71cdef0ed2 New card driver: Italian CNS/CIE (eID)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4627 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-16 00:56:27 +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
viktor.tarasov 5e805ecf2d libopensc: in iso7816 process_fci() decode Life Cycle Status byte (ISO 7816-4 2005, 5.3.3, tag '8A')
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3961 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-29 10:54:51 +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 cd9e666926 SC_ERROR_MEMORY_FAILURE signals EEPROM failures on card. Failures to allocate memory on host result in SC_ERROR_OUT_OF_MEMORY.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3927 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-24 12:38:34 +00:00
martin 612d66655d Introduce SC_ERROR_NOT_ENOUGH_MEMORY <=> CKR_DEVICE_MEMORY.
When trying to import a too large keyfile as a data object, TrueCrypt received a CKR_GENERAL_ERROR before this.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3926 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-23 19:12:52 +00:00
martin 64f9578202 apdu.sensitive is not in use since [2868]
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3751 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-03 09:31:07 +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 3cf4707b1a Aktiv Co. / Aleksey Samsonov:
Remove dead code.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3704 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-28 07:23:16 +00:00
aj 2a0b63e0ad Aktiv Co. / Aleksey Samsonov:
Add assert() calls to check constant buffer size.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3703 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-28 07:22:24 +00:00
aj 25ab286fed Aktiv Co. / Aleksey Samsonov:
Check buffer length (*outlen)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3702 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-28 07:20:37 +00:00
aj 7d282a9e0e Aktiv Co. / Aleksey Samsonov:
Fix for the case when "apdu.resplen < 2" and checked buffer length.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3701 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-28 07:19:38 +00:00
aj 265eb5923b Aktiv Co. / Aleksey Samsonov: fix case depending on length.
also no need to null resplen or le (done by sc_format_apdu).


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3700 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-28 07:17:19 +00:00
ludovic.rousseau c44b7cbbeb iso7816_set_security_env(): correctly set P1 parameter in case of
SC_SEC_OPERATION_DECIPHER

Thanks to Aleksey Samsonov for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2009-June/012263.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3698 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-25 08:45:05 +00:00
martin 1e41d4d267 * Fix issues with pkcs11-tool testing of C_GenerateRandom/C_SeedRandom and OpenSC PKCS#11 implementation of those functions.
Thanks goes to Rickard Bondesson who noticed the issues.

http://www.opensc-project.org/pipermail/opensc-devel/2008-November/011436.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3595 c6295689-39f2-0310-b995-f0e70906c6a9
2008-11-24 22:06:27 +00:00
vtarasov 0d0048e5ad introduce SC_PATH_TYPE_FROM_CURRENT and SC_PATH_TYPE_PARENT path types
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3094 c6295689-39f2-0310-b995-f0e70906c6a9
2007-01-02 10:04:35 +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 0199dfa29b use net size if available
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3076 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-18 11:22:22 +00:00
nils 9be468b3a8 try to read at most max_recv_size bytes in GET RESPONSE
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3060 c6295689-39f2-0310-b995-f0e70906c6a9
2006-11-21 22:10:11 +00:00
nils 28c6c1ebc1 git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3057 c6295689-39f2-0310-b995-f0e70906c6a9 2006-11-12 21:01:01 +00:00
nils 651d2c554d remove useless code
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3055 c6295689-39f2-0310-b995-f0e70906c6a9
2006-11-11 11:46:36 +00:00
vtarasov 2d4bd463b0 Use do {...} while(0) construction for SC_TEST_RET, SC_FUNC_RETURN and SC_FUNC_CALLED defines
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3050 c6295689-39f2-0310-b995-f0e70906c6a9
2006-11-06 11:15:09 +00:00
nils 7c823d89ca fix warning
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3034 c6295689-39f2-0310-b995-f0e70906c6a9
2006-10-01 20:39:53 +00:00
ludovic.rousseau 45fc350513 iso7816_process_fci(): dump the filename in Hex + ASCII instead of just
ASCII in the debug log


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3031 c6295689-39f2-0310-b995-f0e70906c6a9
2006-09-27 12:01:31 +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
nils 83c7dc9045 return an error if offset is too large
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2881 c6295689-39f2-0310-b995-f0e70906c6a9
2006-04-03 10:42:00 +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
martin e1d7384e8a If there's less data ina file/record than requested do not fail but return as much data as was available. This behaviour is similar to read(2).
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2792 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-27 14:11:35 +00:00
aj d7b6abaef5 add proper free to error path.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2712 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-05 21:37:34 +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 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 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 142d18378b don't use static buffer in iso7816_build_pin_apdu
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2598 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-17 08:20:13 +00:00
nils 2fb54dd374 use compile time initialization for the iso_ops structure
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2501 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-20 13:39:18 +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
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 94d899931e cleanup
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2455 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-02 21:13:06 +00:00
nils eddd1e3ab6 fix file descriptor byte and ef_structure type; patch supplied by richard.musil@bigfoot.com
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2396 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-11 21:28:55 +00:00
sth 6102459d13 Allow an empty path in iso7816_delete_file(), to indicate that the current DF should be deleted.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2281 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-26 19:47:13 +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 5e552bddc1 starcos: use iso decipher, iso7816: set le to 256 == 0x00
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2072 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-13 20:28:57 +00:00
nils e7a0b8f4eb cleanup: declare local functions as static, renamed shadowed variables etc.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2012 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-15 09:35:30 +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
okir 1648a1cdea - SW 6A88 (referenced data not found) is now translated to
SC_ERROR_DATA_OBJECT_NOT_FOUND


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1620 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-20 15:38:43 +00:00
okir 70597d4b14 - fixed change/unblock pin with implicit test
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1547 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-21 08:59:11 +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
aet 3e1dd82f4f Remove some compiler warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1332 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-05 17:28:29 +00:00
sth 0b1a65cd81 Added struct sc_card to process_fci(), just like it's done with the orhter card operations
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1311 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-28 13:19:49 +00:00
sth 06d4311e80 Made the construct_fci() a card operaton, just like it has been done with process_fci() before
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1291 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-23 14:31:21 +00:00
sth 0a05d8340c Have process_fci() as a card operation instead of being called internally by iso7816_select_file(). This way card drivers can implement a select_file() and process_fci() independently
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1263 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-14 17:39:19 +00:00
sth 4737789ede Implemented the get_response card operation, is now explicitely called by sc_transmit_apdu()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1246 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-10 11:38:02 +00:00
okir 127f94ad37 - added pinpad support for OpenCT
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1215 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-23 12:56:36 +00:00
okir 7021fcb5a5 - iso7816_logout now invalidates the path cache
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1204 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-15 12:56:07 +00:00