Commit Graph

105 Commits

Author SHA1 Message Date
martin 60b4570531 * Add support for SCARD_E_NO_READERS_AVAILABLE to describe errors like:
{{{
sc.c:201:sc_detect_card_presence: returning with: Unknown error
SCardGetStatusChange failed: 8010002e
}}}
 * When doing a reset with pcsc_reconnect do a cold reset instead a warm one to allow next change
 * Change the protocol force feature to change the protocol with a hard reset only when needed to prevent:
{{{
SCardConnect failed: 8010000f
card.c:228:sc_connect_card: returning with: Unknown error
}}}



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3144 c6295689-39f2-0310-b995-f0e70906c6a9
2007-03-21 09:41:08 +00:00
ludovic.rousseau 71bef700bf use SCARD_SCOPE_USER instead of the pcsc-lite specific
SCARD_SCOPE_GLOBAL


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3116 c6295689-39f2-0310-b995-f0e70906c6a9
2007-02-06 14:17:02 +00:00
martin 83862fc356 Properly set the defaults for pcsc reader options even if no configuration file is found/available
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3101 c6295689-39f2-0310-b995-f0e70906c6a9
2007-01-05 16:36:33 +00:00
martin f747fc0c28 * Add a few debug lines
* Remove the locked status from the reader no matter what SCardEndTransaction thinks - either the card was removed or broken pcsc allowed to reset the card while in a transaction (pcsc-lite before Oct. 2006)



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3100 c6295689-39f2-0310-b995-f0e70906c6a9
2007-01-05 16:25:31 +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 7164006b44 enable APDU logging again
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3062 c6295689-39f2-0310-b995-f0e70906c6a9
2006-11-23 22:40:01 +00:00
nils aeae39f47d fix warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3035 c6295689-39f2-0310-b995-f0e70906c6a9
2006-10-01 20:52:37 +00:00
nils 1104e92bde remove check for T0 as it seems to work for T1 as well
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3016 c6295689-39f2-0310-b995-f0e70906c6a9
2006-09-17 18:34:52 +00:00
martin adc082b957 * Fix endianness for PCSCv2 part 10 IOCTLs
* Add support for start/finish style IOCTLs
 * Add support for the same pinpad functionality on windows
 
Some code from Robert Konklewski and Ludovic Rousseau
 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3007 c6295689-39f2-0310-b995-f0e70906c6a9
2006-08-16 16:36:00 +00:00
ludovic.rousseau 1c56f74b6c pcsc_connect(): use an explicit debug message if the reader supports PIN
verification/modification but that feature is not enabled in opensc.conf
(enable_pinpad = true)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2954 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-17 09:07:17 +00:00
ludovic.rousseau 2b4e6a5e98 fix a memory leak that occurs when the APDU exchange fails
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2919 c6295689-39f2-0310-b995-f0e70906c6a9
2006-04-27 20:44:24 +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
nils 383602b6fe - move logging to the reader driver
- log APDUs only if DEBUG is defined (sensitive APDUs should
  never be logged and we cannot know whether a APDU is sensitive
  or not => enable APDU logging only in a non-production debug
  build)
- remove OPENSC_DONT_LOG_SENSITIVE configure option as it's 
  needed anymore 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2868 c6295689-39f2-0310-b995-f0e70906c6a9
2006-03-03 22:56:41 +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 aa5d081c3a * Also delete .pdb files on windows when doing a clean
* Call directly internal pcsc transmit method for pcsc pinpad calls.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2850 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-17 11:22:21 +00:00
nils ca2a5e11fd - move APDU encoding to the reader layer
- remove APDU masquerading code, it shouldn't be necessary
  anymore


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2831 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-05 19:00:01 +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
nils 6a5c6b2217 fix warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2797 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-28 20:15:32 +00:00
martin 0548ceb618 If SCardControl fails there's nothing bad going on - just there's no support for this feature.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2791 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-27 13:41:23 +00:00
nils 3ac1f94d2b use unsigned int instead of uint16_t
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2686 c6295689-39f2-0310-b995-f0e70906c6a9
2005-11-25 19:11:09 +00:00
martin 89cfac8735 Update pcsc pinpad code to latest pcsc-lite code, limit to pcsc-lite only.
Verify works fine, modify needs some debugging-testing.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2668 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-29 21:17:15 +00:00
aj 8fb4d9fc4c Better name, as suggested by Ludovic.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2632 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-06 06:57:07 +00:00
aj 163176fd45 __APPLE__ does not need special handly. Only the broken pcsc-lite shipped
in mac os X does, so use define set by configure on mac os X, if the
default pcsc is used, but not if a self compiled is used.

