NB! This project is outdated and unmaintained, please refer to the OpenSC WindowsInstaller instead!

Changeset 30


Ignore:
Timestamp:
09/19/05 14:32:22 (7 years ago)
Author:
aj
Message:

new pre release of scb, not tested so far. pre1b soon (taiwanese eid support).

Location:
trunk
Files:
5 added
4 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r24 r30  
     1Smart card bundle 0.5-pre1 
     2 * use GnuWin32 libtool (re-zipped version) 
     3 * openssl 0.9.7g 
     4 * opensc 0.10.0-pre3b (-pre3 plus patch for taiwanese eid) 
     5 * libp11 0.1.3 (0.1.2 plus patches to compile on windows) 
     6 
    17Smart card bundle 20050720 
    28 * set version to 20050720 
  • trunk/LICENSE

    r19 r30  
    9797including but not limited to the implied warranty of merchantability, fitness 
    9898for a particular purpose, and noninfringement. 
     99 
     1006.) This software contains libtool libltdl3: 
     101 
     102Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. 
     103Originally by Thomas Tanner <tanner@ffii.org> 
     104 
     105This library is free software; you can redistribute it and/or 
     106modify it under the terms of the GNU Lesser General Public 
     107License as published by the Free Software Foundation; either 
     108version 2 of the License, or (at your option) any later version. 
     109  
     110As a special exception to the GNU Lesser General Public License, 
     111if you distribute this file as part of a program or library that 
     112is built using GNU libtool, you may include it under the same 
     113distribution terms that you use for the rest of that program. 
     114     
     115This library is distributed in the hope that it will be useful, 
     116but WITHOUT ANY WARRANTY; without even the implied warranty of 
     117MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     118Lesser General Public License for more details. 
     119 
    99120 
    100121================= OPENSSL LICENSE TEXT =================  
  • trunk/MANIFEST

    r24 r30  
    22======================= 
    33 
    4 scb-20050720.exe 
    5         Smart card bundle 20050720 
    6         with OpenSSL 0.9.8, OpenSC 20050720 
     4scb-0.5-pre1b.exe 
     5        Smart card bundle 0.5-pre1b 
     6        with OpenSSL 0.9.7g, OpenSC 0.10.0-pre1b 
    77        and Putty 0.58 (plus patches) 
    88 
    9 opensc-20050720.tar.gz 
    10         Original version of OpenSC snapshot of 2005-07-20 
    11         http://www.opensc.org/files/snapshots/ 
     9opensc-0.10.0-pre1b.tar.gz 
     10        OpenSC prerelease 0.10.0-pre1 patched for taiwanese eid 
     11        http://www.opensc.org/files/ 
    1212 
    13 openssl-0.9.8.tar.gz 
    14         Original version of OpenSSL 0.9.8. 
     13openssl-0.9.7g.tar.gz 
     14        Original version of OpenSSL 0.9.7g. 
    1515        http://www.openssl.org/source/ 
    1616 
     
    2222        Putty 0.58 (for unix) plus smartcard patches, plus fixes, 
    2323        compiles fine on Windows. No pageant support so far. 
     24 
     25GnuWin32.zip 
     26        zip file with all files installed by libtool 1.5.8 from 
     27        http://gnuwin32.sourceforge.net/packages.html 
     28 
  • trunk/Makefile.mak

    r28 r30  
    77ISCC="$(PROGRAMFILES)\Inno Setup 5\ISCC" 
    88OPENSSL=0.9.7g 
    9 OPENSC=20050720 
     9OPENSC=0.10.0-pre3b 
     10LIBP11=0.1.3 
    1011PUTTY=0.58 
    1112 
     
    1718        mkdir $(DEST)\include\openssl 
    1819        mkdir $(DEST)\include\opensc 
     20        mkdir $(DEST)\lib 
    1921 
    2022        copy opensc.conf $(DEST) 
     
    2224        copy LICENSE $(DEST) 
    2325 
     26        cd GNUWIN32 
     27        COPY BIN\LIBLTDL3.DLL $(DEST) 
     28        COPY include\LTDL.H $(DEST)\include 
     29        COPY lib\libltdl.lib $(DEST)\lib 
     30        cd .. 
     31 
    2432        cd openssl-$(OPENSSL) 
    2533        perl Configure VC-WIN32 
    26         # If Microsoft MASM is not installed, comment out the following line 
     34# If Microsoft MASM is not installed, comment out the following line 
    2735        ms\do_masm 
    28         # If Free Netwide Assembler NASM in installed, uncomment the  
    29         # following line 
    30         #ms\do_nasm 
    31         # If there is no assembler at all, uncomment the following line 
    32         #ms\do_ms 
     36# If Free Netwide Assembler NASM in installed, uncomment the  
     37# following line 
     38#ms\do_nasm 
     39# If there is no assembler at all, uncomment the following line 
     40#ms\do_ms 
    3341        nmake -f ms\ntdll.mak 
    3442 
    3543        copy inc32\openssl\* $(DEST)\include\openssl 
    36         copy /b out32dll\ssleay32.lib $(DEST) 
    37         copy /b out32dll\libeay32.lib $(DEST) 
    38         copy /b out32dll\ssleay32.exp $(DEST) 
    39         copy /b out32dll\libeay32.exp $(DEST) 
     44        copy /b out32dll\ssleay32.lib $(DEST)\lib 
     45        copy /b out32dll\libeay32.lib $(DEST)\lib 
     46        copy /b out32dll\ssleay32.exp $(DEST)\lib 
     47        copy /b out32dll\libeay32.exp $(DEST)\lib 
    4048        copy /b out32dll\ssleay32.dll $(DEST) 
    4149        copy /b out32dll\libeay32.dll $(DEST) 
     
    4553        cd .. 
    4654 
    47         cd ltdl 
    48         nmake /f Makefile.mak 
    49         cd .. 
    50  
    5155        cd opensc-$(OPENSC) 
     56        perl -p -e "s/^LIBLTDL_INCL.*/LIBLTDL_INCL = \/I$(DESTP)\\include/g" -i~ win32\Make.rules.mak 
     57        perl -p -e "s/^LIBLTDL_LIB.*/LIBLTDL_LIB = $(DESTP)\\lib\\libltdl.lib/g" -i~ win32\Make.rules.mak 
    5258        perl -p -e "s/#OPENSSL_DEF/OPENSSL_DEF/g" -i~ win32\Make.rules.mak 
    5359        perl -p -e "s/C:\\openssl\\include/$(DESTP)\\include/g" -i~ win32\Make.rules.mak 
    54         perl -p -e "s/C:\\openssl\\out32dll/$(DESTP)/g" -i~ win32\Make.rules.mak 
     60        perl -p -e "s/C:\\openssl\\out32dll/$(DESTP)\\lib/g" -i~ win32\Make.rules.mak 
    5561 
    56         set lib=$(DEST);$(LIB) 
     62        set lib=$(DEST);$(DEST)\lib;$(LIB) 
    5763        set PATH=$(DEST);$(PATH) 
    5864        set INCLUDE=$(DEST)\INCLUDE;$(INCLUDE) 
     
    6066        nmake -f Makefile.mak 
    6167 
    62         COPY ANNOUNCE $(DEST) 
    63         COPY AUTHORS $(DEST) 
    6468        COPY COPYING $(DEST) 
     69        COPY NEWS  $(DEST) 
    6570        COPY QUICKSTART $(DEST) 
    66         COPY README  $(DEST) 
    6771 
    6872        mkdir $(DEST)\DOC 
    69         COPY DOC\*.HTML $(DEST)\DOC 
     73        mkdir $(DEST)\DOC\OPENSC 
     74        COPY DOC\* $(DEST)\DOC\OPENSC 
    7075 
    7176        COPY SRC\PKCS15INIT\*.PROFILE $(DEST) 
     
    7479        COPY SRC\PKCS11\OPENSC-PKCS11.DLL $(DEST) 
    7580        COPY SRC\PKCS11\PKCS11-SPY.DLL $(DEST) 
    76         COPY SRC\LIBP11\LIBP11.DLL $(DEST) 
    77         COPY SRC\SSLENGINES\ENGINE_PKCS11.DLL $(DEST) 
    7881 
    7982        COPY SRC\TESTS\BASE64.EXE $(DEST) 
     
    8790        COPY SRC\TOOLS\PKCS15-TOOL.EXE $(DEST) 
    8891        COPY SRC\TOOLS\PKCS15-CRYPT.EXE $(DEST) 
    89         copy SRC\INCLUDE\opensc\* $(DEST)\include\opensc 
     92        COPY SRC\INCLUDE\opensc\* $(DEST)\include\opensc 
    9093 
    91         copy SRC\LIBP11\LIBP11.H $(DEST)\include 
     94        COPY SRC\SCCONF\SCCONF.LIB $(DEST)\lib 
     95 
     96        cd .. 
     97 
     98        cd libp11-$(LIBP11) 
     99         
     100        cd src 
     101        perl -p -e "s/^LIBLTDL_INC.*/LIBLTDL_INC = \/I$(DESTP)\\include/g" -i~ Makefile.mak 
     102        perl -p -e "s/^LIBLTDL_LIB.*/LIBLTDL_LIB = $(DESTP)\\lib\\libltdl.lib/g" -i~ Makefile.mak 
     103        perl -p -e "s/^OPENSSL_INC.*/OPENSSL_INC = \/I$(DESTP)\\include/g" -i~ Makefile.mak 
     104        perl -p -e "s/^OPENSSL_LIB.*/OPENSSL_LIB = $(DESTP)\\lib\\libeay32.lib/g" -i~ Makefile.mak 
     105        nmake /f Makefile.mak 
     106        COPY LIBP11.DLL $(DEST) 
     107        cd .. 
     108 
     109        COPY SRC\LIBP11.H $(DEST)\include 
     110 
     111        mkdir $(DEST)\DOC\LIBP11 
     112        COPY DOC\* $(DEST)\DOC\LIBP11 
    92113 
    93114        cd .. 
     
    97118        cd Windows 
    98119         
    99         # If your compiler doesn't support IPV6, uncomment the following line 
    100         #perl -p -e "s/#  - COMPAT=\/DNO_IPV6/COMPAT=\/DNO_IPV6/g" -i~ Makefile.vc 
     120# If your compiler doesn't support IPV6, uncomment the following line 
     121#       perl -p -e "s/#  - COMPAT=\/DNO_IPV6/COMPAT=\/DNO_IPV6/g" -i~ Makefile.vc 
    101122        nmake /f Makefile.vc 
    102         COPY putty.exe $(DEST) 
    103         COPY pageant.exe $(DEST) 
    104         COPY plink.exe $(DEST) 
    105         COPY puttytel.exe $(DEST) 
    106         COPY puttygen.exe $(DEST) 
    107         COPY pscp.exe $(DEST) 
    108         copy psftp.exe $(DEST) 
     123 
     124        mkdir $(DEST)\putty 
     125        COPY putty.exe $(DEST)\putty 
     126        COPY pageant.exe $(DEST)\putty 
     127        COPY plink.exe $(DEST)\putty 
     128        COPY puttytel.exe $(DEST)\putty 
     129        COPY puttygen.exe $(DEST)\putty 
     130        COPY pscp.exe $(DEST)\putty 
     131        copy psftp.exe $(DEST)\putty 
    109132 
    110133        cd .. 
    111134 
    112         copy smartcard.ppk $(DEST) 
     135        copy smartcard.ppk $(DEST)\putty 
    113136 
    114137        cd .. 
     138 
     139        cl  /Zi /MD /nologo /I$(DEST)\include\opensc /D_WIN32_WINNT=0x0400 \ 
     140                /c editconf.c 
     141 
     142        link /DEBUG /NOLOGO /INCREMENTAL:NO /MACHINE:IX86 /pdb:$*.pdb \ 
     143                /out:editconf.exe editconf.obj \ 
     144                $(DEST)\\lib\\scconf.lib advapi32.lib 
     145        copy editconf.exe $(DEST) 
    115146                         
    116147        copy $(MSVCR) $(DEST) 
  • trunk/README

    r29 r30  
    331.) Download 
    44        OpenSC source code 
    5         http://www.opensc.org/files/opensc-0.9.6.tar.gz 
     5        http://www.opensc.org/files/testing/opensc-0.10.0-pre3.tar.gz 
    66 
    77        OpenSSL source code 
     
    99 
    1010        Putty source code (for unix) 
    11         http://the.earth.li/~sgtatham/putty/latest/putty-0.57.tar.gz 
     11        http://the.earth.li/~sgtatham/putty/latest/putty-0.58.tar.gz 
    1212 
    1313        Smart card patch for Putty 
     
    2222        Libtool for windows, gnuwin32 port 
    2323        http://gnuwin32.sourceforge.net/packages/libtool.htm 
    24         http://mesh.dl.sourceforge.net/sourceforge/gnuwin32/libtool-1.5.8-bin.zip 
    25         we only need the bin/libltdl.dll file. 
    26  
    2724 
    28252.) patch putty on a unix system 
    29         tar xfvz putty-0.57.tar.gz 
    30         cd putty-0.57 
    31         patch -p1 < ../putty-0.57-smartcard.diff 
     26        tar xfvz putty-0.58.tar.gz 
     27        cd putty-0.58 
     28        patch -p1 < ../putty-0.58-smartcard.diff 
    3229        cd .. 
    33         tar cfvz putty-0.57-smartcard.tar.gz putty-0.57 
    34         rm -rf putty-0.57/ 
     30        tar cfvz putty-0.58-smartcard.tar.gz putty-0.58 
     31        rm -rf putty-0.58/ 
    3532 
    36 3.) 
    37         copy these files to some folder on a windows machine: 
     333.)     copy these files to some folder on a windows machine: 
    3834        Makefile.mak scb.iss  
    3935        opensc-0.9.6.tar.gz openssl-0.9.7g.tar.gz 
    40         putty-0.57-smartcard.tar.gz 
     36        putty-0.58-smartcard.tar.gz 
    4137 
    42384.)     use winzip or 7-zip to "Extract here" all *.tar.gz files. 
  • trunk/editconf.c

    r26 r30  
    2727#include <windows.h> 
    2828#include <errno.h> 
    29 #ifdef HAVE_CONFIG_H 
    30 #include <config.h> 
    31 #endif 
    32 #include "..\trunk\src\scconf\scconf.h" 
     29#include <scconf.h> 
    3330 
    3431static int printHelp(const char *csMesg, int iRet); 
     
    3835#define CLEANUP(iRes, iVal) {iRes = iVal; goto cleanup;} 
    3936 
    40 //#define LOG(s) {FILE *f = fopen("C:\\configopensc.log", "a"); fprintf(f, s); fclose(f);} 
    41 //#define LOGINT(s, i) {FILE *f = fopen("C:\\configopensc.log", "a"); fprintf(f, s, i); fclose(f);} 
    4237#define LOG(s) 
    4338#define LOGINT(s, i) 
     
    4540int main(int argc, char **argv) 
    4641{ 
    47     char csConfigDir[MAX_PATH]; 
    48     int iRet = 0; 
     42        char csConfigDir[MAX_PATH]; 
     43        int iRet = 0; 
    4944 
    50     LOG("\n*************\n"); 
    51     LOG(argv[0]); 
    52     LOGINT("\nargc=%d\n", argc); 
     45        LOG("\n*************\n"); 
     46        LOG(argv[0]); 
     47        LOGINT("\nargc=%d\n", argc); 
    5348 
    54     if (argc != 2) 
    55         return printHelp(NULL, 0); 
    56     LOG(argv[1]); 
     49        if (argc != 2) 
     50                return printHelp(NULL, 0); 
     51        LOG(argv[1]); 
    5752 
    58     strncpy(csConfigDir, argv[1], sizeof(csConfigDir) - 1); 
    59     csConfigDir[sizeof(csConfigDir) - 1] = '\0'; 
    60     if (csConfigDir[strlen(csConfigDir) - 1] == '\\') 
    61         csConfigDir[strlen(csConfigDir) - 1] = '\0'; 
     53        strncpy(csConfigDir, argv[1], sizeof(csConfigDir) - 1); 
     54        csConfigDir[sizeof(csConfigDir) - 1] = '\0'; 
     55        if (csConfigDir[strlen(csConfigDir) - 1] == '\\') 
     56                csConfigDir[strlen(csConfigDir) - 1] = '\0'; 
    6257 
    63     iRet = changeConfigFile(csConfigDir); 
    64     LOGINT("\nchangeConfigFile(): %d\n", iRet); 
    65     if (iRet != 0) 
    66         printHelp("Error: couldn't change the opensc.conf file: %d\n", iRet); 
    67     else 
    68     { 
    69         iRet = changeRegistry(csConfigDir); 
    70         LOGINT("changeRegistry(): %d\n", iRet); 
    71         if (iRet != 0) 
    72             printHelp("Error: couldn't change the registry: %d\n", iRet); 
    73         else 
    74             printf("\nconfigopensc finished successfully\n"); 
    75 } 
     58        iRet = changeConfigFile(csConfigDir); 
     59        LOGINT("\nchangeConfigFile(): %d\n", iRet); 
     60        if (iRet != 0) 
     61                printHelp("Error: couldn't change the opensc.conf file: %d\n", 
     62                          iRet); 
     63        else { 
     64                iRet = changeRegistry(csConfigDir); 
     65                LOGINT("changeRegistry(): %d\n", iRet); 
     66                if (iRet != 0) 
     67                        printHelp("Error: couldn't change the registry: %d\n", 
     68                                  iRet); 
     69                else 
     70                        printf("\nconfigopensc finished successfully\n"); 
     71        } 
    7672 
    77     return iRet; 
     73        return iRet; 
    7874} 
    7975 
    8076static int printHelp(const char *csMesg, int iRet) 
    8177{ 
    82     if (csMesg != NULL) 
    83         printf(csMesg, iRet); 
    84     printf("\nThis tool configures OpenSC after installation.\n"); 
    85     printf("\nUsage: configopensc <installationdir>\n"); 
    86     printf("  in which <installationdir> is the directory where\n"); 
    87     printf("  the OpenSC config fileshave been installed.\n"); 
    88     printf("  (E.g. \"C:\\Program Files\\OpenSC\\conf\")\n\n"); 
    89     printf("So: OpenSC should have been installed already.\n\n"); 
    90     return iRet; 
     78        if (csMesg != NULL) 
     79                printf(csMesg, iRet); 
     80        printf("\nThis tool configures OpenSC after installation.\n"); 
     81        printf("\nUsage: configopensc <installationdir>\n"); 
     82        printf("  in which <installationdir> is the directory where\n"); 
     83        printf("  the OpenSC config fileshave been installed.\n"); 
     84        printf("  (E.g. \"C:\\Program Files\\OpenSC\\conf\")\n\n"); 
     85        printf("So: OpenSC should have been installed already.\n\n"); 
     86        return iRet; 
    9187} 
    9288 
    9389static int changeConfigFile(const char *csConfigDir) 
    9490{ 
    95     char csConfigFile[MAX_PATH]; 
     91        char csConfigFile[MAX_PATH]; 
    9692        scconf_block *conf_block = NULL, **blocks; 
    9793        scconf_context *conf = NULL; 
    98     scconf_item *item; 
    99     scconf_list *list; 
     94        scconf_item *item; 
     95        scconf_list *list; 
    10096        int iRes = 0; 
    10197 
    102     /* Open and parse the config file */ 
    103     sprintf(csConfigFile, "%s\\opensc.conf", csConfigDir); 
    104     conf = scconf_new(csConfigFile); 
    105         if (!conf) 
    106     { 
     98        /* Open and parse the config file */ 
     99        sprintf(csConfigFile, "%s\\opensc.conf", csConfigDir); 
     100        conf = scconf_new(csConfigFile); 
     101        if (!conf) { 
    107102                printf("\nscconf_new() failed\n"); 
    108103                CLEANUP(iRes, 1); 
    109104        } 
    110         if (scconf_parse(conf) < 1) 
    111     { 
     105        if (scconf_parse(conf) < 1) { 
    112106                printf("\nscconf_parse() failed: %s\n", conf->errmsg); 
    113107                CLEANUP(iRes, 1); 
    114108        } 
    115109 
    116     /* Get the "app default" block */ 
     110        /* Get the "app default" block */ 
    117111        blocks = scconf_find_blocks(conf, NULL, "app", "default"); 
    118112        if (blocks[0]) 
    119113                conf_block = blocks[0]; 
    120114        free(blocks); 
    121         if (conf_block != NULL) 
    122     { 
    123         for (item = conf_block->items; item != NULL; item=item->next) 
    124         { 
    125             if ((item->type != SCCONF_ITEM_TYPE_VALUE) || (strcmp(item->key, "profile_dir") != 0)) 
    126                 continue; 
    127             list = item->value.list; 
    128             scconf_list_destroy(list); 
    129             list = NULL; 
    130             scconf_list_add(&list, csConfigDir); 
    131             item->value.list = list; 
    132             break; 
    133         } 
    134         if (item == NULL) 
    135             scconf_put_str(conf_block, "profile_dir", csConfigDir); 
    136     } 
     115        if (conf_block != NULL) { 
     116                for (item = conf_block->items; item != NULL; item = item->next) { 
     117                        if ((item->type != SCCONF_ITEM_TYPE_VALUE) 
     118                            || (strcmp(item->key, "profile_dir") != 0)) 
     119                                continue; 
     120                        list = item->value.list; 
     121                        scconf_list_destroy(list); 
     122                        list = NULL; 
     123                        scconf_list_add(&list, csConfigDir); 
     124                        item->value.list = list; 
     125                        break; 
     126                } 
     127                if (item == NULL) 
     128                        scconf_put_str(conf_block, "profile_dir", csConfigDir); 
     129        } 
    137130 
    138     /* Write */ 
     131        /* Write */ 
    139132        if ((iRes = scconf_write(conf, csConfigFile)) != 0) 
    140133                printf("\nscconf_write(): %s\n", strerror(iRes)); 
    141134 
    142 cleanup: 
    143     if (conf) 
    144         scconf_free(conf); 
     135      cleanup: 
     136        if (conf) 
     137                scconf_free(conf); 
    145138 
    146     return iRes; 
     139        return iRes; 
    147140} 
    148141 
    149142static int changeRegistry(const char *csConfigDir) 
    150143{ 
    151     char csConfigFile[MAX_PATH]; 
    152     DWORD   dwDisposition; 
    153     HKEY    hKey; 
    154     DWORD   dwErr; 
     144        char csConfigFile[MAX_PATH]; 
     145        char csModuleFile[MAX_PATH]; 
     146        DWORD dwDisposition; 
     147        HKEY hKey; 
     148        DWORD dwErr; 
    155149 
    156     sprintf(csConfigFile, "%s\\opensc.conf", csConfigDir); 
     150        sprintf(csConfigFile, "%s\\opensc.conf", csConfigDir); 
     151        sprintf(csModuleFile, "%s\\opensc-pkcs11.dll", csConfigDir); 
    157152 
    158     dwErr = RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\OpenSC", 
    159         0L, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dwDisposition); 
    160     if (dwErr != ERROR_SUCCESS) 
    161         printf("RegCreateKeyEx() returned error %d (0x%0x)\n", GetLastError(), GetLastError()); 
    162     else 
    163     { 
    164         dwErr = RegSetValueEx(hKey, "ConfigFile", 0L, REG_SZ, 
    165             csConfigFile, strlen(csConfigFile)+1); 
    166         if (dwErr != ERROR_SUCCESS) 
    167             printf("RegSetValueEx() returned error %d (0x%0x)\n", GetLastError(), GetLastError()); 
     153        dwErr = RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\OpenSC", 
     154                               0L, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 
     155                               NULL, &hKey, &dwDisposition); 
     156        if (dwErr != ERROR_SUCCESS) 
     157                printf("RegCreateKeyEx() returned error %d (0x%0x)\n", 
     158                       GetLastError(), GetLastError()); 
     159        else { 
     160                dwErr = RegSetValueEx(hKey, "ConfigFile", 0L, REG_SZ, 
     161                                      csConfigFile, strlen(csConfigFile) + 1); 
     162                if (dwErr != ERROR_SUCCESS) 
     163                        printf("RegSetValueEx() returned error %d (0x%0x)\n", 
     164                               GetLastError(), GetLastError()); 
    168165 
    169         RegCloseKey(hKey); 
    170     } 
     166                RegCloseKey(hKey); 
     167        } 
    171168 
    172     return (int) dwErr; 
     169        dwErr = RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\PKCS11-Spy", 
     170                               0L, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 
     171                               NULL, &hKey, &dwDisposition); 
     172        if (dwErr != ERROR_SUCCESS) 
     173                printf("RegCreateKeyEx() returned error %d (0x%0x)\n", 
     174                       GetLastError(), GetLastError()); 
     175        else { 
     176                dwErr = RegSetValueEx(hKey, "Module", 0L, REG_SZ, 
     177                                      csModuleFile, strlen(csModuleFile) + 1); 
     178                if (dwErr != ERROR_SUCCESS) 
     179                        printf("RegSetValueEx() returned error %d (0x%0x)\n", 
     180                               GetLastError(), GetLastError()); 
     181 
     182                RegCloseKey(hKey); 
     183        } 
     184 
     185        return (int)dwErr; 
    173186} 
  • trunk/opensc.conf

    r13 r30  
    2020        # Default: stdout 
    2121        # 
    22         # debug_file = "C:\opensc-debug.log"; 
     22        # debug_file = /tmp/opensc-debug.log; 
    2323 
    2424        # The file to which errors will be written 
     
    2727        # Default: stderr 
    2828        # 
    29         # error_file = "C:\opensc-error.log"; 
    30  
    31         # Where to find the *.profile files for pkcs15init; 
    32  
    33         profile_dir = "C:\Program Files\Smart card bundle"; 
     29        # error_file = /tmp/opensc-errors.log; 
     30 
     31        # PKCS#15 initialization / personalization 
     32        # profiles directory for pkcs15-init. 
     33         
     34        profile_dir = PKGDATADIR; 
    3435 
    3536        # What reader drivers to load at start-up 
     
    4041        # configuration block has to be written for the driver. 
    4142        # Default: internal 
    42         # NOTE: if "internal" keyword is used, must be the  
     43        # NOTE: if "internal" keyword is used, must be the 
    4344        # last entry in reader_drivers list 
    4445        # 
     
    8081                # Default: none 
    8182                # 
    82                 apdu_masquerade = case4as3; 
     83                apdu_masquerade = none; 
    8384                # 
    8485                # This sets the maximum send and receive sizes. 
     
    8889                max_send_size = 252; 
    8990                max_recv_size = 252; 
    90         } 
     91                # 
     92                # Connect to reader in exclusive mode. 
     93                # Default: false 
     94                connect_exclusive = false; 
     95                # 
     96                # Reset the card after disconnect. 
     97                # Default: true 
     98                connect_reset = true; 
     99                # 
     100                # Reset the card after each transaction. 
     101                # Default: false 
     102                transcaction_reset = false; 
     103                # 
     104                # Enable pinpad if detected (PC/SC v2.0.2 Part 10) 
     105                # Default: false 
     106                enable_pinpad = false; 
     107        } 
     108 
     109        # options for openct support 
     110        reader_driver openct { 
     111                # virtual readers to allocate. default:5 
     112                readers = 5; 
     113        }; 
    91114 
    92115        # What card drivers to load at start-up 
     
    97120        # configuration block has to be written for the driver. 
    98121        # Default: internal 
    99         # NOTE: When "internal" keyword is used, must be last entry  
     122        # NOTE: When "internal" keyword is used, must be last entry 
    100123        # 
    101124        # card_drivers = customcos, internal; 
    102125 
    103         # Card driver configuration blocks.  
    104  
    105         # For all drivers, you can specify ATRs of cards that 
    106         # should be handled by this driver (in addition to the 
    107         # list of compiled-in ATRs).  
    108         # 
    109         # The supported internal card driver names are 
    110         #  flex         Cryptoflex/Multiflex 
    111         #  setcos       Setec 
    112         #  etoken       Aladdin eToken and other CardOS based cards 
    113         #  gpk          GPK 4K/8K/16K 
    114         #  mcrd         MICARDO 2.1 
    115         #  miocos       MioCOS 1.1 
    116         #  openpgp      OpenPGP card 
    117         #  tcos         TCOS 2.0 
    118         #  emv          EMV compatible cards 
    119  
    120         # GPK card driver additional ATR entry: 
    121         card_driver gpk { 
    122                 # atr = 00:11:22; 
    123         } 
    124  
    125         # For card drivers loaded from an external shared library/DLL,  
     126        # Card driver configuration blocks. 
     127 
     128        # For card drivers loaded from an external shared library/DLL, 
    126129        # you need to specify the path name of the module 
    127130        # 
     
    129132                # The location of the driver library 
    130133                # module = /usr/lib/opensc/drivers/card_customcos.so; 
    131                 # atr = 00:11:22:33:44; 
    132                 # atr = 55:66:77:88:99:aa:bb; 
    133134        # } 
    134135 
     
    140141        # Default: autodetect 
    141142        # 
    142         # force_card_driver = miocos; 
     143        # force_card_driver = customcos; 
     144 
     145        # In addition to the built-in list of known cards in the 
     146        # card driver, you can configure a new card for the driver 
     147        # using the card_atr block. The goal is to centralize 
     148        # everything related to a certain card to card_atr. 
     149        # 
     150        # The supported internal card driver names are 
     151        #  etoken           Aladdin eToken and other Siemens CardOS cards 
     152        #  flex             Schlumberger Multiflex/Cryptoflex 
     153        #  cyberflex        Schlumberger Cyberflex 
     154        #  gpk              Gemplus GPK 
     155        #  miocos           MioCOS 1.1 
     156        #  mcrd             MICARDO 2.1 
     157        #  setcos           Setec cards 
     158        #  starcos          STARCOS SPK 2.3 
     159        #  tcos             TCOS 2.0 
     160        #  openpgp          OpenPGP card 
     161        #  jcop             JCOP cards with BlueZ PKCS#15 applet 
     162        #  oberthur         Oberthur AuthentIC.v2/CosmopolIC.v4 
     163        #  belpic           Belpic cards 
     164        #  emv              EMV compatible cards 
     165 
     166        # Generic format: card_atr <hex encoded ATR (case-sensitive!)> 
     167 
     168        # New card entry for the flex card driver 
     169        # card_atr 3b:f0:0d:ca:fe { 
     170                # All parameters for the context are 
     171                # optional unless specified otherwise. 
     172 
     173                # Context: global, card driver 
     174                # 
     175                # ATR mask value 
     176                # 
     177                # The mask is logically AND'd with an 
     178                # card ATR prior to comparison with the 
     179                # ATR reference value above. Using mask 
     180                # allows identifying and configuring 
     181                # multiple ATRs as the same card model. 
     182                # atrmask = "ff:ff:ff:ff:ff"; 
     183 
     184                # Context: card driver 
     185                # 
     186                # Specify used card driver (REQUIRED). 
     187                # 
     188                # When enabled, overrides all possible 
     189                # settings from the card drivers built-in 
     190                # card configuration list. 
     191                # driver = "flex"; 
     192 
     193                # Set card name for card drivers that allows it. 
     194                # name = "My CryptoFlex card"; 
     195 
     196                # Card type as an integer value. 
     197                # 
     198                # Depending on card driver, this allows 
     199                # tuning the behaviour of the card driver 
     200                # for your card. 
     201                # type = "2002"; 
     202 
     203                # Card flags as an hex value. 
     204                # Multiple values are OR'd together. 
     205                # 
     206                # Depending on card driver, this allows 
     207                # fine-tuning the capabilities in 
     208                # the card driver for your card. 
     209                # 
     210                # Optionally, some known parameters 
     211                # can be specified as strings: 
     212                # 
     213                # keygen - On-board key generation capability 
     214                # rng - On-board random number source 
     215                # 
     216                # flags = "keygen", "rng", "0x80000000"; 
     217 
     218                # 
     219                # Context: PKCS#15 emulation layer 
     220                # 
     221                # When using PKCS#15 emulation, force 
     222                # the emulation driver for specific cards. 
     223                # 
     224                # Required for external drivers, but can 
     225                # be used with built-in drivers, too. 
     226                # pkcs15emu = "custom"; 
     227 
     228                # 
     229                # Context: reader driver 
     230                # 
     231                # Force protocol selection for specific cards. 
     232                # Known parameters: t0, t1, raw 
     233                # force_protocol = "t0"; 
     234        # } 
     235 
     236        # Estonian ID card and Micardo driver currently play together with T=0 only. 
     237        # In theory only the 'cold' ATR should be specified, as T=0 will be the preferred 
     238        # protocol once you boot it up with T=0, but be paranoid. 
     239        card_atr 3b:6e:00:ff:45:73:74:45:49:44:20:76:65:72:20:31:2e:30 { 
     240                force_protocol = t0; 
     241        } 
     242        card_atr 3b:fe:94:00:ff:80:b1:fa:45:1f:03:45:73:74:45:49:44:20:76:65:72:20:31:2e:30:43 { 
     243                force_protocol = t0; 
     244        } 
     245 
    143246 
    144247        # Below are the framework specific configuration blocks. 
     
    149252                # home directory. 
    150253                # 
    151                 # At the moment you have to 'teach' the card to the 
    152                 # system by: 
    153                 # pkcs15-tool -L 
     254                # At the moment you have to 'teach' the card 
     255                # to the system by running command: pkcs15-tool -L 
    154256                # 
    155257                # WARNING: Caching shouldn't be used in setuid root 
     
    158260                # 
    159261                use_caching = true; 
    160                 # Enable pkcs15 emulation 
     262                # Enable pkcs15 emulation. 
    161263                # Default: yes 
    162264                enable_pkcs15_emulation = yes; 
    163                 # Try pkcs15 emulation code first (before the normal 
    164                 # pkcs15 processing). 
     265                # Prefer pkcs15 emulation code before 
     266                # the normal pkcs15 processing. 
    165267                # Default: no 
    166268                try_emulation_first = no; 
    167                 # Enable builtin emulators 
     269                # Enable builtin emulators. 
    168270                # Default: yes 
    169271                enable_builtin_emulation = yes; 
    170272                # list of the builtin pkcs15 emulators to test 
    171                 # possible values: esteid, openpgp, netkey, netkey, starcert, infocamere 
    172                 builtin_emulators = esteid, openpgp, netkey, netkey, starcert, infocamere; 
    173  
    174                 # additional pkcs15 emulators (dynamic or builtin with 
    175                 # a different atr etc.)  
    176                 # emulate foo { 
    177                         # module = builtin; 
    178                         # atr = 11:22:33:44; 
    179                 #} 
    180         } 
    181          
    182         # Estonian ID card and Micardo driver currently play together with T=0 only. 
    183         # In theory only the 'cold' ATR should be specified, as T=0 will be the preferred 
    184         # protocol once you boot it up with T=0, but be paranoid. 
    185          
    186         # Generic format: card_atr <hex encoded ATR (case-sensitive!)> 
    187         # Only parameter currently understood is force_protocol 
    188         card_atr 3b:6e:00:ff:45:73:74:45:49:44:20:76:65:72:20:31:2e:30 { 
    189                 force_protocol = t0; 
    190         } 
    191         card_atr 3b:fe:94:00:ff:80:b1:fa:45:1f:03:45:73:74:45:49:44:20:76:65:72:20:31:2e:30:43 { 
    192                 force_protocol = t0; 
    193         } 
    194 } 
    195  
    196 # For applications that use SCAM (pam_opensc, sia_opensc) 
    197 app scam { 
    198         framework pkcs15 { 
    199                 use_caching = false; 
     273                builtin_emulators = esteid, openpgp, tcos, starcert, infocamere, postecert, actalis, atrust-acosi, gemsafe, tccardos; 
     274 
     275                # additional settings per driver 
     276                # 
     277                # For pkcs15 emulators loaded from an external shared library/DLL, 
     278                # you need to specify the path name of the module and customize 
     279                # the card_atr example above correctly. 
     280                # 
     281                # emulate custom { 
     282                        # The location of the driver library 
     283                        # module = /usr/lib/opensc/drivers/p15emu_custom.so; 
     284                # } 
    200285        } 
    201286} 
     
    211296                # maximum on the overall number of slots 
    212297                # the pkcs11 module is able to handle. 
    213                 # 
    214                 # reduced to 1 as new default to make ID CSP happy. 
    215                 num_slots = 1; 
     298                num_slots = 4; 
    216299 
    217300                # Normally, the pkcs11 module will create 
     
    224307                # Set this option to true to hide these empty 
    225308                # slots. 
    226                 hide_empty_tokens = false; 
     309                hide_empty_tokens = yes; 
    227310 
    228311                # By default, the OpenSC PKCS#11 module will 
     
    259342        } 
    260343} 
    261  
    262 # Parameters for the OpenSC PKCS11-Spy module, that logs all the 
    263 # communication between a pkcs11 module and it's calling application: 
    264 #    app <--> pkcs11-spy <--> pkcs11 module 
    265 app pkcs11-spy { 
    266         spy { 
    267                 # Where to log to. 
    268                 # 
    269                 # By default, the value of the PKCS11SPY_OUTPUT environment 
    270                 # variable is used. And if that one isn't defined: stderr 
    271                 # is used. 
    272                 # 
    273                 #output = C:\pkcs11-spy.log; 
    274  
    275                 # Which PKCS11 module to load. 
    276                 # 
    277                 # By default, the value of the PKCS11SPY environment 
    278                 # variable is used. And if that one isn't defined, 
    279                 # opensc-pkcs11.so is used. 
    280                 # 
    281                 #module = opensc-pkcs11.so; 
    282         } 
    283 } 
  • trunk/scb.iss

    r24 r30  
    33 
    44#define MyAppName "Smart card bundle" 
    5 #define MyAppVerName "Smart card bundle 20050720" 
     5#define MyAppVerName "Smart card bundle 0.5-pre1b" 
    66#define MyAppPublisher "Andreas Jellinghaus" 
    77#define MyAppURL "http://www.opensc.org/scb/" 
     
    1818DefaultGroupName={#MyAppName} 
    1919LicenseFile=TARGET\LICENSE 
    20 OutputBaseFilename=scb-20050720 
     20OutputBaseFilename=scb-0.5-pre1 
    2121Compression=lzma 
    2222SolidCompression=yes 
    2323 
     24[Components] 
     25Name: "main"; Description: "OpenSC PKCS#11 Library"; Types: full; Flags: fixed 
     26Name: "docs"; Description: "Documentation"; Types: full 
     27Name: "devel"; Description: "Development"; Types: full 
     28Name: "putty"; Description: "Putty SSH Client"; Types: full 
     29 
     30[Files] 
     31Source: TARGET\*; DestDir: {app}; Components: main 
     32Source: TARGET\*.dll; DestDir: {sys}; Components: main 
     33; NOTE: Don't use "Flags: ignoreversion" on any shared system files 
     34Source: TARGET\lib; DestDir: {app}\lib; Flags: recursesubdirs createallsubdirs; Components: devel 
     35Source: TARGET\include; DestDir: {app}\include; Flags: recursesubdirs createallsubdirs; Components: devel 
     36Source: TARGET\doc; DestDir: {app}\doc; Flags: recursesubdirs createallsubdirs; Components: docs 
     37Source: TARGET\putty; DestDir: {app}; Flags: recursesubdirs createallsubdirs; Components: putty 
     38 
    2439[Tasks] 
    2540Name: startmenu; Description: "Create a &Start Menu group" 
    26 Name: desktopicon; Description: "Create a &desktop icon for PuTTY" 
    27 Name: associate; Description: "&Associate .PPK files (PuTTY Private Key) with Pageant" 
    28  
    29 [Files] 
    30 Source: TARGET\*; DestDir: {app}; Flags: recursesubdirs createallsubdirs 
    31 Source: TARGET\*.dll; DestDir: {sys}; Flags: recursesubdirs createallsubdirs 
    32 ; NOTE: Don't use "Flags: ignoreversion" on any shared system files 
     41Name: desktopicon; Description: "Create a &desktop icon for PuTTY"; Components: putty 
     42Name: associate; Description: "&Associate .PPK files (PuTTY Private Key) with Pageant"; Components: putty 
    3343 
    3444[Icons] 
    35 Name: "{group}\PuTTY"; Filename: "{app}\putty.exe"; Tasks: startmenu 
    36 Name: "{group}\PuTTY Manual"; Filename: "{app}\putty.hlp"; Tasks: startmenu 
    37 Name: "{group}\PuTTY Web Site"; Filename: "{app}\website.url"; Tasks: startmenu 
    38 Name: "{group}\PSFTP"; Filename: "{app}\psftp.exe"; Tasks: startmenu 
    39 Name: "{group}\PuTTYgen"; Filename: "{app}\puttygen.exe"; Tasks: startmenu 
    40 Name: "{group}\Pageant"; Filename: "{app}\pageant.exe"; Tasks: startmenu 
    41 Name: "{userdesktop}\PuTTY"; Filename: "{app}\putty.exe"; Tasks: desktopicon 
    42 Name: "{group}\Web page"; Filename: "{app}\opensc.url"; Tasks: startmenu 
    43 Name: "{group}\Uninstall"; Filename: "{app}\unins000.exe"; Tasks: startmenu 
     45Name: "{group}\PuTTY"; Filename: "{app}\putty.exe"; Tasks: startmenu; Components: putty 
     46Name: "{group}\PuTTY Manual"; Filename: "{app}\putty.hlp"; Tasks: startmenu; Components: putty 
     47Name: "{group}\PuTTY Web Site"; Filename: "{app}\website.url"; Tasks: startmenu; Components: putty 
     48Name: "{group}\PSFTP"; Filename: "{app}\psftp.exe"; Tasks: startmenu; Components: putty 
     49Name: "{group}\PuTTYgen"; Filename: "{app}\puttygen.exe"; Tasks: startmenu; Components: putty 
     50Name: "{group}\Pageant"; Filename: "{app}\pageant.exe"; Tasks: startmenu; Components: putty 
     51Name: "{userdesktop}\PuTTY"; Filename: "{app}\putty.exe"; Tasks: desktopicon; Components: putty 
     52Name: "{group}\Web page"; Filename: "{app}\opensc.url"; Tasks: startmenu; Components: main 
     53Name: "{group}\Uninstall"; Filename: "{app}\unins000.exe"; Tasks: startmenu; Components: main 
    4454 
    4555[Registry] 
    46 Root: HKCR; Subkey: ".ppk"; ValueType: string; ValueName: ""; ValueData: "PuTTYPrivateKey"; Flags: uninsdeletevalue; Tasks: associate 
    47 Root: HKCR; Subkey: "PuTTYPrivateKey"; ValueType: string; ValueName: ""; ValueData: "PuTTY Private Key File"; Flags: uninsdeletekey; Tasks: associate 
    48 Root: HKCR; Subkey: "PuTTYPrivateKey\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\pageant.exe,0"; Tasks: associate 
    49 Root: HKCR; Subkey: "PuTTYPrivateKey\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\pageant.exe"" ""%1"""; Tasks: associate 
    50 Root: HKCR; Subkey: "PuTTYPrivateKey\shell\edit"; ValueType: string; ValueName: ""; ValueData: "&Edit"; Tasks: associate 
    51 Root: HKCR; Subkey: "PuTTYPrivateKey\shell\edit\command"; ValueType: string; ValueName: ""; ValueData: """{app}\puttygen.exe"" ""%1"""; Tasks: associate 
    52 Root: HKLM; Subkey: "Software\OpenSC"; ValueType: string; ValueName: "ConfigFile"; ValueData: "{app}\opensc.conf" 
    53 Root: HKCU; Subkey: "Software\OpenSC"; ValueType: string; ValueName: "ConfigFile"; ValueData: "{app}\opensc.conf" 
     56Root: HKCR; Subkey: ".ppk"; ValueType: string; ValueName: ""; ValueData: "PuTTYPrivateKey"; Flags: uninsdeletevalue; Tasks: associate; Components: putty 
     57Root: HKCR; Subkey: "PuTTYPrivateKey"; ValueType: string; ValueName: ""; ValueData: "PuTTY Private Key File"; Flags: uninsdeletekey; Tasks: associate; Components: putty 
     58Root: HKCR; Subkey: "PuTTYPrivateKey\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\pageant.exe,0"; Tasks: associate; Components: putty 
     59Root: HKCR; Subkey: "PuTTYPrivateKey\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\pageant.exe"" ""%1"""; Tasks: associate; Components: putty 
     60Root: HKCR; Subkey: "PuTTYPrivateKey\shell\edit"; ValueType: string; ValueName: ""; ValueData: "&Edit"; Tasks: associate; Components: putty 
     61Root: HKCR; Subkey: "PuTTYPrivateKey\shell\edit\command"; ValueType: string; ValueName: ""; ValueData: """{app}\puttygen.exe"" ""%1"""; Tasks: associate; Components: putty 
     62Root: HKLM; Subkey: "Software\OpenSC"; ValueType: string; ValueName: "ConfigFile"; ValueData: "{app}\opensc.conf"; Components: main 
     63Root: HKLM; Subkey: "Software\PKCS11-Spy"; ValueType: string; ValueName: "Module"; ValueData: "{app}\opensc-pkcs11.dll"; Components: main 
     64 
     65[Run] 
     66Filename: "{app}\editconf.exe"; Parameters: "{app}"; Flags: postinstall runhidden; Components: main 
Note: See TracChangeset for help on using the changeset viewer.