Changeset 3405

Show
Ignore:
Timestamp:
03/06/08 16:06:59 (2 years ago)
Author:
alonbl
Message:

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

Location:
trunk
Files:
20 removed
111 modified
31 copied

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
         1Makefile 
         2Makefile.in 
         3core 
         4archive 
         5acinclude.m4 
         6aclocal.m4 
         7autom4te.cache 
         8compile 
         9confdefs.h 
         10config.* 
         11configure 
         12conftest 
         13conftest.c 
         14depcomp 
         15install-sh 
         16libtool 
         17libtool.m4 
         18ltmain.sh 
         19missing 
         20mkinstalldirs 
         21so_locations 
         22stamp-h* 
         23 
        124.deps 
        225.libs 
         
        1942*.rej 
        2043*.u 
         44*.rc 
         45*.pc 
        2146*~ 
        22 Makefile 
        23 Makefile.in 
        24 core 
        25 gmon.out 
        26 archive 
        27 acinclude.m4 
        28 aclocal.m4 
        29 autom4te.cache 
        30 compile 
        31 confdefs.h 
        32 config.cache 
        33 config.guess 
        34 config.h 
        35 config.h.in 
        36 config.log 
        37 config.status 
        38 config.sub 
        39 configure 
        40 conftest 
        41 conftest.c 
        42 depcomp 
        43 install-sh 
        44 libtool 
        45 libtool.m4 
        46 ltmain.sh 
        47 missing 
        48 mkinstalldirs 
        49 so_locations 
        50 stamp-h* 
         47*.gz 
         48*.bz2 
         49*.[0-9] 
         50*.html 
         51*.gif 
         52*.css 
         53*.out 
         54 
         55ChangeLog 
         56opensc.conf 
         57xsl-stylesheets 
         58opensc-config 
         59test-conf 
         60pkcs15-tool 
         61pkcs15-crypt 
         62pkcs15-init 
         63piv-tool 
         64eidenv 
         65opensc-explorer 
         66opensc-tool 
         67rutoken-tool 
         68cardos-info 
         69cryptoflex-tool 
         70netkey-tool 
         71pkcs11-tool 
         72pintest 
         73p15dump 
         74prngtest 
         75base64 
         76lottery 
         77 
  • trunk/Makefile.am

    r3268 r3405  
    11# Process this file with automake to create Makefile.in 
    2  
    3 SUBDIRS = . aclocal etc man src win32 
    4 DIST_SUBDIRS = . aclocal doc etc man src win32 
    5  
    6 EXTRA_DIST = README \ 
    7         bootstrap Makefile.mak depcomp \ 
    8         solaris/Makefile solaris/README solaris/checkinstall.in \ 
    9         solaris/opensc.conf-dist solaris/pkginfo.in solaris/proto 
    10  
    11 MAINTAINERCLEANFILES = \ 
    12         Makefile.in config.h.in configure \ 
    13         install-sh ltmain.sh missing mkinstalldirs \ 
    14         compile depcomp config.log config.status \ 
    15         config.guess config.sub acinclude.m4 aclocal.m4 
    16  
    17 DEPCLEANFILES = config.log configure 
    182 
    193AUTOMAKE_OPTIONS = foreign 1.5 
    204ACLOCAL_AMFLAGS = -I aclocal 
     5 
     6MAINTAINERCLEANFILES = \ 
     7        Makefile.in config.h.in config.h.in~ configure \ 
     8        install-sh ltmain.sh missing mkinstalldirs \ 
     9        compile depcomp config.log config.status \ 
     10        config.guess config.sub acinclude.m4 aclocal.m4 \ 
     11        packaged 
     12EXTRA_DIST = Makefile.mak svnignore 
     13 
     14SUBDIRS = aclocal etc src win32 doc 
     15 
     16dist_noinst_SCRIPTS = bootstrap 
     17dist_noinst_DATA = README \ 
     18        solaris/Makefile solaris/README solaris/checkinstall.in \ 
     19        solaris/opensc.conf-dist solaris/pkginfo.in solaris/proto 
     20dist_doc_DATA = NEWS 
     21 
     22# Allow detection of packaged tarball 
     23dist-hook: 
     24        echo > "$(distdir)/packaged" 
    2125 
    2226distcheck-hook: 
  • trunk/aclocal

    • Property svn:ignore
      •  

        old new  
         1Makefile 
         2Makefile.in 
         3core 
         4archive 
         5acinclude.m4 
         6aclocal.m4 
         7autom4te.cache 
         8compile 
         9confdefs.h 
         10config.* 
         11configure 
         12conftest 
         13conftest.c 
         14depcomp 
         15install-sh 
         16libtool 
         17libtool.m4 
         18ltmain.sh 
         19missing 
         20mkinstalldirs 
         21so_locations 
         22stamp-h* 
         23 
        124.deps 
        225.libs 
         
        1942*.rej 
        2043*.u 
         44*.rc 
         45*.pc 
        2146*~ 
        22 Makefile 
        23 Makefile.in 
        24 core 
        25 gmon.out 
         47*.gz 
         48*.bz2 
         49*.[0-9] 
         50*.html 
         51*.gif 
         52*.css 
         53*.out 
         54 
         55ChangeLog 
         56opensc.conf 
         57xsl-stylesheets 
         58opensc-config 
         59test-conf 
         60pkcs15-tool 
         61pkcs15-crypt 
         62pkcs15-init 
         63piv-tool 
         64eidenv 
         65opensc-explorer 
         66opensc-tool 
         67rutoken-tool 
         68cardos-info 
         69cryptoflex-tool 
         70netkey-tool 
         71pkcs11-tool 
         72pintest 
         73p15dump 
         74prngtest 
         75base64 
         76lottery 
         77 
  • trunk/aclocal/Makefile.am

    r3246 r3405  
    22 
    33MAINTAINERCLEANFILES = Makefile.in 
    4  
    54EXTRA_DIST = acx_pthread.m4 libassuan.m4 
  • trunk/configure.ac

    r3399 r3405  
    158158AC_ARG_ENABLE( 
    159159        [man], 
    160         [AC_HELP_STRING([--enable-man], [enable installation of manuals. [[default=enabled for none Windows]]])], 
     160        [AC_HELP_STRING([--disable-man], [disable installation of manuals. [[default=enabled for none Windows]]])], 
    161161        , 
    162162        [ 
  • trunk/doc

    • Property svn:ignore
      •  

        old new  
        1 html 
        2 man 
         1Makefile 
         2Makefile.in 
         3core 
         4archive 
         5acinclude.m4 
         6aclocal.m4 
         7autom4te.cache 
         8compile 
         9confdefs.h 
         10config.* 
         11configure 
         12conftest 
         13conftest.c 
         14depcomp 
         15install-sh 
         16libtool 
         17libtool.m4 
         18ltmain.sh 
         19missing 
         20mkinstalldirs 
         21so_locations 
         22stamp-h* 
         23 
         24.deps 
         25.libs 
         26.#*# 
         27.*.bak 
         28.*.orig 
         29.*.rej 
         30.*~ 
         31#*# 
         32*.bak 
         33*.d 
         34*.def 
         35*.dll 
         36*.exe 
         37*.la 
         38*.lib 
         39*.lo 
         40*.orig 
         41*.pdb 
         42*.rej 
         43*.u 
         44*.rc 
         45*.pc 
         46*~ 
         47*.gz 
         48*.bz2 
         49*.[0-9] 
         50*.html 
         51*.gif 
         52*.css 
         53*.out 
         54 
         55ChangeLog 
         56opensc.conf 
         57xsl-stylesheets 
         58opensc-config 
         59test-conf 
         60pkcs15-tool 
         61pkcs15-crypt 
         62pkcs15-init 
         63piv-tool 
         64eidenv 
         65opensc-explorer 
         66opensc-tool 
         67rutoken-tool 
         68cardos-info 
         69cryptoflex-tool 
         70netkey-tool 
         71pkcs11-tool 
         72pintest 
         73p15dump 
         74prngtest 
         75base64 
         76lottery 
         77 
  • trunk/doc/Makefile.am

    r3269 r3405  
    11# Process this file with automake to create Makefile.in 
    22 
    3 SUBDIRS = .  
     3MAINTAINERCLEANFILES = Makefile.in 
    44 
    5 MAINTAINERCLEANFILES = Makefile.in $(HTML) $(TMP) ChangeLog 
     5wikidir=$(htmldir)/wiki 
    66 
    7 EXTRA_DIST = README ChangeLog $(HTML) $(XML) index.html \ 
    8                 export-wiki.sh export-wiki.xsl \ 
    9                 generate-man.sh changelog.sh svn2cl.xsl  
     7if ENABLE_DOC 
     8SUBDIRS = nonpersistent 
     9endif 
     10DIST_SUBDIRS = nonpersistent 
    1011 
    11 TMP= $(shell ls $(srcdir)/*.tmp) 
    12 HTML= $(shell ls $(srcdir)/*.html $(srcdir)/*.css $(srcdir)/*.gif $(srcdir)/html/*) 
    13 XML = $(shell ls $(srcdir)/tools/*.xml $(srcdir)/api/*.xml $(srcdir)/api/*/*.xml $(srcdir)/api/api.css $(srcdir)/api/*.xsl) 
     12dist_noinst_DATA = tools/*.xml api/*.xml api/*/*.xml api/api.css api/*.xsl 
     13if ENABLE_DOC 
     14dist_html_DATA = html.out/* 
     15else 
     16dist_noinst_DATA += html.out/* 
     17endif 
     18dist_doc_DATA = README 
     19if WIN32 
     20dist_noinst_DATA += man.out/*.1 man.out/*.3 man.out/*.5 
     21else 
     22dist_man1_MANS = man.out/*.1 
     23dist_man3_MANS = man.out/*.3 
     24dist_man5_MANS = man.out/*.5 
     25endif 
    1426 
    15 index.html: 
    16         sh $(srcdir)/export-wiki.sh $(srcdir) 
    17         sh $(srcdir)/generate-man.sh $(srcdir) 
     27if SVN_CHECKOUT 
     28if ENABLE_MAN 
    1829 
    19 ChangeLog: 
    20         sh $(srcdir)/changelog.sh $(srcdir) 
     30html.out/*:     api/xsl-stylesheets 
     31        test -n "$(XSLTPROC)" 
     32        -rm -fr html.tmp 
     33        $(MKDIR_P) html.tmp 
     34        $(XSLTPROC) --nonet --xinclude -o "html.out/api.html" "$(srcdir)/api/html.xsl" "$(srcdir)/api/api.xml" 
     35        $(XSLTPROC) --nonet --xinclude -o "html.out/tools.html" "$(srcdir)/api/html.xsl" "$(srcdir)/tools/tools.xml" 
     36        mv html.tmp html.out 
     37 
     38man.out/*.1:    api/xsl-stylesheets 
     39        test -n "$(XSLTPROC)" 
     40        -rm -fr man.tmp 
     41        $(MKDIR_P) man.tmp 
     42        $(XSLTPROC) --nonet --xinclude -o "man.out/" "$(srcdir)/api/man.xsl" "$(srcdir)/api/api.xml" 
     43        $(XSLTPROC) --nonet --xinclude -o "man.out/" "$(srcdir)/api/man.xsl" "$(srcdir)/tools/tools.xml" 
     44        mv man.tmp man.out 
     45 
     46man.out/*.3 man.out/*.5:        man.out/*.1 
     47 
     48api/xsl-stylesheets: 
     49        $(LN_S) "$(xslstylesheetsdir)" api/xsl-stylesheets 
     50 
     51else 
     52 
     53html.out/*: 
     54man.out/*.1: 
     55man.out/*.3 man.out/*.5:        man.out/*.1 
     56 
     57endif 
     58endif 
    2159 
    2260maintainer-clean-local: 
    23         rm -rf $(srcdir)/html 
     61        rm -rf html.out html.tmp man.out man.tmp 
     62        rm -fr api/xsl-stylesheets 
  • trunk/doc/api

    • Property svn:ignore set to
      Makefile
      Makefile.in
      core
      archive
      acinclude.m4
      aclocal.m4
      autom4te.cache
      compile
      confdefs.h
      config.*
      configure
      conftest
      conftest.c
      depcomp
      install-sh
      libtool
      libtool.m4
      ltmain.sh
      missing
      mkinstalldirs
      so_locations
      stamp-h*

      .deps
      .libs
      .#*#
      .*.bak
      .*.orig
      .*.rej
      .*~
      #*#
      *.bak
      *.d
      *.def
      *.dll
      *.exe
      *.la
      *.lib
      *.lo
      *.orig
      *.pdb
      *.rej
      *.u
      *.rc
      *.pc
      *~
      *.gz
      *.bz2
      *.[0-9]
      *.html
      *.gif
      *.css
      *.out

      ChangeLog
      opensc.conf
      xsl-stylesheets
      opensc-config
      test-conf
      pkcs15-tool
      pkcs15-crypt
      pkcs15-init
      piv-tool
      eidenv
      opensc-explorer
      opensc-tool
      rutoken-tool
      cardos-info
      cryptoflex-tool
      netkey-tool
      pkcs11-tool
      pintest
      p15dump
      prngtest
      base64
      lottery

  • trunk/doc/api/apps

    • Property svn:ignore set to
      Makefile
      Makefile.in
      core
      archive
      acinclude.m4
      aclocal.m4
      autom4te.cache
      compile
      confdefs.h
      config.*
      configure
      conftest
      conftest.c
      depcomp
      install-sh
      libtool
      libtool.m4
      ltmain.sh
      missing
      mkinstalldirs
      so_locations
      stamp-h*

      .deps
      .libs
      .#*#
      .*.bak
      .*.orig
      .*.rej
      .*~
      #*#
      *.bak
      *.d
      *.def
      *.dll
      *.exe
      *.la
      *.lib
      *.lo
      *.orig
      *.pdb
      *.rej
      *.u
      *.rc
      *.pc
      *~
      *.gz
      *.bz2
      *.[0-9]
      *.html
      *.gif
      *.css
      *.out

      ChangeLog
      opensc.conf
      xsl-stylesheets
      opensc-config
      test-conf
      pkcs15-tool
      pkcs15-crypt
      pkcs15-init
      piv-tool
      eidenv
      opensc-explorer
      opensc-tool
      rutoken-tool
      cardos-info
      cryptoflex-tool
      netkey-tool
      pkcs11-tool
      pintest
      p15dump
      prngtest
      base64
      lottery

  • trunk/doc/api/asn1

    • Property svn:ignore set to
      Makefile
      Makefile.in
      core
      archive
      acinclude.m4
      aclocal.m4
      autom4te.cache
      compile
      confdefs.h
      config.*
      configure
      conftest
      conftest.c
      depcomp
      install-sh
      libtool
      libtool.m4
      ltmain.sh
      missing
      mkinstalldirs
      so_locations
      stamp-h*

      .deps
      .libs
      .#*#
      .*.bak
      .*.orig
      .*.rej
      .*~
      #*#
      *.bak
      *.d
      *.def
      *.dll
      *.exe
      *.la
      *.lib
      *.lo
      *.orig
      *.pdb
      *.rej
      *.u
      *.rc
      *.pc
      *~
      *.gz
      *.bz2
      *.[0-9]
      *.html
      *.gif
      *.css
      *.out

      ChangeLog
      opensc.conf
      xsl-stylesheets
      opensc-config
      test-conf
      pkcs15-tool
      pkcs15-crypt
      pkcs15-init
      piv-tool
      eidenv
      opensc-explorer
      opensc-tool
      rutoken-tool
      cardos-info
      cryptoflex-tool
      netkey-tool
      pkcs11-tool
      pintest
      p15dump
      prngtest
      base64
      lottery

  • trunk/doc/api/card

    • Property svn:ignore set to
      Makefile
      Makefile.in
      core
      archive
      acinclude.m4
      aclocal.m4
      autom4te.cache
      compile
      confdefs.h
      config.*
      configure
      conftest
      conftest.c
      depcomp
      install-sh
      libtool
      libtool.m4
      ltmain.sh
      missing
      mkinstalldirs
      so_locations
      stamp-h*

      .deps
      .libs
      .#*#
      .*.bak
      .*.orig
      .*.rej
      .*~
      #*#
      *.bak
      *.d
      *.def
      *.dll
      *.exe
      *.la
      *.lib
      *.lo
      *.orig
      *.pdb
      *.rej
      *.u
      *.rc
      *.pc
      *~
      *.gz
      *.bz2
      *.[0-9]
      *.html
      *.gif
      *.css
      *.out

      ChangeLog
      opensc.conf
      xsl-stylesheets
      opensc-config
      test-conf
      pkcs15-tool
      pkcs15-crypt
      pkcs15-init
      piv-tool
      eidenv
      opensc-explorer
      opensc-tool
      rutoken-tool
      cardos-info
      cryptoflex-tool
      netkey-tool
      pkcs11-tool
      pintest
      p15dump
      prngtest
      base64
      lottery

  • trunk/doc/api/file

    • Property svn:ignore set to
      Makefile
      Makefile.in
      core
      archive
      acinclude.m4
      aclocal.m4
      autom4te.cache
      compile
      confdefs.h
      config.*
      configure
      conftest
      conftest.c
      depcomp
      install-sh
      libtool
      libtool.m4
      ltmain.sh
      missing
      mkinstalldirs
      so_locations
      stamp-h*

      .deps
      .libs
      .#*#
      .*.bak
      .*.orig
      .*.rej
      .*~
      #*#
      *.bak
      *.d
      *.def
      *.dll
      *.exe
      *.la
      *.lib
      *.lo
      *.orig
      *.pdb
      *.rej
      *.u
      *.rc
      *.pc
      *~
      *.gz
      *.bz2
      *.[0-9]
      *.html
      *.gif
      *.css
      *.out

      ChangeLog
      opensc.conf
      xsl-stylesheets
      opensc-config
      test-conf
      pkcs15-tool
      pkcs15-crypt
      pkcs15-init
      piv-tool
      eidenv
      opensc-explorer
      opensc-tool
      rutoken-tool
      cardos-info
      cryptoflex-tool
      netkey-tool
      pkcs11-tool
      pintest
      p15dump
      prngtest
      base64
      lottery

  • trunk/doc/api/html.xsl

    r2208 r3405  
    44]> 
    55<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 
    6         <xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/html/docbook.xsl"/> 
     6        <xsl:import href="xsl-stylesheets/html/docbook.xsl"/> 
    77        <xsl:param name="toc.section.depth" select="0"/> 
    88        <xsl:template name="user.head.content"> 
  • trunk/doc/api/init

    • Property svn:ignore set to
      Makefile
      Makefile.in
      core
      archive
      acinclude.m4
      aclocal.m4
      autom4te.cache
      compile
      confdefs.h
      config.*
      configure
      conftest
      conftest.c
      depcomp
      install-sh
      libtool
      libtool.m4
      ltmain.sh
      missing
      mkinstalldirs
      so_locations
      stamp-h*

      .deps
      .libs
      .#*#
      .*.bak
      .*.orig
      .*.rej
      .*~
      #*#
      *.bak
      *.d
      *.def
      *.dll
      *.exe
      *.la
      *.lib
      *.lo
      *.orig
      *.pdb
      *.rej
      *.u
      *.rc
      *.pc
      *~
      *.gz
      *.bz2
      *.[0-9]
      *.html
      *.gif
      *.css
      *.out

      ChangeLog
      opensc.conf
      xsl-stylesheets
      opensc-config
      test-conf
      pkcs15-tool
      pkcs15-crypt
      pkcs15-init
      piv-tool
      eidenv
      opensc-explorer
      opensc-tool
      rutoken-tool
      cardos-info
      cryptoflex-tool
      netkey-tool
      pkcs11-tool
      pintest
      p15dump
      prngtest
      base64
      lottery

  • trunk/doc/api/man.xsl

    r2208 r3405  
    11<?xml version="1.0" encoding="UTF-8"?> 
    22<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 
    3         <xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl"/> 
     3        <xsl:import href="xsl-stylesheets/manpages/docbook.xsl"/> 
    44</xsl:stylesheet> 
  • trunk/doc/api/misc

    • Property svn:ignore set to
      Makefile
      Makefile.in
      core
      archive
      acinclude.m4
      aclocal.m4
      autom4te.cache
      compile
      confdefs.h
      config.*
      configure
      conftest
      conftest.c
      depcomp
      install-sh
      libtool
      libtool.m4
      ltmain.sh
      missing
      mkinstalldirs
      so_locations
      stamp-h*

      .deps
      .libs
      .#*#
      .*.bak
      .*.orig
      .*.rej
      .*~
      #*#
      *.bak
      *.d
      *.def
      *.dll
      *.exe
      *.la
      *.lib
      *.lo
      *.orig
      *.pdb
      *.rej
      *.u
      *.rc
      *.pc
      *~
      *.gz
      *.bz2
      *.[0-9]
      *.html
      *.gif
      *.css
      *.out

      ChangeLog
      opensc.conf
      xsl-stylesheets
      opensc-config
      test-conf
      pkcs15-tool
      pkcs15-crypt
      pkcs15-init
      piv-tool
      eidenv
      opensc-explorer
      opensc-tool
      rutoken-tool
      cardos-info
      cryptoflex-tool
      netkey-tool
      pkcs11-tool
      pintest
      p15dump
      prngtest
      base64
      lottery

  • trunk/doc/api/types

    • Property svn:ignore set to
      Makefile
      Makefile.in
      core
      archive
      acinclude.m4
      aclocal.m4
      autom4te.cache
      compile
      confdefs.h
      config.*
      configure
      conftest
      conftest.c
      depcomp
      install-sh
      libtool
      libtool.m4
      ltmain.sh
      missing
      mkinstalldirs
      so_locations
      stamp-h*

      .deps
      .libs
      .#*#
      .*.bak
      .*.orig
      .*.rej
      .*~
      #*#
      *.bak
      *.d
      *.def
      *.dll
      *.exe
      *.la
      *.lib
      *.lo
      *.orig
      *.pdb
      *.rej
      *.u
      *.rc
      *.pc
      *~
      *.gz
      *.bz2
      *.[0-9]
      *.html
      *.gif
      *.css
      *.out

      ChangeLog
      opensc.conf
      xsl-stylesheets
      opensc-config
      test-conf
      pkcs15-tool
      pkcs15-crypt
      pkcs15-init
      piv-tool
      eidenv
      opensc-explorer
      opensc-tool
      rutoken-tool
      cardos-info
      cryptoflex-tool
      netkey-tool
      pkcs11-tool
      pintest
      p15dump
      prngtest
      base64
      lottery

  • trunk/doc/api/util

    • Property svn:ignore set to
      Makefile
      Makefile.in
      core
      archive
      acinclude.m4
      aclocal.m4
      autom4te.cache
      compile
      confdefs.h
      config.*
      configure
      conftest
      conftest.c
      depcomp
      install-sh
      libtool
      libtool.m4
      ltmain.sh
      missing
      mkinstalldirs
      so_locations
      stamp-h*

      .deps
      .libs
      .#*#
      .*.bak
      .*.orig
      .*.rej
      .*~
      #*#
      *.bak
      *.d
      *.def
      *.dll
      *.exe
      *.la
      *.lib
      *.lo
      *.orig
      *.pdb
      *.rej
      *.u
      *.rc
      *.pc
      *~
      *.gz
      *.bz2
      *.[0-9]
      *.html
      *.gif
      *.css
      *.out

      ChangeLog
      opensc.conf
      xsl-stylesheets
      opensc-config
      test-conf
      pkcs15-tool
      pkcs15-crypt
      pkcs15-init
      piv-tool
      eidenv
      opensc-explorer
      opensc-tool
      rutoken-tool
      cardos-info
      cryptoflex-tool
      netkey-tool
      pkcs11-tool
      pintest
      p15dump
      prngtest
      base64
      lottery

  • trunk/doc/tools

    • Property svn:ignore set to
      Makefile
      Makefile.in
      core
      archive
      acinclude.m4
      aclocal.m4
      autom4te.cache
      compile
      confdefs.h
      config.*
      configure
      conftest
      conftest.c
      depcomp
      install-sh
      libtool
      libtool.m4
      ltmain.sh
      missing
      mkinstalldirs
      so_locations
      stamp-h*

      .deps
      .libs
      .#*#
      .*.bak
      .*.orig
      .*.rej
      .*~
      #*#
      *.bak
      *.d
      *.def
      *.dll
      *.exe
      *.la
      *.lib
      *.lo
      *.orig
      *.pdb
      *.rej
      *.u
      *.rc
      *.pc
      *~
      *.gz
      *.bz2
      *.[0-9]
      *.html
      *.gif
      *.css
      *.out

      ChangeLog
      opensc.conf
      xsl-stylesheets
      opensc-config
      test-conf
      pkcs15-tool
      pkcs15-crypt
      pkcs15-init
      piv-tool
      eidenv
      opensc-explorer
      opensc-tool
      rutoken-tool
      cardos-info
      cryptoflex-tool
      netkey-tool
      pkcs11-tool
      pintest
      p15dump
      prngtest
      base64
      lottery

  • trunk/doc/tools/pkcs15-profile.xml

    r2581 r3405  
    3838                        The card specific profile contains additional information required during 
    3939                        card intialization, such as location of PIN files, key references etc. 
    40                         Profiles currently reside in <command>@pkgdata@</command> 
     40                        Profiles currently reside in <command>@pkgdatadir@</command> 
    4141                </para> 
    4242        </refsect1> 
  • trunk/etc

    • Property svn:ignore
      •  

        old new  
         1Makefile 
         2Makefile.in 
         3core 
         4archive 
         5acinclude.m4 
         6aclocal.m4 
         7autom4te.cache 
         8compile 
         9confdefs.h 
         10config.* 
         11configure 
         12conftest 
         13conftest.c 
         14depcomp 
         15install-sh 
         16libtool 
         17libtool.m4 
         18ltmain.sh 
         19missing 
         20mkinstalldirs 
         21so_locations 
         22stamp-h* 
         23 
        124.deps 
        225.libs 
         
        1942*.rej 
        2043*.u 
         44*.rc 
         45*.pc 
        2146*~ 
        22 Makefile 
        23 Makefile.in 
        24 core 
        25 gmon.out 
         47*.gz 
         48*.bz2 
         49*.[0-9] 
         50*.html 
         51*.gif 
         52*.css 
         53*.out 
         54 
         55ChangeLog 
         56opensc.conf 
         57xsl-stylesheets 
         58opensc-config 
         59test-conf 
         60pkcs15-tool 
         61pkcs15-crypt 
         62pkcs15-init 
         63piv-tool 
         64eidenv 
         65opensc-explorer 
         66opensc-tool 
         67rutoken-tool 
         68cardos-info 
         69cryptoflex-tool 
         70netkey-tool 
         71pkcs11-tool 
         72pintest 
         73p15dump 
         74prngtest 
         75base64 
         76lottery 
         77 
  • trunk/etc/Makefile.am

    r2422 r3405  
    33MAINTAINERCLEANFILES = Makefile.in 
    44DISTCLEANFILES = opensc.conf  
    5 EXTRA_DIST = opensc.conf.in  
    65 
    7 noinst_DATA = opensc.conf.in opensc.conf  
     6SUFFIXES = .in 
     7dist_noinst_DATA = opensc.conf.in opensc.conf  
    88 
    9 %: %.in 
    10         sed -e "s#PKGDATADIR#$(shell eval echo $(pkgdatadir))#" < $^ > $@ 
     9.in: 
     10        sed -e "s|@pkgdatadir[@]|$(pkgdatadir)|g" < $^ > $@ 
     11 
     12sysconf_DATA=#required in order to create dir 
     13install-exec-hook:      install-sysconfDATA 
     14        if [ -f $(DESTDIR)$(sysconfdir)/opensc.conf ]; then \ 
     15                $(INSTALL_DATA) $(srcdir)/opensc.conf $(DESTDIR)$(sysconfdir)/opensc.conf.new; \ 
     16        else \ 
     17                $(INSTALL_DATA) $(srcdir)/opensc.conf $(DESTDIR)$(sysconfdir)/opensc.conf; \ 
     18        fi 
  • trunk/etc/opensc.conf.in

    r3404 r3405  
    3434        # profiles directory for pkcs15-init. 
    3535         
    36         profile_dir = PKGDATADIR; 
     36        profile_dir = @pkgdatadir@; 
    3737 
    3838        # What reader drivers to load at start-up 
     
    8888                # Default: false 
    8989                # enable_pinpad = true; 
     90                # 
     91                # Use specific pcsc library. 
     92                # Default: system 
     93                # library_name = /usr/lib/libpcsclite.so 
    9094        } 
    9195 
  • trunk/solaris

    • Property svn:ignore set to
      Makefile
      Makefile.in
      core
      archive
      acinclude.m4
      aclocal.m4
      autom4te.cache
      compile
      confdefs.h
      config.*
      configure
      conftest
      conftest.c
      depcomp
      install-sh
      libtool
      libtool.m4
      ltmain.sh
      missing
      mkinstalldirs
      so_locations
      stamp-h*

      .deps
      .libs
      .#*#
      .*.bak
      .*.orig
      .*.rej
      .*~
      #*#
      *.bak
      *.d
      *.def
      *.dll
      *.exe
      *.la
      *.lib
      *.lo
      *.orig
      *.pdb
      *.rej
      *.u
      *.rc
      *.pc
      *~
      *.gz
      *.bz2
      *.[0-9]
      *.html
      *.gif
      *.css
      *.out

      ChangeLog
      opensc.conf
      xsl-stylesheets
      opensc-config
      test-conf
      pkcs15-tool
      pkcs15-crypt
      pkcs15-init
      piv-tool
      eidenv
      opensc-explorer
      opensc-tool
      rutoken-tool
      cardos-info
      cryptoflex-tool
      netkey-tool
      pkcs11-tool
      pintest
      p15dump
      prngtest
      base64
      lottery

  • trunk/solaris/Makefile

    r2286 r3405  
    55CONFIGURE_PREFIX=$(PWD:sh)/.. 
    66CONFIGURE=${CONFIGURE_PREFIX}/configure 
    7 CONFIGURE_ARGS=--prefix=/usr --sysconfdir=/etc/opensc --mandir=/usr/share/man 
     7CONFIGURE_ARGS=--prefix=/usr --sysconfdir=/etc/opensc --mandir=/usr/share/man --enable-pcsc --enable-openct 
    88CONFIG_GUESS=${CONFIGURE_PREFIX}/config.guess 
    99UNAME_ARCH=/sbin/uname -p 
  • trunk/src

    • Property svn:ignore
      •  

        old new  
         1Makefile 
         2Makefile.in 
         3core 
         4archive 
         5acinclude.m4 
         6aclocal.m4 
         7autom4te.cache 
         8compile 
         9confdefs.h 
         10config.* 
         11configure 
         12conftest 
         13conftest.c 
         14depcomp 
         15install-sh 
         16libtool 
         17libtool.m4 
         18ltmain.sh 
         19missing 
         20mkinstalldirs 
         21so_locations 
         22stamp-h* 
         23 
        124.deps 
        225.libs 
         
        1942*.rej 
        2043*.u 
         44*.rc 
         45*.pc 
        2146*~ 
        22 Makefile 
        23 Makefile.in 
        24 core 
        25 gmon.out 
         47*.gz 
         48*.bz2 
         49*.[0-9] 
         50*.html 
         51*.gif 
         52*.css 
         53*.out 
         54 
         55ChangeLog 
         56opensc.conf 
         57xsl-stylesheets 
         58opensc-config 
         59test-conf 
         60pkcs15-tool 
         61pkcs15-crypt 
         62pkcs15-init 
         63piv-tool 
         64eidenv 
         65opensc-explorer 
         66opensc-tool 
         67rutoken-tool 
         68cardos-info 
         69cryptoflex-tool 
         70netkey-tool 
         71pkcs11-tool 
         72pintest 
         73p15dump 
         74prngtest 
         75base64 
         76lottery 
         77 
  • trunk/src/Makefile.am

    r2528 r3405  
    22 
    33MAINTAINERCLEANFILES = Makefile.in 
    4  
    54EXTRA_DIST = Makefile.mak 
    65 
  • trunk/src/common

    • Property svn:ignore
      •  

        old new  
         1Makefile 
         2Makefile.in 
         3core 
         4archive 
         5acinclude.m4 
         6aclocal.m4 
         7autom4te.cache 
         8compile 
         9confdefs.h 
         10config.* 
         11configure 
         12conftest 
         13conftest.c 
         14depcomp 
         15install-sh 
         16libtool 
         17libtool.m4 
         18ltmain.sh 
         19missing 
         20mkinstalldirs 
         21so_locations 
         22stamp-h* 
         23 
        124.deps 
        225.libs 
         
        1942*.rej 
        2043*.u 
         44*.rc 
         45*.pc 
        2146*~ 
        22 Makefile 
        23 Makefile.in 
        24 core 
        25 gmon.out 
         47*.gz 
         48*.bz2 
         49*.[0-9] 
         50*.html 
         51*.gif 
         52*.css 
         53*.out 
         54 
         55ChangeLog 
         56opensc.conf 
         57xsl-stylesheets 
         58opensc-config 
         59test-conf 
         60pkcs15-tool 
         61pkcs15-crypt 
         62pkcs15-init 
         63piv-tool 
         64eidenv 
         65opensc-explorer 
         66opensc-tool 
         67rutoken-tool 
         68cardos-info 
         69cryptoflex-tool 
         70netkey-tool 
         71pkcs11-tool 
         72pintest 
         73p15dump 
         74prngtest 
         75base64 
         76lottery 
         77 
  • trunk/src/common/Makefile.am

    r2990 r3405  
    22 
    33MAINTAINERCLEANFILES = Makefile.in 
     4EXTRA_DIST = Makefile.mak 
    45 
    5 EXTRA_DIST = Makefile.mak getpass.c \ 
    6         ChangeLog LICENSE README.my_getopt getopt.3 getopt.txt \ 
    7         main.c my_getopt.c my_getopt.h README.strlcpy strlcpy.3 \ 
    8         strlcpy.c strlcpy.h 
     6noinst_LTLIBRARIES = libcompat.la 
     7dist_noinst_DATA = \ 
     8        README.compat_getopt ChangeLog.compat_getopt LICENSE.compat_getopt compat_getopt.txt \ 
     9        README.compat_strlcpy compat_strlcpy.3 
     10 
     11libcompat_la_SOURCES = \ 
     12        compat_dummy.c \ 
     13        compat_strlcpy.h compat_strlcpy.c \ 
     14        compat_getpass.h compat_getpass.c \ 
     15        compat_getopt.h compat_getopt.c 
  • trunk/src/include

    • Property svn:ignore
      •  

        old new  
         1Makefile 
         2Makefile.in 
         3core 
         4archive 
         5acinclude.m4 
         6aclocal.m4 
         7autom4te.cache 
         8compile 
         9confdefs.h 
         10config.* 
         11configure 
         12conftest 
         13conftest.c 
         14depcomp 
         15install-sh 
         16libtool 
         17libtool.m4 
         18ltmain.sh 
         19missing 
         20mkinstalldirs 
         21so_locations 
         22stamp-h* 
         23 
        124.deps 
        225.libs 
         
        1942*.rej 
        2043*.u 
         44*.rc 
         45*.pc 
        2146*~ 
        22 Makefile 
        23 Makefile.in 
        24 core 
        25 gmon.out 
         47*.gz 
         48*.bz2 
         49*.[0-9] 
         50*.html 
         51*.gif 
         52*.css 
         53*.out 
         54 
         55ChangeLog 
         56opensc.conf 
         57xsl-stylesheets 
         58opensc-config 
         59test-conf 
         60pkcs15-tool 
         61pkcs15-crypt 
         62pkcs15-init 
         63piv-tool 
         64eidenv 
         65opensc-explorer 
         66opensc-tool 
         67rutoken-tool 
         68cardos-info 
         69cryptoflex-tool 
         70netkey-tool 
         71pkcs11-tool 
         72pintest 
         73p15dump 
         74prngtest 
         75base64 
         76lottery 
         77 
  • trunk/src/include/Makefile.am

    r1058 r3405  
    22 
    33MAINTAINERCLEANFILES = Makefile.in 
    4  
    54EXTRA_DIST = Makefile.mak winconfig.h 
    65 
    7 SUBDIRS = . opensc 
     6SUBDIRS = opensc 
  • trunk/src/include/opensc

    • Property svn:ignore
      •  

        old new  
        1 .deps 
        2 .libs 
        3 .#*# 
        4 .*.bak 
        5 .*.orig 
        6 .*.rej 
        7 .*~ 
        8 #*# 
        9 *.bak 
        10 *.d 
        11 *.def 
        12 *.dll 
        13 *.exe 
        14 *.la 
        15 *.lib 
        16 *.lo 
        17 *.orig 
        18 *.pdb 
        19 *.rej 
        20 *.u 
        21 *~ 
         1*.h 
         2*.in 
        223Makefile 
        23 Makefile.in 
        24 core 
        25 gmon.out 
        26 *.h 
  • trunk/src/include/opensc/Makefile.am

    r3066 r3405  
    11# Process this file with automake to create Makefile.in 
    22 
    3 RM = rm -f 
    4  
    53MAINTAINERCLEANFILES = Makefile.in 
    6 DISTCLEANFILES = \ 
    7         asn1.h \ 
    8         cardctl.h \ 
    9         cards.h \ 
    10         emv.h \ 
    11         errors.h \ 
    12         log.h \ 
    13         opensc.h \ 
    14         pkcs15.h \ 
    15         types.h \ 
    16         ui.h \ 
    17         pkcs11.h \ 
    18         keycache.h \ 
    19         pkcs15-init.h \ 
    20         scconf.h  
     4EXTRA_DIST = svnignore 
    215 
    226all-local: 
    23         @$(RM) *.h 
    24         @$(LN_S) ${top_srcdir}/src/libopensc/asn1.h asn1.h 
    25         @$(LN_S) ${top_srcdir}/src/libopensc/cardctl.h cardctl.h 
    26         @$(LN_S) ${top_srcdir}/src/libopensc/cards.h cards.h 
    27         @$(LN_S) ${top_srcdir}/src/libopensc/emv.h emv.h 
    28         @$(LN_S) ${top_srcdir}/src/libopensc/errors.h errors.h 
    29         @$(LN_S) ${top_srcdir}/src/libopensc/log.h log.h 
    30         @$(LN_S) ${top_srcdir}/src/libopensc/opensc.h opensc.h 
    31         @$(LN_S) ${top_srcdir}/src/libopensc/pkcs15.h pkcs15.h 
    32         @$(LN_S) ${top_srcdir}/src/libopensc/types.h types.h 
    33         @$(LN_S) ${top_srcdir}/src/libopensc/ui.h ui.h 
    34         @$(LN_S) ${top_srcdir}/src/pkcs11/pkcs11.h pkcs11.h 
    35         @$(LN_S) ${top_srcdir}/src/pkcs15init/keycache.h keycache.h 
    36         @$(LN_S) ${top_srcdir}/src/pkcs15init/pkcs15-init.h pkcs15-init.h 
    37         @$(LN_S) ${top_srcdir}/src/scconf/scconf.h scconf.h 
     7        @-rm -f *.h 
     8        @$(LN_S) $(top_srcdir)/src/libopensc/asn1.h asn1.h 
     9        @$(LN_S) $(top_srcdir)/src/libopensc/cardctl.h cardctl.h 
     10        @$(LN_S) $(top_srcdir)/src/libopensc/cards.h cards.h 
     11        @$(LN_S) $(top_srcdir)/src/libopensc/emv.h emv.h 
     12        @$(LN_S) $(top_srcdir)/src/libopensc/errors.h errors.h 
     13        @$(LN_S) $(top_srcdir)/src/libopensc/log.h log.h 
     14        @$(LN_S) $(top_srcdir)/src/libopensc/opensc.h opensc.h 
     15        @$(LN_S) $(top_srcdir)/src/libopensc/pkcs15.h pkcs15.h 
     16        @$(LN_S) $(top_srcdir)/src/libopensc/types.h types.h 
     17        @$(LN_S) $(top_srcdir)/src/libopensc/ui.h ui.h 
     18        @$(LN_S) $(top_srcdir)/src/pkcs11/pkcs11.h pkcs11.h 
     19        @$(LN_S) $(top_srcdir)/src/pkcs15init/keycache.h keycache.h 
     20        @$(LN_S) $(top_srcdir)/src/pkcs15init/pkcs15-init.h pkcs15-init.h 
     21        @$(LN_S) $(top_srcdir)/src/scconf/scconf.h scconf.h 
     22 
     23distclean-local: 
     24        -rm -f *.h 
  • trunk/src/libopensc

    • Property svn:ignore
      •  

        old new  
         1Makefile 
         2Makefile.in 
         3core 
         4archive 
         5acinclude.m4 
         6aclocal.m4 
         7autom4te.cache 
         8compile 
         9confdefs.h 
         10config.* 
         11configure 
         12conftest 
         13conftest.c 
         14depcomp 
         15install-sh 
         16libtool 
         17libtool.m4 
         18ltmain.sh 
         19missing 
         20mkinstalldirs 
         21so_locations 
         22stamp-h* 
         23 
        124.deps 
        225.libs 
         
        1942*.rej 
        2043*.u 
         44*.rc 
         45*.pc 
        2146*~ 
        22 Makefile 
        23 Makefile.in 
        24 core 
        25 gmon.out 
        26 *.pc 
         47*.gz 
         48*.bz2 
         49*.[0-9] 
         50*.html 
         51*.gif 
         52*.css 
         53*.out 
         54 
         55ChangeLog 
         56opensc.conf 
         57xsl-stylesheets 
        2758opensc-config 
         59test-conf 
         60pkcs15-tool 
         61pkcs15-crypt 
         62pkcs15-init 
         63piv-tool 
         64eidenv 
         65opensc-explorer 
         66opensc-tool 
         67rutoken-tool 
         68cardos-info 
         69cryptoflex-tool 
         70netkey-tool 
         71pkcs11-tool 
         72pintest 
         73p15dump 
         74prngtest 
         75base64 
         76lottery 
         77 
  • trunk/src/libopensc/Makefile.am

    r3310 r3405  
    11# Process this file with automake to create Makefile.in 
    22 
    3 includedir = @includedir@/opensc 
     3include $(top_srcdir)/win32/ltrc.inc 
    44 
    55MAINTAINERCLEANFILES = Makefile.in 
    6  
    7 EXTRA_DIST = Makefile.mak libopensc.pc.in libpkcs15init.pc.in libscconf.pc.in  
    8  
    9 INCLUDES = $(CPPFLAGS) $(OPENSSL_CFLAGS) $(OPENCT_CFLAGS) $(PCSC_CFLAGS) \ 
    10         $(LTLIB_CFLAGS) -I$(top_srcdir)/src/common 
    11 AM_LDFLAGS =  
     6CLEANFILES = versioninfo.rc 
     7EXTRA_DIST = Makefile.mak  
    128 
    139bin_SCRIPTS = opensc-config 
     10lib_LTLIBRARIES = libopensc.la 
     11openscinclude_HEADERS = \ 
     12        opensc.h pkcs15.h emv.h \ 
     13        cardctl.h asn1.h log.h ui.h \ 
     14        errors.h types.h compression.h 
     15noinst_HEADERS = cards.h ctbcs.h internal.h esteid.h muscle.h muscle-filesystem.h \ 
     16        internal-winscard.h p15card-helper.h 
     17pkgconfig_DATA = libopensc.pc libpkcs15init.pc libscconf.pc 
    1418 
    15 lib_LTLIBRARIES = libopensc.la 
     19AM_CFLAGS = $(OPTIONAL_OPENSSL_CFLAGS) $(OPTIONAL_OPENCT_CFLAGS) \ 
     20        $(OPTIONAL_ZLIB_CFLAGS) $(LTLIB_CFLAGS)  
     21INCLUDES = -I$(top_srcdir)/src/include -I$(top_srcdir)/src/common 
     22 
    1623libopensc_la_SOURCES = \ 
    1724        sc.c ctx.c ui.c log.c errors.c \ 
     
    3845        pkcs15-actalis.c pkcs15-atrust-acos.c pkcs15-tccardos.c pkcs15-piv.c \ 
    3946        pkcs15-rutoken.c pkcs15-prkey-rutoken.c \ 
    40         compression.c p15card-helper.c 
    41 libopensc_la_LDFLAGS = -version-info @OPENSC_LT_CURRENT@:@OPENSC_LT_REVISION@:@OPENSC_LT_AGE@ 
    42 libopensc_la_LIBADD = @LIBSCCONF@ $(OPENSSL_LIBS) $(OPENCT_LIBS) $(PCSC_LIBS) $(LTLIB_LIBS) 
     47        compression.c p15card-helper.c \ 
     48        \ 
     49        libopensc.exports 
     50if WIN32 
     51nodist_libopensc_la_SOURCES = versioninfo.rc 
     52endif 
     53libopensc_la_LIBADD = $(OPTIONAL_OPENSSL_LIBS) $(OPTIONAL_OPENCT_LIBS) \ 
     54        $(OPTIONAL_ZLIB_LIBS) $(LTLIB_LIBS) \ 
     55        $(top_builddir)/src/scconf/libscconf.la \ 
     56        $(top_builddir)/src/common/libcompat.la 
     57if WIN32 
     58libopensc_la_LIBADD += -lws2_32 
     59endif 
     60libopensc_la_LDFLAGS = $(AM_LDFLAGS) \ 
     61        -version-info @OPENSC_LT_CURRENT@:@OPENSC_LT_REVISION@:@OPENSC_LT_AGE@ \ 
     62        -export-symbols libopensc.exports \ 
     63        -no-undefined 
    4364 
    44 include_HEADERS = \ 
    45         opensc.h pkcs15.h emv.h \ 
    46         cardctl.h asn1.h log.h ui.h \ 
    47         errors.h types.h compression.h 
     65versioninfo.rc: 
     66        sed 's/@@FILE_DESCRIPTION@@/OpenSC Core Library/g' \ 
     67                "$(top_srcdir)/win32/versioninfo.rc" > versioninfo.rc 
    4868 
    49 noinst_HEADERS = cards.h ctbcs.h internal.h esteid.h muscle.h muscle-filesystem.h part10.h p15card-helper.h 
    50  
    51 pkgconfigdir = $(libdir)/pkgconfig 
    52 pkgconfig_DATA = libopensc.pc libpkcs15init.pc libscconf.pc 
     69if WIN32 
     70# def file required for MS users to build library 
     71mylibdir=$(libdir) 
     72if CYGWIN 
     73mylib_DATA=.libs/cygopensc-@OPENSC_LT_CURRENT@.dll.def 
     74.libs/cygopensc-@OPENSC_LT_CURRENT@.dll.def:    libopensc.la 
     75else 
     76mylib_DATA=.libs/libopensc-@OPENSC_LT_CURRENT@.dll.def 
     77.libs/libopensc-@OPENSC_LT_CURRENT@.dll.def:    libopensc.la 
     78endif 
     79endif 
  • trunk/src/libopensc/card-gpk.c

    r3177 r3405  
    2222#include "cardctl.h" 
    2323#include "pkcs15.h" 
    24 #ifdef HAVE_OPENSSL 
     24#ifdef ENABLE_OPENSSL 
    2525#include <stdlib.h> 
    2626#include <string.h> 
     
    19031903        return sc_get_driver(); 
    19041904} 
    1905 #endif /* HAVE_OPENSSL */ 
     1905#endif /* ENABLE_OPENSSL */ 
  • trunk/src/libopensc/card-oberthur.c

    r3206 r3405  
    2727#include "pkcs15.h" 
    2828 
    29 #ifdef HAVE_OPENSSL 
     29#ifdef ENABLE_OPENSSL 
    3030#include <stdlib.h> 
    3131#include <string.h> 
     
    25052505} 
    25062506 
    2507 #endif /* HAVE_OPENSSL */ 
     2507#endif /* ENABLE_OPENSSL */ 
  • trunk/src/libopensc/card-piv.c

    r3292 r3405  
    2424 
    2525#include "internal.h" 
     26 
     27#ifdef ENABLE_OPENSSL 
     28 
    2629#include <ctype.h> 
    2730#include <string.h> 
     
    3336#include "asn1.h" 
    3437#include "cardctl.h" 
    35 #ifdef HAVE_ZLIB_H 
     38#ifdef ENABLE_ZLIB 
    3639#include "compression.h" 
    3740#endif 
     
    743746        /* Potential truncation */ 
    744747        if(compressed) { 
    745 #ifdef HAVE_ZLIB_H 
     748#ifdef ENABLE_ZLIB 
    746749                size_t len = count; 
    747750                u8* newBuf = NULL; 
     
    18031806} 
    18041807#endif 
     1808 
     1809#endif 
  • trunk/src/libopensc/card-rutoken.c

    r3310 r3405  
    2626#include <stdlib.h> 
    2727#include "pkcs15.h" 
     28#if defined(HAVE_INTTYPES_H) 
     29#include <inttypes.h> 
     30#elif defined(HAVE_STDINT_H) 
     31#include <stdint.h> 
     32#elif defined(_MSC_VER) 
     33typedef unsigned __int32 uint32_t; 
     34typedef unsigned __int16 uint16_t; 
     35#else 
     36#warning no uint32_t type available, please contact opensc-devel@opensc-project.org 
     37#endif 
    2838 
    2939#define BIG_ENDIAN_RUTOKEN 
    3040 
    31 #ifdef HAVE_OPENSSL 
     41#ifdef ENABLE_OPENSSL 
    3242#include <openssl/evp.h> 
    3343#include <openssl/rsa.h> 
     
    4353#define ID_RESERVED_CURDF   0x3FFF      /*Reserved ID for current DF*/ 
    4454 
    45 #ifdef HAVE_OPENSSL 
     55#ifdef ENABLE_OPENSSL 
    4656int get_prkey_from_bin(const u8 *data, size_t len, struct sc_pkcs15_prkey **key); 
    4757#endif 
     
    343353{ 
    344354#ifdef BIG_ENDIAN_RUTOKEN 
    345         file->size = pIn[3] + ((u_int16_t)pIn[2])*256; 
    346         file->id = pIn[7] + ((u_int16_t)pIn[6])*256; 
     355        file->size = pIn[3] + ((uint16_t)pIn[2])*256; 
     356        file->id = pIn[7] + ((uint16_t)pIn[6])*256; 
    347357#else 
    348         file->size = pIn[2] + ((u_int16_t)pIn[3])*256; 
    349         file->id = pIn[6] + ((u_int16_t)pIn[7])*256; 
     358        file->size = pIn[2] + ((uint16_t)pIn[3])*256; 
     359        file->id = pIn[6] + ((uint16_t)pIn[7])*256; 
    350360#endif 
    351361 
     
    10701080/*  RSA emulation  */ 
    10711081 
    1072 #ifdef HAVE_OPENSSL 
     1082#ifdef ENABLE_OPENSSL 
    10731083 
    10741084static int rutoken_get_current_fileid(sc_card_t *card, u8 id[2]) 
     
    14161426        rutoken_ops.get_challenge = rutoken_get_challenge; 
    14171427         
    1418 #ifdef HAVE_OPENSSL 
     1428#ifdef ENABLE_OPENSSL 
    14191429        rutoken_ops.decipher = rutoken_decipher; 
    14201430        rutoken_ops.compute_signature = rutoken_compute_signature; 
  • trunk/src/libopensc/compression.c

    r3178 r3405  
    1919 */ 
    2020#include "internal.h" 
    21 #ifdef HAVE_ZLIB_H 
     21#ifdef ENABLE_ZLIB 
    2222#include "compression.h" 
    2323 
     
    180180        } 
    181181} 
    182 #endif /* HAVE_ZLIB_H */ 
     182#endif /* ENABLE_ZLIB */ 
  • trunk/src/libopensc/ctx.c

    r3304 r3405  
    5757        { "flex",       (void *(*)(void)) sc_get_cryptoflex_driver }, 
    5858        { "cyberflex",  (void *(*)(void)) sc_get_cyberflex_driver }, 
    59 #ifdef HAVE_OPENSSL 
     59#ifdef ENABLE_OPENSSL 
    6060        { "gpk",        (void *(*)(void)) sc_get_gpk_driver }, 
    6161#endif 
     
    6969        { "opengpg",    (void *(*)(void)) sc_get_openpgp_driver }, 
    7070        { "jcop",       (void *(*)(void)) sc_get_jcop_driver }, 
    71 #ifdef HAVE_OPENSSL 
     71#ifdef ENABLE_OPENSSL 
    7272        { "oberthur",   (void *(*)(void)) sc_get_oberthur_driver }, 
    7373#endif 
     
    7777        { "emv",        (void *(*)(void)) sc_get_emv_driver }, 
    7878        { "incrypto34", (void *(*)(void)) sc_get_incrypto34_driver }, 
    79 #ifdef HAVE_OPENSSL 
     79#ifdef ENABLE_OPENSSL 
    8080        { "PIV-II",     (void *(*)(void)) sc_get_piv_driver }, 
    8181#endif 
     
    8989 
    9090static const struct _sc_driver_entry internal_reader_drivers[] = { 
    91 #if defined(HAVE_PCSC) 
     91#if defined(ENABLE_PCSC) 
    9292        { "pcsc",       (void *(*)(void)) sc_get_pcsc_driver }, 
    9393#endif 
    9494        { "ctapi",      (void *(*)(void)) sc_get_ctapi_driver }, 
    9595#ifndef _WIN32 
    96 #ifdef HAVE_OPENCT 
     96#ifdef ENABLE_OPENCT 
    9797        { "openct",     (void *(*)(void)) sc_get_openct_driver }, 
    9898#endif 
     
    557557#ifdef _WIN32 
    558558        char temp_path[PATH_MAX]; 
    559         int temp_len; 
     559        DWORD temp_len; 
    560560        long rc; 
    561561        HKEY hKey; 
     
    848848 
    849849        while (1) { 
     850#ifdef _WIN32 
     851                if (mkdir(dirname) >= 0) 
     852#else 
    850853                if (mkdir(dirname, 0700) >= 0) 
     854#endif 
    851855                        break; 
    852856                if (errno != ENOENT 
     
    864868                        break; 
    865869                dirname[j] = '/'; 
     870#ifdef _WIN32 
     871                if (mkdir(dirname) < 0) 
     872#else 
    866873                if (mkdir(dirname, 0700) < 0) 
     874#endif 
    867875                        goto failed; 
    868876        } 
  • trunk/src/libopensc/internal-winscard.h

    r3330 r3405  
    5656#define SCARD_E_NO_READERS_AVAILABLE    0x8010002E /**< Cannot find a smart card reader. */ 
    5757#define SCARD_W_UNRESPONSIVE_CARD       0x80100066 /**< The smart card is not responding to a reset. */ 
     58#define SCARD_W_UNPOWERED_CARD          0x80100067 /**< Power has been removed from the smart card, so that further communication is not possible. */ 
    5859#define SCARD_W_RESET_CARD              0x80100068 /**< The smart card has been reset, so any shared state information is invalid. */ 
    5960#define SCARD_W_REMOVED_CARD            0x80100069 /**< The smart card has been removed, so further communication is not possible. */ 
  • trunk/src/libopensc/internal.h

    r3115 r3405  
    3636#include "cards.h" 
    3737#include <assert.h> 
     38#ifdef _WIN32 
     39#include <windows.h> 
     40#endif 
    3841 
    3942#define SC_FILE_MAGIC                   0x14426950 
  • trunk/src/libopensc/log.c

    r3173 r3405  
    3636#endif 
    3737 
    38 #ifndef __GNUC__ 
    39 void sc_error(sc_context_t *ctx, const char *format, ...) 
     38/* Although not used, we need this for consistent exports */ 
     39void _sc_error(sc_context_t *ctx, const char *format, ...) 
    4040{ 
    4141        va_list ap; 
     
    4646} 
    4747 
    48 void sc_debug(sc_context_t *ctx, const char *format, ...) 
     48/* Although not used, we need this for consistent exports */ 
     49void _sc_debug(sc_context_t *ctx, const char *format, ...) 
    4950{ 
    5051        va_list ap; 
     
    5455        va_end(ap); 
    5556} 
    56  
    57 #endif 
    5857 
    5958void sc_do_log(sc_context_t *ctx, int type, const char *file, int line, const char *func, const char *format, ...) 
  • trunk/src/libopensc/log.h

    r3084 r3405  
    4545 
    4646#else 
    47  
    48 void sc_error(struct sc_context *ctx, const char *format, ...); 
    49 void sc_debug(struct sc_context *ctx, const char *format, ...); 
    50  
     47#define sc_error _sc_error 
     48#define sc_debug _sc_debug 
    5149#endif 
    5250 
     51void _sc_error(struct sc_context *ctx, const char *format, ...); 
     52void _sc_debug(struct sc_context *ctx, const char *format, ...); 
    5353void sc_do_log(struct sc_context *ctx, int type, const char *file, int line, const char *func, const char *format, ...); 
    5454void sc_do_log_va(struct sc_context *ctx, int type, const char *file, int line, const char *func, const char *format, va_list args); 
  • trunk/src/libopensc/opensc-config.in

    r196 r3405  
    1010# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
    1111 
     12version="@VERSION@" 
    1213 
    13 prefix=@prefix@ 
    14 exec_prefix=@exec_prefix@ 
     14prefix="@prefix@" 
     15exec_prefix="@exec_prefix@" 
    1516exec_prefix_set=no 
    1617 
    17 opensc_libs="@OPENSC_LIBS@" 
    18 opensc_cflags="@OPENSC_CFLAGS@" 
    19  
     18libdir="@libdir@" 
     19includedir="@includedir@" 
     20opensc_cflags="" 
     21opensc_libs="-L${libdir} -lopensc" 
    2022 
    2123usage() 
     
    6163      ;; 
    6264    --version) 
    63       echo "@VERSION@" 
     65      echo "${version}" 
    6466      exit 0 
    6567      ;; 
     
    8688 
    8789if test "$echo_cflags" = "yes"; then 
    88     if test "@includedir@" != "/usr/include" ; then 
    89       includes="-I@includedir@" 
    90       for i in $opensc_cflags ; do 
    91         if test "$i" = "-I@includedir@" ; then 
     90    if test "${includedir}" != "/usr/include" ; then 
     91      includes="-I${includedir}" 
     92      for i in ${opensc_cflags} ; do 
     93        if test "$i" = "-I${includedir}" ; then 
    9294          includes="" 
    9395        fi 
  • trunk/src/libopensc/p15card-helper.c

    r3129 r3405  
    1919 */ 
    2020 
     21#include "internal.h" 
     22 
     23#if ENABLE_OPENSSL 
    2124#include "p15card-helper.h" 
    2225#include <opensc/opensc.h> 
     
    341344        return SC_SUCCESS; 
    342345} 
     346 
     347#endif 
  • trunk/src/libopensc/pkcs15-actalis.c

    r2993 r3405  
    3232#include <string.h> 
    3333#include <stdio.h> 
    34 #include "strlcpy.h" 
    35  
    36 #ifdef HAVE_ZLIB_H 
     34#include <compat_strlcpy.h> 
     35 
     36#ifdef ENABLE_ZLIB 
    3737#include <zlib.h> 
    3838#endif 
     
    152152        int r; 
    153153 
    154 #ifdef HAVE_ZLIB_H 
     154#ifdef ENABLE_ZLIB 
    155155        int i; 
    156156        const char *certLabel[] = { 
     
    198198        set_string(&p15card->serial_number, (char *)serial); 
    199199 
    200 #ifdef HAVE_ZLIB_H 
     200#ifdef ENABLE_ZLIB 
    201201        for (i = 0; i < 3; i++) { 
    202202                unsigned char *compCert = NULL, *cert = NULL, size[2]; 
  • trunk/src/libopensc/pkcs15-atrust-acos.c

    r3318 r3405  
    2525#include <string.h> 
    2626#include <stdio.h> 
    27 #include "strlcpy.h" 
     27#include <compat_strlcpy.h> 
    2828 
    2929#define MANU_ID         "A-Trust" 
  • trunk/src/libopensc/pkcs15-esteid.c

    r3141 r3405  
    2929 
    3030#include "esteid.h" 
    31 #include "strlcpy.h" 
     31#include <compat_strlcpy.h> 
    3232 
    3333int sc_pkcs15emu_esteid_init_ex(sc_pkcs15_card_t *, sc_pkcs15emu_opt_t *); 
  • trunk/src/libopensc/pkcs15-gemsafeGPK.c

    r3295 r3405  
    2727#include <string.h> 
    2828#include <stdio.h> 
    29 #include "strlcpy.h" 
     29#include <compat_strlcpy.h> 
    3030 
    3131#define MANU_ID         "GemSAFE on GPK16000" 
  • trunk/src/libopensc/pkcs15-infocamere.c

    r2993 r3405  
    3131#include <string.h> 
    3232#include <stdio.h> 
    33 #include "strlcpy.h" 
    34  
    35 #ifdef HAVE_ZLIB_H 
     33#include <compat_strlcpy.h> 
     34 
     35#ifdef ENABLE_ZLIB 
    3636#include <zlib.h> 
    3737#endif 
     
    487487} 
    488488 
    489 #ifdef HAVE_ZLIB_H 
     489#ifdef ENABLE_ZLIB 
    490490 
    491491static const u8 ATR_1400[] = 
     
    840840        if (memcmp(p15card->card->atr, ATR_1600, sizeof(ATR_1600)) == 0) 
    841841                return infocamere_1600_init(p15card); 
    842 #ifdef HAVE_ZLIB_H 
     842#ifdef ENABLE_ZLIB 
    843843        else if (memcmp(p15card->card->atr, ATR_1400, sizeof(ATR_1400)) == 
    844844                 0) 
  • trunk/src/libopensc/pkcs15-openpgp.c

    r2993 r3405  
    2727#include <stdio.h> 
    2828#include <assert.h> 
    29 #include "strlcpy.h" 
     29#include <compat_strlcpy.h> 
    3030 
    3131int sc_pkcs15emu_openpgp_init_ex(sc_pkcs15_card_t *, sc_pkcs15emu_opt_t *); 
  • trunk/src/libopensc/pkcs15-piv.c

    r3292 r3405  
    2424 */ 
    2525 
     26#include "internal.h" 
    2627#include <stdlib.h> 
    2728#include <string.h> 
     
    3233#include <opensc/cardctl.h> 
    3334#include <opensc/cards.h> 
    34 #include <openssl/bio.h> 
    35 #include <openssl/rsa.h> 
    36 #include <openssl/pem.h> 
    3735 
    3836#define MANU_ID         "piv_II " 
  • trunk/src/libopensc/pkcs15-postecert.c

    r2993 r3405  
    2727#include <string.h> 
    2828#include <stdio.h> 
    29 #include "strlcpy.h" 
     29#include <compat_strlcpy.h> 
    3030 
    3131int sc_pkcs15emu_postecert_init_ex(sc_pkcs15_card_t *, sc_pkcs15emu_opt_t *); 
  • trunk/src/libopensc/pkcs15-prkey-rutoken.c

    r3312 r3405  
    2929#include <opensc/opensc.h> 
    3030#include <opensc/pkcs15.h> 
     31#if defined(HAVE_INTTYPES_H) 
     32#include <inttypes.h> 
     33#elif defined(HAVE_STDINT_H) 
     34#include <stdint.h> 
     35#elif defined(_MSC_VER) 
     36typedef unsigned __int32 uint32_t; 
     37typedef unsigned __int16 uint16_t; 
     38#else 
     39#warning no uint32_t type available, please contact opensc-devel@opensc-project.org 
     40#endif 
    3141 
    3242/*  BLOB definition  */ 
    3343 
    3444typedef struct _RSAPUBKEY { 
    35         u_int32_t magic; 
    36         u_int32_t bitlen; 
    37         u_int32_t pubexp; 
     45        uint32_t magic; 
     46        uint32_t bitlen; 
     47        uint32_t pubexp; 
    3848} RSAPUBKEY; 
    3949 
     
    4151        u8 bType; 
    4252        u8 bVersion; 
    43         u_int16_t reserved; 
    44         u_int32_t aiKeyAlg; 
     53        uint16_t reserved; 
     54        uint32_t aiKeyAlg; 
    4555} BLOBHEADER; 
    4656 
     
    98108        tmp += sizeof(pr_blob->rsapubkey); 
    99109 
    100         u_int32_t bitlen = pr_blob->rsapubkey.bitlen; 
     110        uint32_t bitlen = pr_blob->rsapubkey.bitlen; 
    101111 
    102112        len += bitlen/8 * 2  +  bitlen/16 * 5; 
     
    139149{ 
    140150        size_t n; 
    141         const u_int32_t bitlen = key->modulus.len*8; 
     151        const uint32_t bitlen = key->modulus.len*8; 
    142152 
    143153        if (    key->modulus.len != bitlen/8 
     
    167177        for (n=0; n < key->exponent.len  &&  n < sizeof(pr_blob->rsapubkey.pubexp); ++n) 
    168178                pr_blob->rsapubkey.pubexp +=  
    169                         (u_int32_t)key->exponent.data[key->exponent.len - n - 1] << 8*n; 
     179                        (uint32_t)key->exponent.data[key->exponent.len - n - 1] << 8*n; 
    170180 
    171181        pr_blob->modulus = malloc(bitlen/8); 
     
    206216        static const u8 Exp[3] = { 0x01, 0x00, 0x01 }; /* big endian */ 
    207217 
    208         const u_int32_t bitlen = pr_blob->rsapubkey.bitlen; 
     218        const uint32_t bitlen = pr_blob->rsapubkey.bitlen; 
    209219 
    210220        key->modulus.data = malloc(bitlen/8); 
     
    306316static int clean_prkey_private_blob(const PRIVATEKEYBLOB* pr_blob) 
    307317{ 
    308         const u_int32_t bitlen = pr_blob->rsapubkey.bitlen; 
     318        const uint32_t bitlen = pr_blob->rsapubkey.bitlen; 
    309319 
    310320        memset(pr_blob->modulus, 0, bitlen/8); 
     
    344354} 
    345355 
    346 int get_bin_from_prkey(const struct sc_pkcs15_prkey_rsa *rsa, u8 *key, size_t *keysize) 
     356int sc_rutoken_get_bin_from_prkey(const struct sc_pkcs15_prkey_rsa *rsa, u8 *key, size_t *keysize) 
    347357{ 
    348358        int r = -1; 
  • trunk/src/libopensc/pkcs15-starcert.c

    r3178 r3405  
    2424#include <string.h> 
    2525#include <stdio.h> 
    26 #include "strlcpy.h" 
     26#include <compat_strlcpy.h> 
    2727 
    2828#define MANU_ID         "Giesecke & Devrient GmbH" 
  • trunk/src/libopensc/pkcs15-tcos.c

    r3309 r3405  
    2626#include <string.h> 
    2727#include <stdio.h> 
    28 #include "strlcpy.h" 
     28#include <compat_strlcpy.h> 
    2929 
    3030static int insert_cert( 
  • trunk/src/libopensc/pkcs15-wrap.c

    r2815 r3405  
    2121#include "internal.h" 
    2222#include "pkcs15.h" 
    23 #ifdef HAVE_OPENSSL 
     23#ifdef ENABLE_OPENSSL 
    2424#include <openssl/evp.h> 
    2525#include <openssl/rand.h> 
     
    4040 
    4141 
    42 #ifndef HAVE_OPENSSL 
     42#ifndef ENABLE_OPENSSL 
    4343int 
    4444sc_pkcs15_wrap_data(sc_context_t *ctx, 
     
    5959} 
    6060 
    61 #else /* HAVE_OPENSSL */ 
     61#else /* ENABLE_OPENSSL */ 
    6262 
    6363static int 
     
    247247        return r; 
    248248} 
    249 #endif /* HAVE_OPENSSL */ 
     249#endif /* ENABLE_OPENSSL */ 
    250250 
    251251/* 
  • trunk/src/libopensc/reader-openct.c

    r3177 r3405  
    66 
    77#include "internal.h" 
    8 #ifdef HAVE_OPENCT 
     8#ifdef ENABLE_OPENCT 
    99#include <errno.h> 
    1010#include <stdlib.h> 
     
    492492} 
    493493 
    494 #endif  /* HAVE_OPENCT */ 
     494#endif  /* ENABLE_OPENCT */ 
  • trunk/src/libopensc/reader-pcsc.c

    r3386 r3405  
    2020 
    2121#include "internal.h" 
    22 #ifdef HAVE_PCSC 
     22#ifdef ENABLE_PCSC 
    2323#include "ctbcs.h" 
    2424#include <assert.h> 
     
    2626#include <string.h> 
    2727#include <time.h> 
    28 #ifdef PCSC_INCLUDES_IN_PCSC 
    29 #include <PCSC/wintypes.h> 
    30 #include <PCSC/winscard.h> 
    31 #else 
    32 #include <winscard.h> 
    33 #endif 
     28#include <ltdl.h> 
    3429 
    3530#ifdef _WIN32 
    36 #include <Winsock.h> 
    37 #include "part10.h" 
    38 #define PINPAD_ENABLED 
     31#include <winsock2.h> 
    3932#else 
    4033#include <arpa/inet.h> 
    4134#endif 
    42 #ifdef HAVE_READER_H 
    43 #include <reader.h> 
    44 #ifdef HOST_TO_CCID_32 
    45 #define PINPAD_ENABLED 
    46 #endif 
    47 #endif 
     35 
     36#include "internal-winscard.h" 
    4837 
    4938/* Default timeout value for SCardGetStatusChange 
     
    6049#undef SCARD_PROTOCOL_ANY 
    6150#define SCARD_PROTOCOL_ANY (SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1) 
    62 #ifdef _WIN32 
    63  
    6451/* Error printing */ 
    6552#define PCSC_ERROR(ctx, desc, rv) sc_error(ctx, desc ": %lx\n", rv); 
    66  
    67 #else 
    68  
    69 #define PCSC_ERROR(ctx, desc, rv) sc_error(ctx, desc ": %s\n", pcsc_stringify_error(rv)); 
    70 #endif 
    7153 
    7254/* Utility for handling big endian IOCTL codes. */ 
     
    8668        int connect_reset; 
    8769        int transaction_reset; 
    88          
     70        const char *library_name; 
     71        lt_dlhandle dlhandle; 
     72        SCardEstablishContext_t SCardEstablishContext; 
     73        SCardReleaseContext_t SCardReleaseContext; 
     74        SCardConnect_t SCardConnect; 
     75        SCardReconnect_t SCardReconnect; 
     76        SCardDisconnect_t SCardDisconnect; 
     77        SCardBeginTransaction_t SCardBeginTransaction; 
     78        SCardEndTransaction_t SCardEndTransaction; 
     79        SCardStatus_t SCardStatus; 
     80        SCardGetStatusChange_t SCardGetStatusChange; 
     81        SCardControlOLD_t SCardControlOLD; 
     82        SCardControl_t SCardControl; 
     83        SCardTransmit_t SCardTransmit; 
     84        SCardListReaders_t SCardListReaders; 
    8985}; 
    9086 
    9187struct pcsc_private_data { 
    92         SCARDCONTEXT pcsc_ctx; 
    9388        char *reader_name; 
    9489        struct pcsc_global_private_data *gpriv; 
     
    169164                         unsigned long control) 
    170165{ 
     166        struct pcsc_private_data *priv = GET_PRIV_DATA(reader); 
    171167        SCARD_IO_REQUEST sSendPci, sRecvPci; 
    172168        DWORD dwSendLength, dwRecvLength; 
     
    191187 
    192188        if (!control) { 
    193                 rv = SCardTransmit(card, &sSendPci, sendbuf, dwSendLength, 
     189                rv = priv->gpriv->SCardTransmit(card, &sSendPci, sendbuf, dwSendLength, 
    194190                                   &sRecvPci, recvbuf, &dwRecvLength); 
    195191        } else { 
    196 #ifdef HAVE_PCSC_OLD 
    197                 rv = SCardControl(card, sendbuf, dwSendLength, 
     192                if (priv->gpriv->SCardControlOLD != NULL) { 
     193                        rv = priv->gpriv->SCardControlOLD(card, sendbuf, dwSendLength, 
    198194                                  recvbuf, &dwRecvLength); 
    199 #else 
    200                 rv = SCardControl(card, (DWORD) control, sendbuf, dwSendLength, 
     195                } 
     196                else { 
     197                        rv = priv->gpriv->SCardControl(card, (DWORD) control, sendbuf, dwSendLength, 
    201198                                  recvbuf, dwRecvLength, &dwRecvLength); 
    202 #endif 
     199                } 
    203200        } 
    204201 
     
    291288        } 
    292289 
    293         ret = SCardGetStatusChange(priv->pcsc_ctx, SC_STATUS_TIMEOUT, &pslot->reader_state, 1); 
     290        ret = priv->gpriv->SCardGetStatusChange(priv->gpriv->pcsc_ctx, SC_STATUS_TIMEOUT, &pslot->reader_state, 1); 
    294291        if (ret == (LONG)SCARD_E_TIMEOUT) { /* timeout: nothing changed */ 
    295292                slot->flags &= ~SCARD_STATE_CHANGED; 
     
    334331                                DWORD readers_len = 0, state, prot, atr_len = 32; 
    335332                                unsigned char atr[32]; 
    336                                 LONG rv = SCardStatus(pslot->pcsc_card, NULL, &readers_len, 
     333                                LONG rv = priv->gpriv->SCardStatus(pslot->pcsc_card, NULL, &readers_len, 
    337334                                        &state, &prot, atr, &atr_len); 
    338335                                if (rv == (LONG)SCARD_W_REMOVED_CARD) 
     
    368365                               unsigned int *event, int timeout) 
    369366{ 
     367        struct pcsc_private_data *priv = GET_PRIV_DATA(readers[0]); 
    370368        sc_context_t *ctx; 
    371369        SCARDCONTEXT pcsc_ctx; 
     
    394392        /* Find out the current status */ 
    395393        ctx = readers[0]->ctx; 
    396         pcsc_ctx = GET_PRIV_DATA(readers[0])->pcsc_ctx; 
     394        pcsc_ctx = priv->gpriv->pcsc_ctx; 
    397395        for (i = 0; i < nslots; i++) { 
    398396                struct pcsc_private_data *priv = GET_PRIV_DATA(readers[i]); 
     
    403401 
    404402                /* Can we handle readers from different PCSC contexts? */ 
    405                 if (priv->pcsc_ctx != pcsc_ctx) 
     403                if (priv->gpriv->pcsc_ctx != pcsc_ctx) 
    406404                        return SC_ERROR_INVALID_ARGUMENTS; 
    407405        } 
    408406 
    409         ret = SCardGetStatusChange(pcsc_ctx, 0, rgReaderStates, nslots); 
     407        ret = priv->gpriv->SCardGetStatusChange(pcsc_ctx, 0, rgReaderStates, nslots); 
    410408        if (ret != 0) { 
    411409                PCSC_ERROR(ctx, "SCardGetStatusChange(1) failed", ret); 
     
    457455                } 
    458456 
    459                 ret = SCardGetStatusChange(pcsc_ctx, 1000 * delta, 
     457                ret = priv->gpriv->SCardGetStatusChange(pcsc_ctx, 1000 * delta, 
    460458                                           rgReaderStates, nslots); 
    461459                if (ret == (LONG) SCARD_E_TIMEOUT) { 
     
    490488        pslot->locked = 0; 
    491489         
    492         rv = SCardReconnect(pslot->pcsc_card, 
     490        rv = priv->gpriv->SCardReconnect(pslot->pcsc_card, 
    493491                            priv->gpriv->connect_exclusive ? SCARD_SHARE_EXCLUSIVE : SCARD_SHARE_SHARED, 
    494492                            SCARD_PROTOCOL_ANY, reset ? SCARD_UNPOWER_CARD : SCARD_LEAVE_CARD, &active_proto); 
     
    500498                protocol = opensc_proto_to_pcsc(protocol); 
    501499                if (pcsc_proto_to_opensc(active_proto) != protocol) { 
    502                  rv = SCardReconnect(pslot->pcsc_card, 
     500                 rv = priv->gpriv->SCardReconnect(pslot->pcsc_card, 
    503501                                     priv->gpriv->connect_exclusive ? SCARD_SHARE_EXCLUSIVE : SCARD_SHARE_SHARED, 
    504502                                     protocol, SCARD_UNPOWER_CARD, &active_proto); 
     
    523521        struct pcsc_slot_data *pslot = GET_SLOT_DATA(slot); 
    524522        int r; 
    525 #ifdef PINPAD_ENABLED 
    526523        u8 feature_buf[256]; 
    527524        DWORD i, feature_len; 
    528525        PCSC_TLV_STRUCTURE *pcsc_tlv; 
    529 #endif 
    530526 
    531527        r = refresh_slot_attributes(reader, slot); 
     
    536532 
    537533        /* Always connect with whatever protocol possible */ 
    538         rv = SCardConnect(priv->pcsc_ctx, priv->reader_name, 
     534        rv = priv->gpriv->SCardConnect(priv->gpriv->pcsc_ctx, priv->reader_name, 
    539535                          priv->gpriv->connect_exclusive ? SCARD_SHARE_EXCLUSIVE : SCARD_SHARE_SHARED, 
    540536                          SCARD_PROTOCOL_ANY, &card_handle, &active_proto); 
     
    566562 
    567563        /* check for pinpad support */ 
    568 #ifdef PINPAD_ENABLED 
    569         sc_debug(reader->ctx, "Requesting reader features ... "); 
    570  
    571         rv = SCardControl(pslot->pcsc_card, CM_IOCTL_GET_FEATURE_REQUEST, NULL, 
    572                           0, feature_buf, sizeof(feature_buf), &feature_len); 
    573         if (rv == SCARD_S_SUCCESS) { 
    574                  
    575                 if (!(feature_len % sizeof(PCSC_TLV_STRUCTURE))) { 
    576                         char *log_disabled = "but it's disabled in configuration file"; 
    577                         /* get the number of elements instead of the complete size */ 
    578                         feature_len /= sizeof(PCSC_TLV_STRUCTURE); 
    579  
    580                         pcsc_tlv = (PCSC_TLV_STRUCTURE *)feature_buf; 
    581                         for (i = 0; i < feature_len; i++) { 
    582                                 if (pcsc_tlv[i].tag == FEATURE_VERIFY_PIN_DIRECT) { 
    583                                         pslot->verify_ioctl = ntohl(pcsc_tlv[i].value); 
    584                                 } else if (pcsc_tlv[i].tag == FEATURE_VERIFY_PIN_START) { 
    585                                         pslot->verify_ioctl_start = ntohl(pcsc_tlv[i].value); 
    586                                 } else if (pcsc_tlv[i].tag == FEATURE_VERIFY_PIN_FINISH) { 
    587                                         pslot->verify_ioctl_finish = ntohl(pcsc_tlv[i].value); 
    588                                 } else if (pcsc_tlv[i].tag == FEATURE_MODIFY_PIN_DIRECT) { 
    589                                         pslot->modify_ioctl = ntohl(pcsc_tlv[i].value); 
    590                                 } else if (pcsc_tlv[i].tag == FEATURE_MODIFY_PIN_START) { 
    591                                         pslot->modify_ioctl_start = ntohl(pcsc_tlv[i].value); 
    592                                 } else if (pcsc_tlv[i].tag == FEATURE_MODIFY_PIN_FINISH) { 
    593                                         pslot->modify_ioctl_finish = ntohl(pcsc_tlv[i].value); 
    594                                 } else { 
    595                                         sc_debug(reader->ctx, "Reader pinpad feature: %02x not supported", pcsc_tlv[i].tag); 
    596                                 } 
    597                         } 
     564        if (priv->gpriv->SCardControl != NULL) { 
     565                sc_debug(reader->ctx, "Requesting reader features ... "); 
     566 
     567                rv = priv->gpriv->SCardControl(pslot->pcsc_card, CM_IOCTL_GET_FEATURE_REQUEST, NULL, 
     568                                  0, feature_buf, sizeof(feature_buf), &feature_len); 
     569                if (rv == SCARD_S_SUCCESS) { 
    598570                         
    599                         /* Set slot capabilities based on detected IOCTLs */ 
    600                         if (pslot->verify_ioctl || (pslot->verify_ioctl_start && pslot->verify_ioctl_finish)) { 
    601                                         char *log_text = "Reader supports pinpad PIN verification"; 
    602                                         if (priv->gpriv->enable_pinpad) { 
    603                                                 sc_debug(reader->ctx, log_text); 
    604                                                 slot->capabilities |= SC_SLOT_CAP_PIN_PAD; 
     571                        if (!(feature_len % sizeof(PCSC_TLV_STRUCTURE))) { 
     572                                char *log_disabled = "but it's disabled in configuration file"; 
     573                                /* get the number of elements instead of the complete size */ 
     574                                feature_len /= sizeof(PCSC_TLV_STRUCTURE); 
     575 
     576                                pcsc_tlv = (PCSC_TLV_STRUCTURE *)feature_buf; 
     577                                for (i = 0; i < feature_len; i++) { 
     578                                        if (pcsc_tlv[i].tag == FEATURE_VERIFY_PIN_DIRECT) { 
     579                                                pslot->verify_ioctl = ntohl(pcsc_tlv[i].value); 
     580                                        } else if (pcsc_tlv[i].tag == FEATURE_VERIFY_PIN_START) { 
     581                                                pslot->verify_ioctl_start = ntohl(pcsc_tlv[i].value); 
     582                                        } else if (pcsc_tlv[i].tag == FEATURE_VERIFY_PIN_FINISH) { 
     583                                                pslot->verify_ioctl_finish = ntohl(pcsc_tlv[i].value); 
     584                                        } else if (pcsc_tlv[i].tag == FEATURE_MODIFY_PIN_DIRECT) { 
     585                                                pslot->modify_ioctl = ntohl(pcsc_tlv[i].value); 
     586                                        } else if (pcsc_tlv[i].tag == FEATURE_MODIFY_PIN_START) { 
     587                                                pslot->modify_ioctl_start = ntohl(pcsc_tlv[i].value); 
     588                                        } else if (pcsc_tlv[i].tag == FEATURE_MODIFY_PIN_FINISH) { 
     589                                                pslot->modify_ioctl_finish = ntohl(pcsc_tlv[i].value); 
    605590                                        } else { 
    606                                                 sc_debug(reader->ctx, "%s %s", log_text, log_disabled); 
    607                                         } 
    608                         } 
    609                          
    610                         if (pslot->modify_ioctl || (pslot->modify_ioctl_start && pslot->modify_ioctl_finish)) { 
    611                                         char *log_text = "Reader supports pinpad PIN modification"; 
    612                                         if (priv->gpriv->enable_pinpad) { 
    613                                                 sc_debug(reader->ctx, log_text); 
    614                                                 slot->capabilities |= SC_SLOT_CAP_PIN_PAD; 
    615                                         } else { 
    616                                                 sc_debug(reader->ctx, "%s %s", log_text, log_disabled); 
     591                                                sc_debug(reader->ctx, "Reader pinpad feature: %02x not supported", pcsc_tlv[i].tag); 
    617592                                        } 
    618593                                } 
    619                 } else 
    620                         sc_debug(reader->ctx, "Inconsistent TLV from reader!"); 
    621         } else { 
    622                 sc_debug(reader->ctx, "SCardControl failed %d", rv); 
    623         } 
    624 #endif /* PINPAD_ENABLED */ 
     594                                 
     595                                /* Set slot capabilities based on detected IOCTLs */ 
     596                                if (pslot->verify_ioctl || (pslot->verify_ioctl_start && pslot->verify_ioctl_finish)) { 
     597                                                char *log_text = "Reader supports pinpad PIN verification"; 
     598                                                if (priv->gpriv->enable_pinpad) { 
     599                                                        sc_debug(reader->ctx, log_text); 
     600                                                        slot->capabilities |= SC_SLOT_CAP_PIN_PAD; 
     601                                                } else { 
     602                                                        sc_debug(reader->ctx, "%s %s", log_text, log_disabled); 
     603                                                } 
     604                                } 
     605                                 
     606                                if (pslot->modify_ioctl || (pslot->modify_ioctl_start && pslot->modify_ioctl_finish)) { 
     607                                                char *log_text = "Reader supports pinpad PIN modification"; 
     608                                                if (priv->gpriv->enable_pinpad) { 
     609                                                        sc_debug(reader->ctx, log_text); 
     610                                                        slot->capabilities |= SC_SLOT_CAP_PIN_PAD; 
     611                                                } else { 
     612                                                        sc_debug(reader->ctx, "%s %s", log_text, log_disabled); 
     613                                                } 
     614                                        } 
     615                        } else 
     616                                sc_debug(reader->ctx, "Inconsistent TLV from reader!"); 
     617                } else { 
     618                        sc_debug(reader->ctx, "SCardControl failed %d", rv); 
     619                } 
     620        } 
    625621        return SC_SUCCESS; 
    626622} 
     
    631627        struct pcsc_private_data *priv = GET_PRIV_DATA(reader); 
    632628 
    633         SCardDisconnect(pslot->pcsc_card, priv->gpriv->transaction_reset ? 
     629        priv->gpriv->SCardDisconnect(pslot->pcsc_card, priv->gpriv->transaction_reset ? 
    634630                  SCARD_RESET_CARD : SCARD_LEAVE_CARD); 
    635631        memset(pslot, 0, sizeof(*pslot)); 
     
    642638        long rv; 
    643639        struct pcsc_slot_data *pslot = GET_SLOT_DATA(slot); 
     640        struct pcsc_private_data *priv = GET_PRIV_DATA(reader); 
    644641 
    645642        SC_FUNC_CALLED(reader->ctx, 3); 
    646643        assert(pslot != NULL); 
    647644 
    648         rv = SCardBeginTransaction(pslot->pcsc_card); 
     645        rv = priv->gpriv->SCardBeginTransaction(pslot->pcsc_card); 
    649646 
    650647        if ((unsigned int)rv == SCARD_W_RESET_CARD) { 
     
    657654                /* Now try to begin a new transaction after we reconnected and we fail if 
    658655                 some other program was faster to lock the reader */ 
    659                 rv = SCardBeginTransaction(pslot->pcsc_card); 
     656                rv = priv->gpriv->SCardBeginTransaction(pslot->pcsc_card); 
    660657        } 
    661658 
     
    679676        assert(pslot != NULL); 
    680677 
    681         rv = SCardEndTransaction(pslot->pcsc_card, priv->gpriv->transaction_reset ? 
     678        rv = priv->gpriv->SCardEndTransaction(pslot->pcsc_card, priv->gpriv->transaction_reset ? 
    682679                           SCARD_RESET_CARD : SCARD_LEAVE_CARD); 
    683680 
     
    736733        LONG rv; 
    737734        DWORD reader_buf_size; 
    738         char *reader_buf, *p; 
     735        char *reader_buf = NULL, *p; 
    739736        const char *mszGroups = NULL; 
    740         SCARDCONTEXT pcsc_ctx; 
    741737        int r; 
    742738        struct pcsc_global_private_data *gpriv; 
    743         scconf_block *conf_block; 
    744  
    745         rv = SCardEstablishContext(SCARD_SCOPE_USER, 
    746                               NULL, NULL, &pcsc_ctx); 
    747         if (rv != SCARD_S_SUCCESS) 
    748                 return pcsc_ret_to_error(rv); 
    749         rv = SCardListReaders(pcsc_ctx, NULL, NULL, 
    750                               (LPDWORD) &reader_buf_size); 
    751         if (rv != SCARD_S_SUCCESS || reader_buf_size < 2) { 
    752                 SCardReleaseContext(pcsc_ctx); 
    753                 return pcsc_ret_to_error(rv);   /* No readers configured */ 
    754         } 
    755         gpriv = (struct pcsc_global_private_data *) malloc(sizeof(struct pcsc_global_private_data)); 
     739        scconf_block *conf_block = NULL; 
     740        int ret = SC_ERROR_INTERNAL; 
     741 
     742        *reader_data = NULL; 
     743 
     744        gpriv = (struct pcsc_global_private_data *) calloc(1, sizeof(struct pcsc_global_private_data)); 
    756745        if (gpriv == NULL) { 
    757                 SCardReleaseContext(pcsc_ctx); 
    758                 return SC_ERROR_OUT_OF_MEMORY; 
    759         } 
    760         gpriv->pcsc_ctx = pcsc_ctx; 
     746                ret = SC_ERROR_OUT_OF_MEMORY; 
     747                goto out; 
     748        } 
    761749 
    762750        /* Defaults */ 
     
    765753        gpriv->transaction_reset = 0; 
    766754        gpriv->enable_pinpad = 0; 
     755        gpriv->library_name = PCSC_DEFAULT_LIBRARY_NAME; 
    767756         
    768757        conf_block = sc_get_conf_block(ctx, "reader_driver", "pcsc", 1); 
     
    776765                gpriv->enable_pinpad = 
    777766                    scconf_get_bool(conf_block, "enable_pinpad", gpriv->enable_pinpad); 
    778         } 
    779         *reader_data = gpriv; 
     767                gpriv->library_name = 
     768                    scconf_get_str(conf_block, "library_name", gpriv->library_name); 
     769        } 
     770 
     771        gpriv->dlhandle = lt_dlopen(gpriv->library_name); 
     772        if (gpriv->dlhandle == NULL) { 
     773                ret = SC_ERROR_CANNOT_LOAD_MODULE; 
     774                goto out; 
     775        } 
     776 
     777        gpriv->SCardEstablishContext = (SCardEstablishContext_t)lt_dlsym(gpriv->dlhandle, "SCardEstablishContext"); 
     778        gpriv->SCardReleaseContext = (SCardReleaseContext_t)lt_dlsym(gpriv->dlhandle, "SCardReleaseContext"); 
     779        gpriv->SCardConnect = (SCardConnect_t)lt_dlsym(gpriv->dlhandle, "SCardConnect"); 
     780        gpriv->SCardReconnect = (SCardReconnect_t)lt_dlsym(gpriv->dlhandle, "SCardReconnect"); 
     781        gpriv->SCardDisconnect = (SCardDisconnect_t)lt_dlsym(gpriv->dlhandle, "SCardDisconnect"); 
     782        gpriv->SCardBeginTransaction = (SCardBeginTransaction_t)lt_dlsym(gpriv->dlhandle, "SCardBeginTransaction"); 
     783        gpriv->SCardEndTransaction = (SCardEndTransaction_t)lt_dlsym(gpriv->dlhandle, "SCardEndTransaction"); 
     784        gpriv->SCardStatus = (SCardStatus_t)lt_dlsym(gpriv->dlhandle, "SCardStatus"); 
     785        gpriv->SCardGetStatusChange = (SCardGetStatusChange_t)lt_dlsym(gpriv->dlhandle, "SCardGetStatusChange"); 
     786        gpriv->SCardTransmit = (SCardTransmit_t)lt_dlsym(gpriv->dlhandle, "SCardTransmit"); 
     787        gpriv->SCardListReaders = (SCardListReaders_t)lt_dlsym(gpriv->dlhandle, "SCardListReaders"); 
     788 
     789        if (gpriv->SCardConnect == NULL) 
     790                gpriv->SCardConnect = (SCardConnect_t)lt_dlsym(gpriv->dlhandle, "SCardConnectA"); 
     791        if (gpriv->SCardStatus == NULL) 
     792                gpriv->SCardStatus = (SCardStatus_t)lt_dlsym(gpriv->dlhandle, "SCardStatusA"); 
     793        if (gpriv->SCardGetStatusChange == NULL) 
     794                gpriv->SCardGetStatusChange = (SCardGetStatusChange_t)lt_dlsym(gpriv->dlhandle, "SCardGetStatusChangeA"); 
     795        if (gpriv->SCardListReaders == NULL) 
     796                gpriv->SCardListReaders = (SCardListReaders_t)lt_dlsym(gpriv->dlhandle, "SCardListReadersA"); 
     797         
     798        /* If we have SCardGetAttrib it is correct API */ 
     799        if (lt_dlsym(gpriv->dlhandle, "SCardGetAttrib") != NULL) 
     800                gpriv->SCardControl = (SCardControl_t)lt_dlsym(gpriv->dlhandle, "SCardControl"); 
     801        else 
     802                gpriv->SCardControlOLD = (SCardControlOLD_t)lt_dlsym(gpriv->dlhandle, "SCardControl"); 
     803 
     804        if ( 
     805                gpriv->SCardReleaseContext == NULL || 
     806                gpriv->SCardConnect == NULL || 
     807                gpriv->SCardReconnect == NULL || 
     808                gpriv->SCardDisconnect == NULL || 
     809                gpriv->SCardBeginTransaction == NULL || 
     810                gpriv->SCardEndTransaction == NULL || 
     811                gpriv->SCardStatus == NULL || 
     812                gpriv->SCardGetStatusChange == NULL || 
     813                (gpriv->SCardControl == NULL && gpriv->SCardControlOLD == NULL) || 
     814                gpriv->SCardTransmit == NULL || 
     815                gpriv->SCardListReaders == NULL 
     816        ) { 
     817                ret = SC_ERROR_CANNOT_LOAD_MODULE; 
     818                goto out; 
     819        } 
     820 
     821        rv = gpriv->SCardEstablishContext(SCARD_SCOPE_USER, 
     822                              NULL, NULL, &gpriv->pcsc_ctx); 
     823        if (rv != SCARD_S_SUCCESS) { 
     824                ret = pcsc_ret_to_error(rv); 
     825                goto out; 
     826        } 
     827        rv = gpriv->SCardListReaders(gpriv->pcsc_ctx, NULL, NULL, 
     828                              (LPDWORD) &reader_buf_size); 
     829        if (rv != SCARD_S_SUCCESS || reader_buf_size < 2) { 
     830                ret = pcsc_ret_to_error(rv);    /* No readers configured */ 
     831                goto out; 
     832        } 
    780833 
    781834        reader_buf = (char *) malloc(sizeof(char) * reader_buf_size); 
    782835        if (!reader_buf) { 
    783                 free(gpriv); 
    784                 *reader_data = NULL; 
    785                 SCardReleaseContext(pcsc_ctx); 
    786                 return SC_ERROR_OUT_OF_MEMORY; 
    787         } 
    788         rv = SCardListReaders(pcsc_ctx, mszGroups, reader_buf, 
     836                ret = SC_ERROR_OUT_OF_MEMORY; 
     837                goto out; 
     838        } 
     839        rv = gpriv->SCardListReaders(gpriv->pcsc_ctx, mszGroups, reader_buf, 
    789840                              (LPDWORD) &reader_buf_size); 
    790841        if (rv != SCARD_S_SUCCESS) { 
    791                 free(reader_buf); 
    792                 free(gpriv); 
    793                 *reader_data = NULL; 
    794                 SCardReleaseContext(pcsc_ctx); 
    795                 return pcsc_ret_to_error(rv); 
     842                ret = pcsc_ret_to_error(rv); 
     843                goto out; 
    796844        } 
    797845        p = reader_buf; 
     
    818866                reader->name = strdup(p); 
    819867                priv->gpriv = gpriv; 
    820                 priv->pcsc_ctx = pcsc_ctx; 
    821868                priv->reader_name = strdup(p); 
    822869                r = _sc_add_reader(ctx, reader); 
     
    837884                while (*p++ != 0); 
    838885        } while (p < (reader_buf + reader_buf_size - 1)); 
    839         free(reader_buf); 
     886 
     887        *reader_data = gpriv; 
     888        gpriv = NULL; 
     889        ret = SC_SUCCESS; 
     890 
     891out: 
     892        if (ret != SC_SUCCESS) { 
     893                if (gpriv->pcsc_ctx != 0) 
     894                        gpriv->SCardReleaseContext(gpriv->pcsc_ctx); 
     895                if (reader_buf != NULL) 
     896                        free(reader_buf); 
     897                if (gpriv->dlhandle != NULL) 
     898                        lt_dlclose(gpriv->dlhandle); 
     899                if (gpriv != NULL) 
     900                        free(gpriv); 
     901        } 
    840902 
    841903        return 0; 
     
    847909 
    848910        if (priv) { 
    849                 SCardReleaseContext(priv->pcsc_ctx); 
     911                priv->SCardReleaseContext(priv->pcsc_ctx); 
     912                lt_dlclose(priv->dlhandle); 
    850913                free(priv); 
    851914        } 
     
    888951 */ 
    889952 
    890 #ifdef PINPAD_ENABLED 
    891953/* Local definitions */ 
    892954#define SC_CCID_PIN_TIMEOUT        30 
     
    10851147} 
    10861148 
    1087 #endif 
    10881149/* Do the PIN command */ 
    10891150static int 
     
    10911152             struct sc_pin_cmd_data *data) 
    10921153{ 
    1093 #ifdef PINPAD_ENABLED 
     1154        struct pcsc_private_data *priv = GET_PRIV_DATA(reader); 
    10941155        u8 rbuf[SC_MAX_APDU_BUFFER_SIZE], sbuf[SC_MAX_APDU_BUFFER_SIZE]; 
    10951156        char dbuf[SC_MAX_APDU_BUFFER_SIZE * 3]; 
     
    11021163        SC_FUNC_CALLED(reader->ctx, 3); 
    11031164        assert(pslot != NULL); 
     1165 
     1166        if (priv->gpriv->SCardControl == NULL) 
     1167                return SC_ERROR_NOT_SUPPORTED; 
    11041168 
    11051169        /* The APDU must be provided by the card driver */ 
     
    11811245        /* PIN command completed, all is good */ 
    11821246        return SC_SUCCESS; 
    1183 #else 
    1184         return SC_ERROR_NOT_SUPPORTED; 
    1185 #endif /* PINPAD_ENABLED */ 
    11861247} 
    11871248#endif   /* HAVE_PCSC */ 
  • trunk/src/libopensc/sc.c

    r3177 r3405  
    2323#endif 
    2424 
    25 #ifdef HAVE_OPENSSL 
     25#ifdef ENABLE_OPENSSL 
    2626#include <openssl/crypto.h>     /* for OPENSSL_cleanse */ 
    2727#endif 
     
    718718void sc_mem_clear(void *ptr, size_t len) 
    719719{ 
    720 #ifdef HAVE_OPENSSL 
     720#ifdef ENABLE_OPENSSL 
    721721        OPENSSL_cleanse(ptr, len); 
    722722#else 
  • trunk/src/libopensc/ui.c

    r3177 r3405  
    2121#include <locale.h> 
    2222#endif 
     23#include <compat_getpass.h> 
    2324#include <ltdl.h> 
    2425 
     
    222223        } 
    223224 
    224 #ifdef HAVE_SETLOCALE 
     225#if defined(HAVE_SETLOCALE) && !defined(_WIN32) 
    225226        setlocale(LC_MESSAGES, language); 
    226227#else 
     
    258259        } 
    259260 
    260 #ifdef HAVE_SETLOCALE 
     261#if defined(HAVE_SETLOCALE) && !defined(_WIN32) 
    261262        setlocale(LC_MESSAGES, language); 
    262263#else 
  • trunk/src/openssh

    • Property svn:ignore
      •  

        old new  
         1Makefile 
         2Makefile.in 
         3core 
         4archive 
         5acinclude.m4 
         6aclocal.m4 
         7autom4te.cache 
         8compile 
         9confdefs.h 
         10config.* 
         11configure 
         12conftest 
         13conftest.c 
         14depcomp 
         15install-sh 
         16libtool 
         17libtool.m4 
         18ltmain.sh 
         19missing 
         20mkinstalldirs 
         21so_locations 
         22stamp-h* 
         23 
        124.deps 
        225.libs 
         
        1942*.rej 
        2043*.u 
         44*.rc 
         45*.pc 
        2146*~ 
        22 Makefile 
        23 Makefile.in 
        24 core 
        25 gmon.out 
         47*.gz 
         48*.bz2 
         49*.[0-9] 
         50*.html 
         51*.gif 
         52*.css 
         53*.out 
         54 
         55ChangeLog 
         56opensc.conf 
         57xsl-stylesheets 
         58opensc-config 
         59test-conf 
         60pkcs15-tool 
         61pkcs15-crypt 
         62pkcs15-init 
         63piv-tool 
         64eidenv 
         65opensc-explorer 
         66opensc-tool 
         67rutoken-tool 
         68cardos-info 
         69cryptoflex-tool 
         70netkey-tool 
         71pkcs11-tool 
         72pintest 
         73p15dump 
         74prngtest 
         75base64 
         76lottery 
         77 
  • trunk/src/openssh/Makefile.am

    r1822 r3405  
    33MAINTAINERCLEANFILES = Makefile.in 
    44 
    5 noinst_DATA = README ask-for-pin.diff 
    6 EXTRA_DIST = README ask-for-pin.diff 
     5dist_noinst_DATA = README ask-for-pin.diff 
  • trunk/src/pkcs11

    • Property svn:ignore
      •  

        old new  
         1Makefile 
         2Makefile.in 
         3core 
         4archive 
         5acinclude.m4 
         6aclocal.m4 
         7autom4te.cache 
         8compile 
         9confdefs.h 
         10config.* 
         11configure 
         12conftest 
         13conftest.c 
         14depcomp 
         15install-sh 
         16libtool 
         17libtool.m4 
         18ltmain.sh 
         19missing 
         20mkinstalldirs 
         21so_locations 
         22stamp-h* 
         23 
        124.deps 
        225.libs 
         
        1942*.rej 
        2043*.u 
         44*.rc 
         45*.pc 
        2146*~ 
        22 Makefile 
        23 Makefile.in 
        24 core 
        25 gmon.out 
         47*.gz 
         48*.bz2 
         49*.[0-9] 
         50*.html 
         51*.gif 
         52*.css 
         53*.out 
         54 
         55ChangeLog 
         56opensc.conf 
         57xsl-stylesheets 
         58opensc-config 
         59test-conf