Commit Graph

62 Commits

Author SHA1 Message Date
vtarasov 1176c59370 libopensc: export the wrapper for the internal log function dedicated to minidriver
http://www.opensc-project.org/pipermail/opensc-commits/2011-May/011049.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5430 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-08 08:07:03 +00:00
ludovic.rousseau 49f19fecb0 Remove dead code
log.c:107:2: warning: Value stored to 'left' is never read
        left -= r;
        ^       ~
log.c:106:2: warning: Value stored to 'p' is never read
        p += r;
        ^    ~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5154 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:01:35 +00:00
vtarasov 103af724fe liopensc: log: use 'normal' as default debug level ...
and make shorter short call to insert debug message


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5040 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-04 11:33:03 +00:00
vtarasov cf7c9fd726 libopensc: log: short form to insert 'normal' debug message
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5037 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-04 09:17:37 +00:00
andre b1287e3ff2 log.c: Fixes format string to match actual type.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4938 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-09 19:52:56 +00:00
ludovic.rousseau 3aea304a8e sc_do_log_va(): fix compiler warning
log.c:87: warning: format ‘%03ld’ expects type ‘long int’, but argument
8 has type ‘int’


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4859 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-06 16:50:41 +00:00
viktor.tarasov ad0207852e libopensc for win32: get working logging when compiled with Visual Studio
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4242 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-14 11:52:27 +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
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
aj dc6bc0df4a fix pthread include for win32/mingw compilation.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4000 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-05 11:21:31 +00:00
aj 91da321c46 remove log output coloring.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3993 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-04 06:22:50 +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
viktor.tarasov 5ba09f087b logs: time stamp with 1msec resolution in unix. Thanks to Ludovic Rousseau.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3858 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-17 13:27:15 +00:00
viktor.tarasov b41fcbedd9 logs: time stamp; dump_hex() with the static output buffer
- time stamp in the log messages: for Windows 1msec resolution, otherwise 1sec;
- one more dump hex function, to be easily inserted into the formatted message.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3856 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-17 11:11:05 +00:00
martin a869431ff6 Remove unused variables
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3829 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 11:13:01 +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
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
aj 20985fcfdc Added the application name to logging to allow for easier debugging. Since a
lot of testing needed multiple applications to be running, it became important
to know what application was making each log entry. 
This was reported by Russell Larner <rlarner@rsasecurity.com> on 5/17/2007


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3173 c6295689-39f2-0310-b995-f0e70906c6a9
2007-05-25 20:10:34 +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
aj 7c6baba8e7 revert bogus patch.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2924 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-01 10:06:35 +00:00
aj 03f5827c30 make sure buffer is 0 terminated.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2913 c6295689-39f2-0310-b995-f0e70906c6a9
2006-04-26 10:08:00 +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
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 048a7c3996 char * -> const char *
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2033 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-21 14:01:22 +00:00
nils 9953d0b21d fix some compiler warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1905 c6295689-39f2-0310-b995-f0e70906c6a9
2004-09-20 09:47:35 +00:00
okir 28a5eb0204 - if ctx->suppress_errors is non-zero, log suppressed error messages
at least to the debug log


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1621 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-20 15:39:18 +00:00
aet e62eea5351 - Minor cleanups and a warning fix
- sc_release_context: free ctx->preferred_language if set


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1565 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-22 18:16:21 +00:00
okir 931a1dd28a - added error/debug message support to ui.c
- sc_error/sc_debug now use the new ui code
- added language support


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1559 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-22 06:49:59 +00:00
okir 734bceb682 - Error logging changes: replace ctx->log_errors with ctx->suppress_errors,
so that we can nest error suppression using suppress_errors++/suppress_errors--


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1518 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-14 09:56:50 +00:00
sth e6f3f9bb08 Increase log buffer size, so that 255 hex bytes still can be logged
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1429 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-08 13:38:07 +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 5835e752b5 Cleanups
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1401 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-29 16:26:59 +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
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
aet 12bfb8ba64 Cleanups and logging improvements for non-GCC compilers
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@844 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-06 21:46:46 +00:00
aet 4e61af2b57 Duh, revert previous patch.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@718 c6295689-39f2-0310-b995-f0e70906c6a9
2002-11-18 09:05:06 +00:00
aet df6dd39e2b Add usage of __FILE__, __LINE__ and __FUNCTION__ macros
for non-GCC compilers too, where available.

(Based on patch by Stef Hoeben)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@716 c6295689-39f2-0310-b995-f0e70906c6a9
2002-11-17 20:23:35 +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 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
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 52dac164ba *** empty log message ***
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@289 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-11 11:40:30 +00:00
jey c1cac5f311 - bumped up version number in preparation of the new release
- unified PKCS #15 DF decoding
- added PKCS #15 file caching


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@191 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-24 16:02:54 +00:00
jey e7c65bf669 - PKCS #15 generation is now in a semi-working state
- started coding crypto support for Cryptoflexes


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@175 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-17 23:47:03 +00:00
aet a8a31771f4 int error -> int sc_error, since it conflicts with error() and
results to compiler error with various compilers.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@172 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-17 12:04:14 +00:00
jey 54e5d23e93 - improved PKCS #15 generation
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@170 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-17 11:44:27 +00:00
jey 20adb4b39c - continued to improve PKCS #15 generation
- fixed a few problems in sc_set_security_env
- started to implement Better (tm) object handling for
  PKCS #15 objects


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@167 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-16 23:59:18 +00:00