teach configure new getopt source file names.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2631 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-05 15:25:27 +00:00
nils 47d2baf5a3 use calloc instead of malloc + memset
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2600 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-17 09:40:12 +00:00
nils 59cae4140b fix compiler warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2585 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-12 21:09:12 +00:00
martin 8596348a75 * Get rid of reset card error that comes from pcsc only and deal with reset situations with SCardReconnect
* Add some options to control pcsc behavior.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2553 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-08 11:35:26 +00:00
nils f6c95792fe let src/libopensc/ compile with -Wall -W -Wno-unused-parameter -Werror
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2546 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-07 08:33:55 +00:00
martin d744a6e5f5 Include reader.h if found.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2537 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-05 11:29:57 +00:00
nils 0d7b025a4b add missing variable
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2504 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-22 09:15:57 +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
martin 59e1f37bb2 * Clean up some whitespace
* class2->part10
 * Make pinpad detection a configurable option  


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2485 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-13 13:26:46 +00:00
martin 3eb0a0a9eb Log in hex format of course...
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2360 c6295689-39f2-0310-b995-f0e70906c6a9
2005-06-27 10:08:29 +00:00
sth e725239e9c Fix: if a card is inserted, the SC_SLOT_CARD_CHANGED flag must be set
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2357 c6295689-39f2-0310-b995-f0e70906c6a9
2005-06-17 15:47:28 +00:00
martin 030d58d7ca It is plain wrong to call again pcsc layer locking methods as card.c:sc_lock()
already does it when somebody goes to the card the very first time and thus
begins a transaction. iso7816.c methods should lock the card in
iso7816_pin_cmd() on card level if anything.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2348 c6295689-39f2-0310-b995-f0e70906c6a9
2005-06-07 14:31:09 +00:00
martin 489518b26a Small fixes in the teletrust spec support code and related NEWS item
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2300 c6295689-39f2-0310-b995-f0e70906c6a9
2005-04-07 19:45:39 +00:00
martin 1139181493 * fix an return code from ctbcs spec
* make sure pins and puk are correctly associated in esteid emu


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2277 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-24 16:54:10 +00:00
aj f5b2845340 silence a few warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2274 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-23 23:24:13 +00:00
pisi 295fe6138d Introduce TeleTrust Class 2 spec compliant pinpad functionality and
incorporate the pinpad functions directly to reader-pcsc.c. Mainly because
the code requires access to internal pcsc-only structures and splitting
some definitions to an extra header would not be very nice. Also, the API
is pcsc based and usable with other ifdhandlers too, not just CCID.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2238 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-09 12:44:31 +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
pisi 1463b324b3 consistent naming and trimmed lines
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2229 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-04 01:41:39 +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 0b773d6612 - Cleanup
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2154 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-07 11:40:58 +00:00
aet 986724c1ad - Build fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2110 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-29 10:44:07 +00:00
sth 7ea47a2bba Windows fix: SCARD_CTL_CODE is already #defined in a Windows header
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2105 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-28 20:39:47 +00:00
aet 622607a68c - Build fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2102 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-25 11:45:47 +00:00
aet 5a5c6d165e - Add use_ccid_pin_cmd boolean to opensc.conf, for now.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2101 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-25 11:11:13 +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 3158fa3e05 merge Martin Paljak's ccid pinpad changes from the OPENSC_0_9 branch to the cvs head
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2095 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-24 11:31:11 +00:00
nils 8a0fc5bdcf fix indent, patch supplied by Martin Paljak
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2082 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-19 16:17:32 +00:00
nils 8446dc7cec fix compiler warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2031 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-21 13:22:10 +00:00