Commit Graph

218 Commits

Author SHA1 Message Date
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
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
okir b2074743b2 - reduced sc_lock/unlock debug messages even more
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1677 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-16 14:31:12 +00:00
okir c072c5e0fe - added sc_get_data/sc_put_data
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1578 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-30 17:03:41 +00:00
okir 734bceb682 - Error logging changes: replace ctx->log_errors with ctx->suppress_errors,
so that we can nest error suppression using suppress_errors++/suppress_errors--


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1518 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-14 09:56:50 +00:00
okir efb19cafe6 - slightly enhanced debugging output
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1504 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-13 14:34:38 +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
okir 8fcab2199b - slightly improved debugging output
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1399 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-29 12:55:17 +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 9f065e840f - suppress stupid debug messages for sc_lock/sc_unlock for debug level < 7
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1349 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-11 13:56:07 +00:00
okir 7fc4ad2db0 - fixed error message
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1322 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-31 19:06:43 +00:00
sth df89427bfb Bug fix: let sc_transmit_apdu() returns a negative number or 0 (no positive number)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1248 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-11 09:40:49 +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 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
okir f4d1147224 - change debug level for sc_lock/unlock
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1156 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-22 19:34:45 +00:00
okir 296a9cc54b - fixed the hang with logout()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1155 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-22 13:59:25 +00:00
sth fc31b65a88 added sc_logout() functionality
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1153 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-20 08:30:46 +00:00
okir b68cb1e0b3 - added sc_free_apps to undo sc_enum_apps
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1122 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-15 13:32:17 +00:00
jey b0d4f06703 - Renamed card->chopsize to max_le, which is more descriptive
- Changed a few checks to asserts


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1078 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-28 16:34:38 +00:00
aj c6efa1e9a1 create card->chopsize, init it with SC_APDU_CHOP_SIZE,
allow cards to change that value, and add code to
starcos_init to set chopsize to 80.

chopsize is used with read_binary and friends to chop
the data into small requests, read/write them, and reassemble.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1074 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-27 19:08:23 +00:00
okir 44995d388d - don't complain about read/write/update binary with a length of 0
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1015 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-16 10:19:20 +00:00
okir 91b7b3c7a6 - suppress "not supported" error messages from sc_card_ctl
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1004 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-14 08:17:53 +00:00
okir fabb271b6d - fix sc_transmit_apdu to properly deal with le=00
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@978 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-03 18:19:22 +00:00
sth faa73e5827 bug fix in sc_connect_card: only the first ATR in a config file was accepted
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@940 c6295689-39f2-0310-b995-f0e70906c6a9
2003-03-04 15:47:05 +00:00
sth 0529d27e3f buf fix in sc_connect_card
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@928 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-22 21:27:35 +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
okir baf8393a8a - merged mutex patches from Serge Koganovitsch (Zetes)
- created new file portability.c and moved the whole mutex stuff
  there (so we don't pollute public header files with #ifdef HAVE_XXX anymore)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@858 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-14 11:22:33 +00:00
okir 9acca0e724 - Implemented new PIN verify/change/unblock framework. All PIN operations
are routed through sc_pin_cmd(), which builds the APDU and either passes
  it to the card directly, or to the card reader along with a request to
  read the PIN(s) from the reader's keypad.

  Currently, entering PIN in the standard way (i.e. via the application)
  should still work - I have verified GPK and eToken; Cryptoflex verify
  should work as well. Anything else needs additional testing, and support
  for keypad input in particular (I cannot test this at the moment for
  lack of a suitable reader).


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@811 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-23 18:47:27 +00:00
okir 4c28f0dad8 - prevent buffer overflow
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@802 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-20 14:55:17 +00:00
okir d635d53771 - support ATR maps in /etc/opensc.conf, e.g.
card_driver flex {
		atr = 11:22:33:44;
		atr = 55:66:77:88;
	}


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@738 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-03 15:40:40 +00:00
jey 5d70c9090a - Renamed sc_transceive_t0 to sc_transceive to avoid confusion =)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@656 c6295689-39f2-0310-b995-f0e70906c6a9
2002-06-16 21:19:37 +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 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
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 6e0b7dea2c - Divided errors into different groups, added new ones
and renamed some
- Moved sc_strerror() to errors.c
- Added a 'sensitive' flag to struct sc_apdu


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@479 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-06 12:02:28 +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 3fa7a056f1 - Fixed a couple of memory leaks
- Fixed a bug in decoding EF(TokenInfo)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@344 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-19 10:04:11 +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
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
okir 4f0ce4228a - in sc_select_file, remember the file path in the returned struct sc_file
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@266 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-06 13:22:08 +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
jey d2a36c88fd - added sc_update_binary(), sc_append_binary() and
sc_write_binary() with their corresponding ISO 7816-4
  reference functions


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@216 c6295689-39f2-0310-b995-f0e70906c6a9
2002-02-21 19:23:21 +00:00
jey e78dc96440 - added ATR for RSA SecurID 3100
- exported pkcs15_encode_* functions
- minor modification to sc_file_add_acl_entry()
- boosted up opensc-explorer
- added error(), warn() and fatal()
- implemented a generic PKCS #15 structure generation tool


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@215 c6295689-39f2-0310-b995-f0e70906c6a9
2002-02-21 18:53:23 +00:00
jey 61fc1f9327 - all instances struct sc_file should now be
dynamically allocated with sc_file_new() and released
  with sc_file_free()
