Le Friday 13 August 2004 � 12:41:02, David Corcoran a �crit:
> Hi, 

Hello Dave,

> We have released the sources to the Card Manager client so you can now
> use it to load the MuscleCard applet on a variety of platforms and
> cards.  It has been tested on Linux, Solaris, Windows, and Mac OS X.
> It is BSD licensed and can be downloaded here: 

Thanks.

This will not compile with pcsc-lite 1.1.2 and later. You redefine
MAX_BUFFER_SIZE in IACdefines.h (as 265) but this is also defined in
pcsclite.h (as 264).

I propose the attached patch. The patch also solves some compilation
warnings when "gcc -pedandic" is used and uses `pkg-config libpcsclite
--cflags` to find the header files.

Regards,

-- 
 Dr. Ludovic Rousseau                        [EMAIL PROTECTED]
 -- Normaliser Unix c'est comme pasteuriser le camembert, L.R. --
diff -ru CardManagerClient/CMSClient.c CardManagerClient.new/CMSClient.c
--- CardManagerClient/CMSClient.c       2004-08-09 23:17:11.000000000 +0200
+++ CardManagerClient.new/CMSClient.c   2004-08-14 00:26:50.000000000 +0200
@@ -38,7 +38,7 @@
        }
 
        data[len] = '\0';
-       *sessionHandle = (IACULong32) atoi(data);
+       *sessionHandle = (IACULong32) atoi((char *)data);
 
        LOG("Received session handle: %x\n", *sessionHandle);
        
@@ -167,7 +167,7 @@
 {
        IACULong32 sessionHandle;
        IACULong32 profileNamesLen;
-       IACUChar8 profileNames[MAX_BUF_LEN];
+       IACChar8 profileNames[MAX_BUF_LEN];
        IAC_RV rv;
        int i, j = 0;
        IACULong32 selectedProfile = 0;
@@ -183,7 +183,7 @@
                return -1;
        }
 
-       if (atoi(argv[2]) == NULL) 
+       if (atoi(argv[2]) == 0) 
        {
                fprintf(stdout, "ERROR: Could not decode \"%s\" to a port number\n", 
argv[2]);
                return -1;
diff -ru CardManagerClient/IACAppletLoaderAPI.h 
CardManagerClient.new/IACAppletLoaderAPI.h
--- CardManagerClient/IACAppletLoaderAPI.h      2004-08-12 19:58:29.000000000 +0200
+++ CardManagerClient.new/IACAppletLoaderAPI.h  2004-08-14 00:22:37.000000000 +0200
@@ -14,17 +14,6 @@
 #ifndef __IACAppletLoaderAPI_h__
 #define __IACAppletLoaderAPI_h__
 
-#ifdef WIN32
-#include <windows.h>
-#elif SOLARIS
-#include <winscard.h>
-#elif LINUX
-#include <winscard.h>
-#else // MAC
-#include <PCSC/wintypes.h>
-#include <PCSC/winscard.h>
-#endif
-
 #include <openssl/evp.h>
 
 #define IAC_MAX_BUFLEN                     2048
diff -ru CardManagerClient/IACCardList.h CardManagerClient.new/IACCardList.h
--- CardManagerClient/IACCardList.h     2004-08-09 23:17:11.000000000 +0200
+++ CardManagerClient.new/IACCardList.h 2004-08-14 00:18:39.000000000 +0200
@@ -12,4 +12,5 @@
 ********************************************************************/
 
 IAC_RV parseItem(IACPUChar8 rx, IACULong32 rxLength, IACUChar8 criteria);
-IAC_RV IACListCardContents(IACULong32 sessionHandle, IACSessionHandle 
APISessionHandle);
\ No newline at end of file
+IAC_RV IACListCardContents(IACULong32 sessionHandle, IACSessionHandle 
APISessionHandle);
+
diff -ru CardManagerClient/IACCardState.c CardManagerClient.new/IACCardState.c
--- CardManagerClient/IACCardState.c    2004-08-09 23:17:11.000000000 +0200
+++ CardManagerClient.new/IACCardState.c        2004-08-14 00:22:39.000000000 +0200
@@ -304,4 +304,4 @@
                return IAC_ERR;
 
        return IAC_OK;
-}
\ No newline at end of file
+}
diff -ru CardManagerClient/IACExchangeData.c CardManagerClient.new/IACExchangeData.c
--- CardManagerClient/IACExchangeData.c 2004-08-09 23:17:11.000000000 +0200
+++ CardManagerClient.new/IACExchangeData.c     2004-08-14 00:23:59.000000000 +0200
@@ -123,4 +123,5 @@
        for (i = 0; i < sizeof(IACULong32); i++)
                *val = *val | ((buf[i] & 0xFF) << ((3-i) * 8));
        return IAC_OK;
