Commit Graph

220 Commits

Author SHA1 Message Date
martin 5a7515cd7f Recognize SCARD_E_NO_SERIVCE:
{{{
$ /Library/OpenSC/bin/opensc-tool -a
[opensc-tool] reader-pcsc.c:881:pcsc_detect_readers: SCardEstablishContext failed: 0x8010001d
[opensc-tool] reader-pcsc.c:990:pcsc_detect_readers: returning with: Unknown error
No smart card readers found.
}}}


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3625 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-18 23:16:53 +00:00
martin 315c0edc6e PC/SC readers have always only one slot per reader.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3615 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-15 21:40:44 +00:00
martin 2e2a998f10 Remove some unused/prehistoric defines.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3614 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-15 21:23:09 +00:00
alonbl 4ad85b3d91 Add some more debug information to pcsc
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3589 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-26 19:13:14 +00:00
ludovic.rousseau d2f428590b use 0x%08lx instead of 0x08%lx
Thanks to Alon Bar-Lev for the patch


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3587 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-20 15:04:29 +00:00
ludovic.rousseau 4a1e1192a6 display PC/SC error codes as 0x08%lx instead of %lx to make it explicit
they are hex values


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3586 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-20 07:46:24 +00:00
ludovic.rousseau b4c5c8d539 use SCARD_S_SUCCESS instead of 0
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3585 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-20 07:27:41 +00:00
alonbl 4fc6c498ed Make PC/SC work on Windows again
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3535 c6295689-39f2-0310-b995-f0e70906c6a9
2008-07-02 09:55:32 +00:00
ludovic.rousseau 99a16c66db remove two unused variables
reader-pcsc.c:739: warning: unused variable 'rv'
reader-pcsc.c:862: warning: unused variable 'again'


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3520 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-22 12:23:25 +00:00
ludovic.rousseau ca2da1bd67 Avoid variable name space collision
reader-pcsc.c:396: warning: declaration of 'priv' shadows a previous local
reader-pcsc.c:367: warning: shadowed declaration is here
reader-pcsc.c:909: warning: declaration of 'reader' shadows a previous local
reader-pcsc.c:901: warning: shadowed declaration is here 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3519 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-22 12:22:23 +00:00
alonbl e237574742 Plug&Play support
This is not the best solution, but focus on smallest code change.

Changes:

1. Add detect_readers() to reader opts, this adds new readers to the end
   of the readers list until list is full.

2. Add sc_ctx_detect_readers() that calls readers' detect_readers().

3. Fixup pcsc_lock() so that it reconnect to the card and report proper
   error so caller may be notified if session was lost.

4. Allow context to be created without readers.

5. Call sc_ctx_detect_readers() from PKCS#11 C_GetSlotList with NULL_PTR.

6. Allow no reader at detect_card, as reader my be removed.

7. Since I broke ABI, I updated the external module version requirement
   to match OpenSC version. In the future a separate version should be
   maintained for each interface, this should be unrelated to the package
   version.

Alon

---

svn merge -r 3480:3505 https://www.opensc-project.org/svn/opensc/branches/alonbl/pnp

M    src/tools/opensc-tool.c
M    src/pkcs11/pkcs11-global.c
M    src/pkcs11/slot.c
M    src/libopensc/reader-pcsc.c
M    src/libopensc/internal-winscard.h
M    src/libopensc/ctx.c
M    src/libopensc/reader-ctapi.c
M    src/libopensc/libopensc.exports
M    src/libopensc/reader-openct.c
M    src/libopensc/opensc.h


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3506 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-29 17:01:19 +00:00
ludovic.rousseau e928d5565c convert C++ in C comment
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3502 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-28 07:57:03 +00:00
alonbl 0e2c664d34 Rename PC/SC library into PC/SC provider.
Sync symbols between configuration and source.
Put default provider in opensc.conf, opensc-tool.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3455 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-02 05:44:12 +00:00
alonbl 0a809dd5cb Complete rewrite of OpenSC build system.
1.  Build system now supports MinGW (Windows) compilation using msys and cross compilation.
2.  Ability to explicitly disable and enable dependencies of the package.
3.  openct, pcsc and nsplugins features are disabled by default.
4.  Modified pcsc driver to use pcsc dynamically, no compile time dependency is required.
5.  --enable-pcsc-lite configuration option renamed to --enable-pcsc.
6.  Install opensc.conf file (as opensc.conf.new if opensc.conf exists).
7.  Add--enable-doc configuration option, allow installing documentation into target.
8.  Add --disable-man configuration option, allow msys mingw32 users to
    build from svn without extra dependencies.
9.  Add export files to each library in order to export only required symbols.
    Windows native build may use these files instead of scanning objects' symbols.