- improved ACL's
- moved struct sc_card_error to opensc.h
- moved EF(DIR) parsing and encoding to dir.c
  (encoding is not working yet)
- removed hst-test.c and filetest.c


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@213 c6295689-39f2-0310-b995-f0e70906c6a9
2002-02-20 09:56:47 +00:00
jey 262e5c2083 - added error reporting for several new SWs
- added check_sw function to sc_card_operations


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@211 c6295689-39f2-0310-b995-f0e70906c6a9
2002-02-15 23:17:58 +00:00
jey 709727d469 - added partial support for TCOS 2.0 cards
- default card driver now tries to do a GET RESPONSE
  instead of SELECT FILE to detect the correct
  CLA byte
- moved security attribute parsing from iso7816.c to card-setec.c
- added some more sanity checking to sc_check_apdu
- added 'debug' command line option to opensc-explorer


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@210 c6295689-39f2-0310-b995-f0e70906c6a9
2002-02-11 15:55:34 +00:00
jey 1fb23e7623 - added support for T=1 protocol
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@201 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-28 21:04:53 +00:00
jey f1582007f6 - improved file selection on Cryptoflex cards
- fixed an incompatability in PKCS #11 module


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@178 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-21 09:05:22 +00:00
jey d9792242cc - fixed a bug with file permissions in flex_create_file()
- added RSA signature generation with Cryptoflex cards
- improved security environment handling
- implemented cryptoflex-tool


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@177 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-20 21:20:09 +00:00
jey 54e5d23e93 - improved PKCS #15 generation
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@170 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-17 11:44:27 +00:00
jey 452b9d4193 - pretty much finished the DER encoder
- added delete and create file support for 'flex cards
- PKCS #15 DF's are now stored more flexibly; this makes
  adding new types of DF's (such as PuKDF's) easier
- added 'get' and 'put' commands to opensc-explorer


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@160 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-13 23:56:13 +00:00
jey 5c993e1136 - added PIN verification, file creation and file deletion to
opensc-explorer
- documented the core API a bit using doxygen


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@158 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-10 23:02:48 +00:00
jey 9dc7054919 - added preliminary ASN.1 encoding support
- modified ASN.1 decoding to make it easier to
  port decoder structures to the encoder
- fixed a recently introduced bug in card driver handling
- opensc-explorer will now allow only DF's to be cd'd into


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@156 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-10 12:33:56 +00:00
jey 269df3a6da - created opensc-explorer tool
- increased support for CryptoFlex cards


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@152 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-09 01:03:10 +00:00
jey 7ff4c4544c - added preliminary CryptoFlex 16k support
- added short names to card drivers
- moved various ISO 7816-9 functions to their correct places
- added write binary support
- renamed opensc-crypt to pkcs15-crypt
- split a part opensc-tool to pkcs15-tool


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@150 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-08 13:56:50 +00:00
jey 9197babe53 - renamed sc_asn1_parse to sc_asn1_decode
- added capabilities and flags fields to struct sc_card
- added a mutex to sc_context for future use


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@148 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-07 18:23:34 +00:00
aet a327209319 SCardGetStatusChange/rgReaderStates changes for compatibility
with older and/or modified pcsc-lite releases.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@135 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-05 19:01:55 +00:00
jey ad2e34cb6c - added preliminary support for EMV cards
- changed a few function prototypes
- implemented access control lists to files
- added sc_read_record() function
- updated the NEWS file


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@111 c6295689-39f2-0310-b995-f0e70906c6a9
2001-12-29 02:07:32 +00:00
jey 2b99f2df14 - added default driver for unidentified cards
- added select_file operation in Multiflex driver
- added 'list-drivers' command to opensc-tool
- moved stuff from opensc.h to sc-internal.h
- improved locking behaviour


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@106 c6295689-39f2-0310-b995-f0e70906c6a9
2001-12-25 20:45:48 +00:00
jey 9905a8dd8e - changed call convention of sc_select_file()
- begun to add support for Multiflex cards


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@100 c6295689-39f2-0310-b995-f0e70906c6a9
2001-12-22 23:51:12 +00:00
jey c344e28a92 - added card abstraction layer support
- pretty much finished migrating to new ASN.1 code
- changed call semantics for sc_select_file()
- moved functions around


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@89 c6295689-39f2-0310-b995-f0e70906c6a9
2001-12-22 20:43:09 +00:00