Commit Graph

69 Commits

Author SHA1 Message Date
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
okir 6575a4adbf - iso7816_logout should call driver specific select_file function, not the iso7816 generic version
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1186 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-10 06:31:48 +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
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
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
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 144bb23a7c - fixed minor pin pad bug
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@841 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-06 19:37:37 +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 fe27ed651e - fixed deciphering (apdu.le was not set)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@692 c6295689-39f2-0310-b995-f0e70906c6a9
2002-10-02 10:49:07 +00:00
jey 00a2a0defd - Brown paper-bag fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@684 c6295689-39f2-0310-b995-f0e70906c6a9
2002-08-21 10:16:42 +00:00
jey 82fabceeae - Added some new error codes to sc_iso7816_check_sw()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@680 c6295689-39f2-0310-b995-f0e70906c6a9
2002-08-21 10:06:59 +00:00
jey 523b680f32 - Fix apdu->le in sc_compute_signature()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@653 c6295689-39f2-0310-b995-f0e70906c6a9
2002-06-14 12:29:19 +00:00
okir 85aeed256f - changed APDU base from 3 to 4 on sign/decipher
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@647 c6295689-39f2-0310-b995-f0e70906c6a9
2002-06-13 11:18:31 +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
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
okir 5d8b1000ca - eToken patches from Markus Friedl
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@546 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-17 13:36:35 +00:00
jey 87e27b00a4 - Changed an error code as per Andreas' suggestion
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@511 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-10 23:00:38 +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
jey 7ddcb3d692 - sec_attr and prop_attr are now dynamically allocated in
struct sc_file


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@404 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-28 14:13:36 +00:00
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
okir 6ca0cb108c - moved sc_decipher implementation to iso7816.c
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@326 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-15 09:42:07 +00:00
jey 23e956cf9b - Fixed PKCS #15 structure generation on Cryptoflex cards
and implemented a default profile
- Cryptoflex now reports its supported PK algorithms
  correctly
- Various pkcs15-init fixes


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@295 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-12 13:00:57 +00:00
jey 04dfc47d92 - added a driver for MioCOS cards by Miotec
- implemented EF(DIR) updating


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