10. Add opensc-tool --info to display some general information about the build.
11. Create compatibility library to be linked against library instread of recompiling the
    same source files in different places.
12. Add different win32 version resource to each class of outputs.
13. Make xsl-stylesheets location selectable.
14. Some win32 fixups.
15. Some warning fixups.
16. Many other autoconf/automake cleanups.

Alon Bar-Lev

svn diff -r 3315:3399 https://www.opensc-project.org/svn/opensc/branches/alonbl/mingw

_M   .
D    configure.in
_M   src
_M   src/openssh
M    src/openssh/Makefile.am
_M   src/tools
M    src/tools/rutoken-tool.c
M    src/tools/opensc-tool.c
M    src/tools/cardos-info.c
M    src/tools/pkcs15-crypt.c
M    src/tools/pkcs15-init.c
M    src/tools/piv-tool.c
M    src/tools/netkey-tool.c
M    src/tools/eidenv.c
M    src/tools/cryptoflex-tool.c
M    src/tools/util.c
M    src/tools/pkcs11-tool.c
M    src/tools/pkcs15-tool.c
M    src/tools/util.h
M    src/tools/opensc-explorer.c
M    src/tools/Makefile.am
_M   src/pkcs11
M    src/pkcs11/pkcs11-global.c
M    src/pkcs11/framework-pkcs15.c
M    src/pkcs11/mechanism.c
M    src/pkcs11/pkcs11-display.c
M    src/pkcs11/pkcs11-object.c
A    src/pkcs11/opensc-pkcs11.exports
M    src/pkcs11/sc-pkcs11.h
M    src/pkcs11/pkcs11-spy.c
M    src/pkcs11/openssl.c
M    src/pkcs11/Makefile.am
A    src/pkcs11/pkcs11-spy.exports
_M   src/tests
_M   src/tests/regression
M    src/tests/regression/Makefile.am
M    src/tests/sc-test.c
M    src/tests/pintest.c
M    src/tests/Makefile.am
_M   src/include
_M   src/include/opensc
M    src/include/opensc/Makefile.am
A    src/include/opensc/svnignore
M    src/include/Makefile.am
_M   src/signer
_M   src/signer/npinclude
M    src/signer/npinclude/Makefile.am
M    src/signer/Makefile.am
A    src/signer/signer.exports
_M   src/common
A    src/common/compat_dummy.c
D    src/common/getopt.txt
D    src/common/strlcpy.c
D    src/common/LICENSE
A    src/common/compat_getopt.txt
A    src/common/compat_strlcpy.c
A    src/common/LICENSE.compat_getopt
A    src/common/compat_getopt.c
D    src/common/strlcpy.h
D    src/common/ChangeLog
D    src/common/getpass.c
D    src/common/my_getopt.c
A    src/common/compat_strlcpy.h
A    src/common/compat_getpass.c
A    src/common/compat_getopt.h
A    src/common/ChangeLog.compat_getopt
D    src/common/README.strlcpy
D    src/common/my_getopt.h
A    src/common/compat_getpass.h
A    src/common/README.compat_strlcpy
D    src/common/strlcpy.3
A    src/common/README.compat_getopt
D    src/common/getopt.3
D    src/common/README.my_getopt
A    src/common/compat_strlcpy.3
A    src/common/compat_getopt.3
M    src/common/Makefile.am
M    src/Makefile.am
_M   src/pkcs15init
M    src/pkcs15init/pkcs15-oberthur.c
M    src/pkcs15init/profile.c
M    src/pkcs15init/pkcs15-lib.c
M    src/pkcs15init/pkcs15-rutoken.c
A    src/pkcs15init/pkcs15init.exports
M    src/pkcs15init/pkcs15-gpk.c
M    src/pkcs15init/Makefile.am
_M   src/scconf
M    src/scconf/Makefile.am
M    src/scconf/parse.c
A    src/scconf/scconf.exports
_M   src/libopensc
M    src/libopensc/card-rutoken.c
M    src/libopensc/compression.c
M    src/libopensc/sc.c
M    src/libopensc/card-piv.c
M    src/libopensc/pkcs15-openpgp.c
M    src/libopensc/pkcs15-postecert.c
M    src/libopensc/pkcs15-tcos.c
M    src/libopensc/opensc-config.in
M    src/libopensc/reader-pcsc.c
A    src/libopensc/internal-winscard.h
M    src/libopensc/ctx.c
A    src/libopensc/libopensc.exports
M    src/libopensc/pkcs15-piv.c
M    src/libopensc/pkcs15-infocamere.c
M    src/libopensc/internal.h
M    src/libopensc/pkcs15-actalis.c
M    src/libopensc/pkcs15-starcert.c
M    src/libopensc/card-oberthur.c
M    src/libopensc/pkcs15-atrust-acos.c
M    src/libopensc/p15card-helper.c
D    src/libopensc/part10.h
M    src/libopensc/ui.c
M    src/libopensc/card-gpk.c
M    src/libopensc/pkcs15-wrap.c
M    src/libopensc/pkcs15-gemsafeGPK.c
M    src/libopensc/log.c
M    src/libopensc/pkcs15-esteid.c
M    src/libopensc/pkcs15-prkey-rutoken.c
M    src/libopensc/log.h
M    src/libopensc/Makefile.am
M    src/libopensc/reader-openct.c
_M   aclocal
M    aclocal/Makefile.am
_M   win32
M    win32/Makefile.am
A    win32/versioninfo.rc.in
A    win32/ltrc.inc
A    configure.ac
_M   doc
_M   doc/tools
M    doc/tools/pkcs15-profile.xml
D    doc/changelog.sh
D    doc/export-wiki.xsl
_M   doc/api
_M   doc/api/file
M    doc/api/man.xsl
_M   doc/api/asn1
_M   doc/api/apps
_M   doc/api/init
_M   doc/api/types
_M   doc/api/card
M    doc/api/html.xsl
_M   doc/api/misc
_M   doc/api/util
M    doc/Makefile.am
D    doc/export-wiki.sh
AM   doc/nonpersistent
A    doc/nonpersistent/export-wiki.xsl
A    doc/nonpersistent/Makefile.am
A    doc/nonpersistent/export-wiki.sh
A    doc/nonpersistent/svn2cl.xsl
D    doc/generate-man.sh
D    doc/svn2cl.xsl
M    Makefile.am
A    svnignore
_M   etc
M    etc/opensc.conf.in
M    etc/Makefile.am
D    man
_M   solaris
M    solaris/Makefile



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3405 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-06 16:06:59 +00:00
martin 8db7c8c124 * Fix protocol forcing. Whenever connecting, use whatever protocol is available / currently set on card and only force the protocol with a cold reset when different
This fixes pcsc_lock->pcsc_reconnect->protocol mismatch error escaping from reader-pcsc.c if some other application has set the card to a different protocol.
 * pcsc_reconnect uses PC/SC return values, pcsc_reset uses OpenSC; 0 -> SC_SUCCESS
 * CCID driver with OmniKey 1021 returns SCARD_W_UNPOWERED_CARD when a card is inserted upside-down. Translate the currently unknown error into 'Unresponsive card'.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3386 c6295689-39f2-0310-b995-f0e70906c6a9
