Commit Graph

157 Commits

Author SHA1 Message Date
martin ffb46d2573 core: reanimate the sc_dlopen API for dynamic loading
* shift libpkcs11 from src/pkcs11 to src/common as it is not used to implement the OpenSC PKCS#11 module
 * invent a "libscdl" mini library that implements either libltdl based dynamic loading or uses native interfaces
 * drop hard requirement for libltl to build OpenSC
 * native Windows build does not need libltdl any more
 * specify CNGSDK include dir to find cardmod.h. CNGSDK only registers with a handful of compilers

Deals with #323

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5201 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-16 19:02:11 +00:00
vtarasov 69b7f200eb IAS/ECC: include support of the IAS/ECC v1.0.1 cards ...
http://www.opensc-project.org/pipermail/opensc-devel/2011-January/015756.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5198 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-16 10:59:10 +00:00
dengert d3b3faa91a Add sc_ctx_use_reader as a reader driver operation.
It is used by cardmod to pass in pointers to the PC/SC handles 
provided by the caller of cardmod. Other drivers will return
an error if this routine called. 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5190 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-09 14:33:52 +00:00
ludovic.rousseau f4af7743f1 Remove dead code
ctx.c:550:25: warning: Value stored to 'count' is never read
                        ctx->conf_blocks[count++] = blocks[0];
                                         ^~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5153 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:00:38 +00:00
ludovic.rousseau 6ccb540185 Fix compiler warning
ctx.c:56:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5134 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 17:20:43 +00:00
dengert 1adcc611c2 Add _sc_delete_reader to allow for a single reader to be
deleted from the ctx->readers list. This will be used 
by cardmod and for consistence by sc_release_context.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5127 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-03 21:18:26 +00:00
martin 2b04b0c328 libopensc: calling sc_context_create without parameters is not allowed
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5120 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-22 12:53:09 +00:00
martin 75c1254e22 Initial modifications to support OpenPGP v2.0 (CryptoStick)
* Correct naming: openpgp not opengpg
 * Set the card name from ATR table
 * Add card type enums
 * Currently OpenPGP is read-only.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5072 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 10:17:16 +00:00
vtarasov 1a58c429cb 'AuthentIC': basic support of Oberthur's 'COSMO.v7/AuthentIC.v3.2' ...
it's the natively PKCS#15 card


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5006 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-30 14:40:28 +00:00
vtarasov e259021d36 win32: change path to OpenSC windows registers
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4935 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-09 09:23:21 +00:00
andre 821f4fef6d card.c: Fixes the overriding of max_x_size limitations. In the result, the limitations of cards are adjusted to fit the limitations imposed by the configured reader.
ctx.c: Lookup conf_block of reader_driver by short_name

Fixes #269

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4878 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-19 18:09:04 +00:00
ludovic.rousseau 512be83138 ctx.c: In function ‘sc_ctx_detect_readers’:
ctx.c:548: warning: ‘r’ may be used uninitialized in this function


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4862 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-06 16:57:05 +00:00
flc 3076fe265c Fix patch [4709] for cardmod until build in one static dll
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4808 c6295689-39f2-0310-b995-f0e70906c6a9
2010-10-15 08:07:34 +00:00
viktor.tarasov 58c1c88efa libopensc: homogenise line ending in the debug messages
continuating r4759


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4774 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-25 20:35:59 +00:00
dengert e9d1f10084 PIV support for NIST 800-73-3 objects,
PIV driver client can build and run without OpenSSL,
(admin functions and piv-tool still need OpenSSL)
define PIV specific ctrl codes and structures.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4767 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-24 20:37:22 +00:00
martin cae16b6ef8 By default the reader driver does not have receive/send limitations.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4714 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-13 07:40:45 +00:00
martin 89d5bcf4d5 whitespace fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4712 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-11 13:01:06 +00:00
martin 0f7891293f libopensc: fix "ctx.c:389: warning: unused parameter ‘opts’"
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4711 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-11 13:01:00 +00:00
martin 8c1bcea28a libopensc: remove unused SC_MAX_READER_DRIVERS
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4710 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-11 13:00:54 +00:00
martin 72d961beb2 Fix #216: initial go with multiple reader subsystem removal.
* One sc_context has only a single reader driver.
 * remove dynamic reader driver loading capabilities
 * remove opensc-tool -R command
 * change the internal API, we don't need to pass around a "driver data" pointer as it can be found directly from the context.
 * check in ./configure for only a single enabled reader driver

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4709 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-11 13:00:47 +00:00
martin 8d3a1bcd1f libopensc: remove the "etoken" alias for "cardos" cards.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4659 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-31 01:24:53 +00:00
martin bb8b2d5f4b itacns: add itacns.h to distribution targzip, fix card driver ordering.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4629 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-16 08:59:09 +00:00
ep 71cdef0ed2 New card driver: Italian CNS/CIE (eID)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4627 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-16 00:56:27 +00:00
martin d61e7b5ba1 OSX: For Tokend, set the debug file by default to /tmp/opensc-debug.log
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4421 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-16 14:12:27 +00:00
viktor.tarasov 73c516a7a0 pkcs11: resolve 'endless polling' in C_WaitForSlotEvent()
http://www.opensc-project.org/pipermail/opensc-devel/2010-April/013947.html