-}
\ No newline at end of file
+}
+
diff -ru CardManagerClient/IACdefines.h CardManagerClient.new/IACdefines.h
--- CardManagerClient/IACdefines.h      2004-08-09 23:17:11.000000000 +0200
+++ CardManagerClient.new/IACdefines.h  2004-08-14 00:22:41.000000000 +0200
@@ -14,6 +14,17 @@
 #ifndef __IACdefines_h__
 #define __IACdefines_h__
 
+#ifdef WIN32
+#include <windows.h>
+#elif SOLARIS
+#include <winscard.h>
+#elif LINUX
+#include <winscard.h>
+#else // MAC
+#include <PCSC/wintypes.h>
+#include <PCSC/winscard.h>
+#endif  
+
 #ifdef __cplusplus
 extern "C"
 {
@@ -75,7 +86,9 @@
 } IACDESKeys, *IACPDESKeys;
 
 // Maximum transport buffer.
+#ifndef MAX_BUFFER_SIZE
 #define MAX_BUFFER_SIZE                        265
+#endif
 
 // Transport structure
 typedef struct {
diff -ru CardManagerClient/Makefile CardManagerClient.new/Makefile
--- CardManagerClient/Makefile  2004-08-13 00:22:36.000000000 +0200
+++ CardManagerClient.new/Makefile      2004-08-14 00:29:05.000000000 +0200
@@ -1,8 +1,8 @@
-CC              = /usr/bin/gcc
-LD              = /usr/bin/ld
-INCLUDE         = -I/usr/local/include/
-LIBS            = -lcrypto -lssl -framework PCSC
-CFLAGS          = -DAPPLE
+CC              = gcc
+LD              = ld
+INCLUDE         = -I/usr/local/include/ `pkg-config libpcsclite --cflags`
+LIBS            = -L/usr/local/lib/ -lcrypto -lssl -lpcsclite -lpthread
+CFLAGS          = -DLINUX
 OBJ             = CMSClient.o IACCardList.o IACCardState.o IACExchangeData.o \
                IACdebug.o openSSLclient.o openSSLcommon.o openSSLreentrant.o
 
@@ -30,4 +30,4 @@
        chmod a+r /usr/local/iacms/AppletLoaderClient/Certs/rootcert.pem
 
 clean:
-       /bin/rm -f *.o *- IAC_Client
\ No newline at end of file
+       /bin/rm -f *.o *- IAC_Client
diff -ru CardManagerClient/make-dirs/Makefile.apple 
CardManagerClient.new/make-dirs/Makefile.apple
--- CardManagerClient/make-dirs/Makefile.apple  2004-08-13 00:22:36.000000000 +0200
+++ CardManagerClient.new/make-dirs/Makefile.apple      2004-08-14 00:28:41.000000000 
+0200
@@ -30,4 +30,4 @@
        chmod a+r /usr/local/iacms/AppletLoaderClient/Certs/rootcert.pem
 
 clean:
-       /bin/rm -f *.o *- IAC_Client
\ No newline at end of file
+       /bin/rm -f *.o *- IAC_Client
diff -ru CardManagerClient/make-dirs/Makefile.linux 
CardManagerClient.new/make-dirs/Makefile.linux
--- CardManagerClient/make-dirs/Makefile.linux  2004-08-12 19:58:29.000000000 +0200
+++ CardManagerClient.new/make-dirs/Makefile.linux      2004-08-14 00:29:05.000000000 
+0200
@@ -1,6 +1,6 @@
-CC              = /usr/bin/gcc
-LD              = /usr/bin/ld
-INCLUDE         = -I/usr/local/include/
+CC              = gcc
+LD              = ld
+INCLUDE         = -I/usr/local/include/ `pkg-config libpcsclite --cflags`
 LIBS            = -L/usr/local/lib/ -lcrypto -lssl -lpcsclite -lpthread
 CFLAGS          = -DLINUX
 OBJ             = CMSClient.o IACCardList.o IACCardState.o IACExchangeData.o \
@@ -30,4 +30,4 @@
        chmod a+r /usr/local/iacms/AppletLoaderClient/Certs/rootcert.pem
 
 clean:
-       /bin/rm -f *.o *- IAC_Client
\ No newline at end of file
+       /bin/rm -f *.o *- IAC_Client
_______________________________________________
Muscle mailing list
[EMAIL PROTECTED]
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to