2008-02-10 16:13:55 +00:00
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
nils bea5746094 remove superfluous code, Martin Paljak <martin@paljak.pri.ee>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2030 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-21 11:03:57 +00:00
nils 3d75aeeaff force_protocol cleanup from Martin Paljak <martin@paljak.pri.ee>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2029 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-21 09:54:47 +00:00
nils 2df8086209 fix definition of SCARD_PROTOCOL_ANY
patch supplied by Ludovic Rousseau <ludovic.rousseau@free.fr>


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1898 c6295689-39f2-0310-b995-f0e70906c6a9
2004-08-31 17:31:00 +00:00
nils d6c98f7ae2 add support to force pcsc to use a certain protocol
patch supplied by Martin Paljak <martin@paljak.pri.ee>


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1890 c6295689-39f2-0310-b995-f0e70906c6a9
2004-08-19 08:55:15 +00:00
aj c9dfe962b9 Deal with new pcsc-lite code changes.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1845 c6295689-39f2-0310-b995-f0e70906c6a9
2004-07-20 20:52:21 +00:00
sth cdee73adff Fix: don't free anything in the connect() function because it can be called multiple times
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1816 c6295689-39f2-0310-b995-f0e70906c6a9
2004-07-09 15:31:08 +00:00
nils 475a29de67 proper checking of the SCardListReaders return values
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1780 c6295689-39f2-0310-b995-f0e70906c6a9
2004-04-27 17:41:02 +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
aet d6713aff9a - Minor naming convention harmonisation for pc/sc and ct-api
related things


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1669 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-10 14:52:58 +00:00
aet 0cddfbaf46 - Warning fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1631 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-20 20:46:15 +00:00
sth 3b746f0b5e Add room for SW1-SW2 in case of maximum reply size (256 bytes)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1604 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-14 10:14:54 +00:00
okir c85357baf9 - remain backward compatible - apdu_masq patch shouldn't break existing
config files that use apdu_fix


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1598 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-03 10:20:02 +00:00
okir 8e1443071c - merged apdu_masq patch from Chaskiel Grundman
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1597 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-03 10:16:25 +00:00
aet fe9eac7ad2 Rename HAVE_PCSCLITE to HAVE_PCSC, which is more correct.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1467 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-26 08:15:15 +00:00
aet e66bb1ef16 Remove gcc specific code from usbtoken/openct drivers, untested.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1417 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-04 16:41:49 +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 40f995994a Add support for MacOS X with PC/SC framework using autoconfigure.
Tested using Panther (WWDC build) + fink. Should work without fink, too.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1307 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-28 10:02:23 +00:00
aet 4de1bef042 - Build fixes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1301 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-24 13:10:53 +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 3ed0c2f5b1 - do not mess with Case 4 APDUs unless we're doing T=0
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1105 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-14 12:00:57 +00:00
sth a02b233a6c Correction of the previous insert-remove fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1060 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-22 07:51:45 +00:00
sth b531527169 More robust detection of removal/insertion events
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1044 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-17 14:35:58 +00:00
okir f8a7fecf78 - get rid of warning
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1026 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-16 15:56:40 +00:00
sth 7cb9901113 Correction of the previous patch for MacOSX
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1018 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-16 12:01:08 +00:00
sth 4545fc2ab6 include for MacOSX added
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1011 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-15 15:59:32 +00:00
okir 340aad07a0 - fixes for le=00/lc=00 problems
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@982 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-10 09:16:05 +00:00
sth 4aef09109b card remove/insert dection for Win32
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@953 c6295689-39f2-0310-b995-f0e70906c6a9
2003-03-20 12:52:39 +00:00
okir aab6ebd1e7 - minor cosmetic change
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@946 c6295689-39f2-0310-b995-f0e70906c6a9
2003-03-10 21:23:08 +00:00
sth 57954682fd added error: unresponsive card
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@915 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-19 13:36:58 +00:00
sth 0b9c44172d get the right error code on card removal
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@906 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-12 14:20:00 +00:00
sth 7d6837321f Fixes for Windows, who's PC/SC has more events that interfere with insert/removal events
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@882 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-27 13:01:17 +00:00
okir 5b1eb43b93 - add some support for card removal in pkcs11
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@867 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-19 17:47:07 +00:00
okir 8229351cce - DEF_APDU_FIX wasn't used unless you install a config file.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@838 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-06 17:45:06 +00:00
okir 9b330f3408 - vertain platforms need time.h to understand time_t
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@833 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-05 18:06:35 +00:00
okir 04c00ef5ef - fixed problem with infinite tiemout in sc_wait_for_event
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@831 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-05 17:59:24 +00:00
okir 21fe5ef918 - Patch from Stef to implement sc_wait_for_event, slightly enhanced by
yours truly.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@825 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-03 16:32:06 +00:00
okir 675ef65073 - default apdu_fix=1 on win32
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@821 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-03 13:27:19 +00:00
okir 93c0cab7b9 - win32 fixes from stef
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@814 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-02 15:31:53 +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 6217b4adf5 - changed pcsc_detect_card_presence to call refresh_slot_attributes. This
eliminates duplicate code, and that we also pick up the new ATR if another
  card was inserted in the meanwhil.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@758 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-06 21:40:41 +00:00
