Commit Graph

113 Commits

Author SHA1 Message Date
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
nils 4bb760db4d cleanup
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1960 c6295689-39f2-0310-b995-f0e70906c6a9
2004-10-29 20:08:54 +00:00
nils 3d64764d4d fix int vs. size_t mismatch
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1926 c6295689-39f2-0310-b995-f0e70906c6a9
2004-10-13 18:54:06 +00:00
nils f044157553 fix incorrect use of realloc (x = realloc(x, y) doesn't free
the x in case of a failure)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1775 c6295689-39f2-0310-b995-f0e70906c6a9
2004-04-21 18:10:58 +00:00
okir 09b2730497 - implement sc_delete_record (Victor Tarasov)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1708 c6295689-39f2-0310-b995-f0e70906c6a9
2004-01-06 13:33:32 +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