On Saturday 25 November 2006 01:35, Andreas Jellinghaus wrote:
> BSD had for a long time this clause in its license:
> 3. All advertising materials mentioning features or use of this
> software must display the following acknowledgement:
>       This product includes software developed by the University of
>       California, Berkeley and its contributors.
>
> This clause caused a lot of problems. Some people like the FSF
> Europe think it makes a license incompatible with the GPL, but even
> if not it causes a lot of headache for everyone to make sure it is
> adhered.

Hi!

I've modified pkcs11-helper to use the new free pkcs11.h header.
I was surprised that it went relatively OK, good work! :)

Some modifications:

1. I changed __WIN32 to _WIN32, since _WIN32 is the constant
compilers use.
If you require __WIN32, please revert but add _WIN32.

2. Added CRYPTOKI_FORCE_WIN32, so that you can force the file
to generate WIN32 fixups. This is important for cygwin environment.

3. Added missing CKR_FUNCTION_REJECTED.

4. I don't understand the uppercase/lowercase game you play here...
But to #define common words as fixups is incorrect approach.
Why not leave the original names?

I've reverted the minimum required which conflict with Windows native
definitions.
-#define CreateMutex create_mutex
-#define DestroyMutex destroy_mutex
-#define LockMutex lock_mutex
-#define UnlockMutex unlock_mutex

5. CK_RV type should be unsigned long.

Please consider adding version information in the file text,
so we can synchronize revisions.

Best Regards,
Alon Bar-Lev.

--- pkcs11.h.org        2006-12-08 20:06:33.000000000 +0200
+++ pkcs11.h    2006-12-08 19:33:31.000000000 +0200
@@ -54,7 +54,7 @@
 
 /* System dependencies.  */
 
-#ifdef __WIN32
+#if defined(_WIN32) || defined(CRYPTOKI_FORCE_WIN32)
 
 /* There is a matching pop below.  */
 #pragma pack(push, cryptoki, 1)
@@ -584,7 +584,7 @@ struct ck_mechanism_info
 #define CKF_DONT_BLOCK                         (1)
 
 
-typedef unsigned int ck_rv_t;
+typedef unsigned long int ck_rv_t;
 
 
 typedef ck_rv_t (*ck_notify_t) (ck_session_handle_t session,
@@ -964,10 +964,10 @@ typedef ck_rv_t (*ck_unlockmutex_t) (voi
 
 struct ck_c_initialize_args
 {
-  ck_createmutex_t create_mutex;
-  ck_destroymutex_t destroy_mutex;
-  ck_lockmutex_t lock_mutex;
-  ck_unlockmutex_t unlock_mutex;
+  ck_createmutex_t CreateMutex;
+  ck_destroymutex_t DestroyMutex;
+  ck_lockmutex_t LockMutex;
+  ck_unlockmutex_t UnlockMutex;
   ck_flags_t flags;
   void *reserved;
 };
@@ -1060,6 +1060,7 @@ struct ck_c_initialize_args
 #define CKR_CRYPTOKI_ALREADY_INITIALIZED       (0x191)
 #define CKR_MUTEX_BAD                          (0x1a0)
 #define CKR_MUTEX_NOT_LOCKED                   (0x1a1)
+#define CKR_FUNCTION_REJECTED                   (0x200)
 #define CKR_VENDOR_DEFINED                     (1 << 31)
 
 
@@ -1202,11 +1203,6 @@ typedef struct ck_c_initialize_args *CK_
 
 #define pReserved reserved
 
-#define CreateMutex create_mutex
-#define DestroyMutex destroy_mutex
-#define LockMutex lock_mutex
-#define UnlockMutex unlock_mutex
-
 #define NULL_PTR NULL
 
 #endif /* CRYPTOKI_COMPAT */
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to