aet 1d2c9e4c48 Cleanups for initial win32 port, untested.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@696 c6295689-39f2-0310-b995-f0e70906c6a9
2002-10-19 14:04:52 +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 a94d1b26fb - Fix for last commit. It now compiles, at least.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@650 c6295689-39f2-0310-b995-f0e70906c6a9
2002-06-14 11:43:22 +00:00
jey ed19095c71 - Preliminary fix for Case 4 APDU sending on Win32
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@649 c6295689-39f2-0310-b995-f0e70906c6a9
2002-06-14 11:33:20 +00:00
aet 2846d6ce3b Preliminary MacOS X build support, untested so far.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@617 c6295689-39f2-0310-b995-f0e70906c6a9
2002-06-03 15:18:47 +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
jey 59d4e9b7be - Added support for CT-API
- Improved config file loading
- Implemented ATR parsing


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@396 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-26 11:38:40 +00:00
jey cd4e3650a4 - Moved functions from sc.c to ctx.c
- Card and reader drivers are now configurable


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@387 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-24 22:47:35 +00:00
aet e605e6fa8b Fix segfault for pcsc_finish
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@224 c6295689-39f2-0310-b995-f0e70906c6a9
2002-02-24 21:14:17 +00:00
aet 412292eab1 Add missing SC_STATUS_TIMEOUT that was removed from sc-internal.h
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@223 c6295689-39f2-0310-b995-f0e70906c6a9
2002-02-24 20:16:07 +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