Commit Graph

116 Commits

Author SHA1 Message Date
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 f1471e4a0c Fix bebytes2ushort function, reported by Roland Schwarz.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3999 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-05 06:20:45 +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 f48ec9528e OpenSSL 1.0.0-beta series crash when assembler implementations underflow with 0 byte length call to OPENSSL_cleanse() and overwrite memory.
Avoid it by nut trying to eraze zero memory.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3925 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-23 06:28:35 +00:00
martin 95a5ab0654 Re-implement PIN cache on PKCS#15 layer; remove it from PKCS#11. Re-name and log PKCS#15 options to better reflect the purpose.
Data objects and PKCS#15 init are left broken currently.



git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3784 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-22 08:59:59 +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 5d218007c3 Fix last reference to VERSION and not PACKAGE_VERSION
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3475 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-16 04:32:56 +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 4acfe6b096 fix compiler/sparse warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3177 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 10:07:01 +00:00
nils 1b4472ca9f use const, add yet another ACL
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3114 c6295689-39f2-0310-b995-f0e70906c6a9
2007-01-20 12:46:40 +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 4f1bdbe99d fix typo
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3056 c6295689-39f2-0310-b995-f0e70906c6a9
2006-11-11 11:47:48 +00:00
nils c208794ca8 check types before concatenating paths
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3054 c6295689-39f2-0310-b995-f0e70906c6a9
2006-11-11 11:09:57 +00:00
nils 01f72933af add support to parse the seInfo TokenInfo entry, improve aid support in opensc-explorer
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3045 c6295689-39f2-0310-b995-f0e70906c6a9
2006-10-30 18:51:48 +00:00
nils 8d38746c28 keep index and count parameters
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3023 c6295689-39f2-0310-b995-f0e70906c6a9
2006-09-24 12:50:41 +00:00
nils 81fd37e617 fix sc_compare_path_prefix(); patch supplied by Henryk Plötz <henryk@ploetzli.ch>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3002 c6295689-39f2-0310-b995-f0e70906c6a9
2006-08-01 18:49:08 +00:00
nils ae5866b244 don't accept invalid OIDs
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2997 c6295689-39f2-0310-b995-f0e70906c6a9
2006-07-13 20:40:50 +00:00
sth bf23c032ca Endian-independent way to convert numbers to a byte array + vice versa
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2979 c6295689-39f2-0310-b995-f0e70906c6a9
2006-06-27 17:49:19 +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
nils de4b5c280f - implement thread-safe path printing function sc_path_print() and use
it src/libopensc/ and src/pkcs15init/
- use size_t for the certlen parameter of sc_pkcs15init_update_certificate()


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2811 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-11 23:41:17 +00:00
nils f18b38fe7f summary: -add more general path concatenation function
sc_concatenate_path() and let sc_append_path use it.
         -add function sc_compare_path_prefix to check whether
          a path starts with a certain sub-path (prefix).
         -add some doxygen docu to some path handling functions


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2801 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-01 23:11:00 +00:00
aj 138dfad842 simply code / remove dead code.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2711 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-05 21:36:55 +00:00
nils fa65fbf285 summary: - add new function sc_format_oid to libopensc
- cleanup libopensc api


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2670 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-30 18:05:30 +00:00
nils d858b4f84c fix build with openssl 0.9.8:
move "#include <openssl/crypto.h> up and remove unnecessary 
include for asn1.h 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2642 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-09 22:15:35 +00:00
nils 6abeaf1f1c add a new function
void sc_mem_clear(void *ptr, size_t len);
to clear a memory buffer. If OpenSSL is used this function
is a wrapper for OPENSSL_cleanse, otherwise memset is currenlty used.

Use this function to clear memory buffers with sensitive content.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2601 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-17 10:44:45 +00:00
nils f317e2966a sc_file_dup(): copy attributes as well, use explicit assignement and check return values
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2498 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-19 06:39:16 +00:00
nils 7ff54c7e2e use calloc instead of malloc + memset
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2497 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-18 22:43:01 +00:00
nils eab657fb52 change sc_bin_to_hex separator parameter from char to int as character constants are integers in c
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2461 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-03 18:43:40 +00:00
sth d0f267468e Added function sc_compare_oid()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2456 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-03 09:00:00 +00:00
sth e992e1ddfb Prevent doubles in the ACL entries
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2282 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-26 19:48:28 +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
aet 69d2e9014d - Optimize a few cpu cycles from _sc_match_atr_hex
- Replace struct sc_atr_table / _sc_match_atr with
  recently introduced _hex variants
- Rewrote _add_atr
- Introduce int type variable to sc_card_t, so that
  every other card driver won't have to glue around
  with this
- Card driver cleanups, optimize the number of
  sc_match_atr called per card driver. Also
  always try direct match with _sc_match_atr
  first, before relying on eg. historical bytes
  information on some card drivers
- Fixed a memory leak from the miocos driver


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2145 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-06 19:40:40 +00:00
nils 2c0781335c fix signed vs. unsigned mismatch
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1934 c6295689-39f2-0310-b995-f0e70906c6a9
2004-10-17 16:20:46 +00:00
nils f044157553 fix incorrect use of realloc (x = realloc(x, y) doesn't free
the x in case of a failure)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1775 c6295689-39f2-0310-b995-f0e70906c6a9
2004-04-21 18:10:58 +00:00
okir 624e345a58 - in sc_format_path, initialize path->count = -1
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1623 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-20 15:40:01 +00:00
okir bf7e801fac - new path functions: sc_append_file_id, sc_compare_path
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1503 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-13 14:34:18 +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
okir dc42cd3fa7 - added sc_print_path
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1400 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-29 12:55:30 +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
aj 1091548eda seperator is written to an u8, so it should be a char or u8 anyway.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1324 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-01 07:03:16 +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 34d45b2210 - minor signedness issue
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@801 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-19 21:17:06 +00:00
jey 9a8c3b2b20 - Added support for separator characters in sc_bin_to_hex()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@767 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-10 14:44:42 +00:00
jey 3bced8aeae - Changed sc_bin_to_hex() prototype a bit and removed the ':' characters
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@760 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-10 13:26:31 +00:00
okir 868d1d7a20 - added sc_bin_to_hex
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@757 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-06 12:49:19 +00:00
okir 59ca2a4b0f - sc_parse_atr: initialize slot->atr_info.hist_bytes even if the ATR is bad
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@756 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-05 09:34:24 +00:00
okir c83fa88ca8 - Parsing pkcs11 IDs and paths with an odd number of bytes would scan past
the end of the string. Made sc_hex_to_bin more robust and change various
  place to use it rather than doing it on their own with scanf(%02x)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@754 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-04 15:36:33 +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