Tested with Firefox 3.6.3 in WinXP SP3 .




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4363 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-19 09:18:38 +00:00
ludovic.rousseau 3f30d90045 Use a "const char *" to store a const C-string ptr. Fix a lot (31) of
warning: initialization discards qualifiers from pointer target type

Also cast from now (const char *) to (void *) for free()


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4176 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 21:02:56 +00:00
aj 6545b42c02 cleanup of the debug code:
* reduce to a few, supported functions.
* change all functions to take the debug level as parameter.
* use symbolic names for the debug levels.
* fix tools to pass "verbose"/"opt_debug" as ctx->debug.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4118 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-15 12:17:13 +00:00
flc 8e8ee649bd add windows.h include to ctx.c to satisfy dependencies and move internal.h include at end of includes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4092 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-09 13:39:29 +00:00
flc 995dda778a internal.h must be before winreg.h include, and change path for include log.h in cardmod.c
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4091 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-09 07:41:28 +00:00
aj d22a2483c0 Header file cleanup.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4081 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-04 08:14:36 +00:00
flc 6380feb1fd Use cardmod if explicitly request on config only
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4041 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-19 10:41:33 +00:00
martin 5991dfb433 Remove the dummy EMV driver.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4021 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-11 14:50:18 +00:00
viktor.tarasov 2ab30d8c52 libopensc: 'javacard' driver has to be the last one before 'default' -- thanks to Andreas
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4020 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-11 14:47:34 +00:00
viktor.tarasov 8161c72fa3 libopensc: in
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4019 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-11 14:15:13 +00:00
aj 3073306989 Add a comment to keep javacard driver 2nd last.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4005 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-06 12:59:24 +00:00
martin 4d56ce2b7b Add a catch-all for (possibly) blank JavaCards. This way known blank JavaCards without a supported applet get recognized by opensc-tool -n.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4004 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-06 10:56:29 +00:00
alonbl f636cc1862 cardmod - build fixups and mingw stuff
1. Add --enable-cardmod to autoconf to enable feature explicitly.

2. Modify opensc-cardmod.dll to always have bitness suffix eg opensc-cardmod32.dll

3. Remove complex cardmod.h detection, could not find any reason for this.

4. Make cardmod.inf a template and inject opensc version into its version string.

5. More minor autoconf/automake cleanups.

6. Remove internal-winscard.h usage in cardmod.c as cardmod.h already includes winscard.h

7. DllMain is not exportable.

Notes:

1. I may caused other build not to work, will happy to work it out.

2. Cannot find reason why cardmod.inf cardmod-westcos.reg should reside in bin directory.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4003 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-05 21:39:28 +00:00
flc 0e03c6d5cf add cardmod a minidrivers for windows
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4001 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-05 13:05:25 +00:00
aj b113b90000 remove ui code from library.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3992 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-04 06:19:52 +00:00
martin d006b1845e libopensc:
- Remove slot abstraction from internal API and all reader drivers. CT-API (from where it all comes from) readers with multiple slots (if still found) can be presented as separate readers, OpenCT should remove the slot abstraction, PC/SC never knew about it. None of the tools knew how to use slots.
 - Add sc_cancel (translates to SCardCancel)
 - Re-implement sc_wait_for_event; support a blocking call.
 - Replace the "int reader" API with "* sc_reader_t" style; add "Get reader by name" functionality.
 - Remove "action" parameter from sc_disconnect_card() (was not used)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3931 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-24 15:25:08 +00:00
martin c398f55373 Allow to turn off CT-API support
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3850 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-15 18:03:04 +00:00
martin 9c7eb8122a Add support for Portugese eID on IAS and Gemsafe cards, by João Poupino.
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3755 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-03 14:41:14 +00:00
martin 9da39d8462 Merged r3719:3749 from trunk
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3750 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-03 07:48:28 +00:00
martin e350239b37 Fix debug file closing.
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3737 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-15 12:29:17 +00:00
martin d672fde449 Remove sc_error and sc_ctx_suppress_errors_* in favor of sc_debug/fprintf
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3721 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-14 08:46:59 +00:00
martin d3201511c7 r3717:3719 from trunk
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3720 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-12 11:46:00 +00:00
aj be526c840f Move emv driver to the end.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3699 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-28 07:11:16 +00:00
aj 7931ded481 Add new rutoken_ecp driver by Aktiv Co. / Aleksey Samsonov
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3696 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-24 15:26:37 +00:00
aj 27d00f9265 Add new entersafe driver for ePass 3000 tokens.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3556 c6295689-39f2-0310-b995-f0e70906c6a9
2008-08-20 05:41:20 +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