Commit Graph

75 Commits

Author SHA1 Message Date
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
alonbl 17cf43eeb1 Rename PKCS#11 v2_20_mode option to plug_and_play
As it is the only feature it controls.
Also, change the default to true.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3637 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-23 09:14:15 +00:00
alonbl fbd51c705e Revert 3630
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3631 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-20 08:42:47 +00:00
alonbl ce5c5f3ae9 Add SCARD_E_NO_SERVICE to internal-winscard.h
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3630 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-19 19:43:19 +00:00
martin c58bcfab84 Configurable for PKCS#11 v2.20 related changes.
- Correctly report Cryptoki version if v2.20 is used.
 - Consistently report no version for hardware/software we know no version information about.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3627 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-19 12:06:38 +00:00
martin 0876222c5f Make PKCS#11 module default slot configuration more sensible:
* Increase default slot count to 16, which equals 4 concurrent readers by default
  * 2 OpenCT + 2 PC/SC on Linux for example
 * Rename num_slots to slots_per_card
 * Rename internal PKCS#11 variables, remove unneeded defines.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3619 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-16 16:44:35 +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
alonbl e4eeba26cd Fix MSVC compiler error
http://www.opensc-project.org/pipermail/opensc-devel/2008-April/010997.html

Thanks to Douglas E. Engert


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3459 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-04 16:21:08 +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
alonbl 56a4322c34 Convert constant SC_PKCS11_MAX_VIRTUAL_SLOTS to configuration option.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3404 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-06 15:04:29 +00:00
alonbl 1875a25c40 PKCS#11 "Application and processes" instructs the sequence
that should be taken after fork().
Applications should call C_Initialize() immediately after fork()
to reinitialize the provider.

The change monitor the pid that calls C_Initialize(), if it is
different than previous C_Finalize() is called.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3402 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-06 14:56:31 +00:00
aj 4f0329cd18 silence more gcc/sparse warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3180 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 12:01:39 +00:00
nils ef7d8ffa86 bugfix: don't use the size of a void pointer, thanks to Carl Przybylek <crprzyby@gmail.com>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3146 c6295689-39f2-0310-b995-f0e70906c6a9
2007-04-01 17:03:08 +00:00
aj 5db87927d4 convert to utf-8.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3086 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-19 21:33:15 +00:00
nils 65658db6e4 make the decision which locking functions to use more explicit; patch supplied by Martin
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3040 c6295689-39f2-0310-b995-f0e70906c6a9
2006-10-02 17:26:48 +00:00
ludovic.rousseau 3e2e82dde9 C_GetInfo(): use "OpenSC (www.opensc-project.org)" instead of
"OpenSC Project (www.opensc-project.org)" for the manufacturerID to
avoid a truncation at 32 characters


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3012 c6295689-39f2-0310-b995-f0e70906c6a9
2006-09-14 08:55:06 +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
aj b07df40932 change more opensc.org references to opensc-project.org till dns is back.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2818 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-22 21:15:07 +00:00
sth 551bcc89fa Referted the 'Fireofox 1.5' fix in log.c and replaced it by letting a blocking C_WaitForSlotEvent() return CKR_FUNCTION_NOT_SUPPORTED. This isn't a solution for the multihread problems (things hang or try to log to a released context) but at least it solves the Ff 1.5 problems
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2777 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-23 10:15:17 +00:00
sth 912946bf3f Fix for ticket #45: Firefox 1.5 and new Mozilla's crash when they are closed because there's a blocking C_WaitForSlotEvent() called from another thread then the 'main' thread that calls C_Finalize(); and this cause C_WaitForSlotEvent() to log to a NULL context -> assertion failure.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2762 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-08 20:25:54 +00:00
nils 5123be2b85 add two new functions
sc_reader_t *sc_ctx_get_reader(sc_context_t *ctx, unsigned int i);
	unsigned int sc_ctx_get_reader_count(sc_context_t *ctx);
to access the reader_count and the sc_reader objects (to avoid accessing
the sc_context members directly).
Use these functions in src/pkcs11 + error checking to avoid accessing
invalid sc_reader objects.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2595 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-16 10:18:55 +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
aj 7133146d28 put new version in pkcs11-global.c, too.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2259 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-23 22:37:06 +00:00
bert eb4717ea17 API fixup: use defined type instead of struct for exposed structs (part 2)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2233 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-09 00:04: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
nils cb5d576267 some indent fixes from Martin Paljak plus some additional changes from me
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2083 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-19 18:15:43 +00:00
nils 3931ee708d cleanup ...
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2041 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-22 10:17:00 +00:00
nils bfd5b49436 pkcs15-init etc. support for pkcs15 data objects
patch supplied by Victor Tarasov <vtarasov@idealx.com>


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1877 c6295689-39f2-0310-b995-f0e70906c6a9
2004-07-26 18:47:23 +00:00
aet 603ccec619 - Fixed nightly snapshot generation
- Link keycache.h to src/include/opensc
- Move mutex function declarations to opensc.h


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1525 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-14 21:56:56 +00:00
aet 6857ffa11a Update PKCS#11 library version to 0.8.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1443 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-12 10:36:23 +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 2b3db944e0 - Rename sysdep_timestamp_t to sc_timestamp_t
- Add missing function prototype for sc_current_time


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1384 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-18 14:54:37 +00:00
sth f417883e15 Avoid an Assertion Failed (ctx!=NULL) in log.c if sc_establish_context() fails in C_Initialize()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1075 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-28 09:55:36 +00:00
sth 2698dc6cec Have a compile option to enable PTHREAD locking at the pkcs11 level
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1070 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-24 07:03:48 +00:00
sth a9692c9c46 Disabled OS thread locking on OSes with PTHREAD due to closing problems with Mozilla
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1067 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-23 09:52:09 +00:00
sth b05aadce59 Have a sec delay in C_GetSlotInfo() per reader instead of a global delay
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1048 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-18 11:58:11 +00:00
sth f801d14ffd Removed some errors that occured with unsupported cards
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@996 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-11 14:22:52 +00:00
sth ac4b6dc45f Fix: card detection in C_GetSlotInfo is done at most once a second
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@969 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-02 06:59:19 +00:00
okir 66a8076baa - more robust handling of concurrent WaitForSlotEvent vs Finalize
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@937 c6295689-39f2-0310-b995-f0e70906c6a9
2003-03-03 13:07:28 +00:00
sth 0036545ffa fix in C_GetSlotInfo that previously cleared the slotDescription and didnt clear the CKF_TOKEN_PRESENT flag
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@934 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-28 12:47:32 +00:00
sth 5c1ae16ac8 fixed wrong return value in C_Finalize
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@931 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-23 20:10:24 +00:00
sth 49760f9cfb fixed some thread dead-lock bugs
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@930 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-23 19:38:50 +00:00
sth d9e99b0e17 little fix in C_GetInfo
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@927 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-21 15:40:06 +00:00
sth b75ea0a0b2 more parameter checks + fix in previous checks
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@917 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-19 21:10:39 +00:00
sth 958658102d added check for NULL pointers and uninitialized pkcs11 lib
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@916 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-19 13:44:36 +00:00
sth c05cef9678 correct behaviour of C_GetSlotInfo at empty slots
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@914 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-17 16:53:49 +00:00
okir 870d9d9f66 - made card_detect() available to everyone
- C_GetSlotInfo now always does card detection, but only for the
  reader which which the slot is associated


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@913 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-17 14:57:51 +00:00
okir cf6037314f - Introduce locks around all pkcs11 operations, in case the caller
is multithreaded and wants to access us from different threads.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@912 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-17 14:21:38 +00:00