Hello,

Le 8 septembre 2009 16:00, François
Leblanc<[email protected]> a écrit :
> I've made a new patch integrating correction from Andreas, Aleksey
> and Alan (thank you for your remarks).

Can you add WESTCOS in the constants and structures names that are
Westcos specific?
SC_CARDCTL_FREZZE -> SC_CARDCTL_WESTCOS_FREZZE
sc_autkey_t -> sc_cardctl_westcos_autkey_t

I think it is FREEZE and not FREZZE (2 'E' and 1 'Z').

Index: src/libopensc/cardctl.h
===================================================================
--- src/libopensc/cardctl.h     (revision 3717)
+++ src/libopensc/cardctl.h     (working copy)
@@ -175,6 +175,19 @@
        SC_CARDCTL_RTECP_INIT,
        SC_CARDCTL_RTECP_INIT_END,
        SC_CARDCTL_RTECP_GENERATE_KEY,
+
+       /*
+       * Westcos specific
+       */
+       SC_CARDCTL_FREZZE = _CTL_PREFIX('W', 'T', 'C'),
+       SC_CARDCTL_CREATE_MF,
+       SC_CARDCTL_COMMIT,
+       SC_CARDCTL_ROLLBACK,
+       SC_CARDCTL_AUT_KEY,
+       SC_CARDCTL_CHANGE_KEY,
+       SC_CARDCTL_SET_DEFAULT_KEY,
+       SC_CARDCTL_LOAD_DATA,
+
 };

 enum {
@@ -462,6 +475,22 @@
 #define OP_TYPE_STORE          1

 /*
+ * Westcos
+ */
+
+typedef struct {
+       int key_reference;
+       int key_len; //8, 16 or 24
+       u8      key_value[24];
+}sc_autkey_t;
+
+typedef struct {
+       sc_autkey_t master_key;
+       sc_autkey_t new_key;
+       u8 key_template[7];
+}sc_changekey_t;
+
+/*
  *  RuToken types and constants
  */


It is a good idea NOT to use Windows types like BYTE (in
src/libopensc/crc_AetB.c for example).


Regarding src/tools/westcos-tool.c you should use english texts and
names. For example the function debloque_pin() should be renamed
unblock_pin(), print_openssl_erreur() should be print_openssl_error().
I have no problem with french myself but I can see how difficult it
can be for other developpers of the OpenSC project.

You can use gettext to have french texts. It would be much more easy
for users than using a -DENGLISH or
 -DFRENCH define to switch. I think no one will object an i18n + l10n
effort in OpenSC. Other tools could also follow the same way if
someone is motivated.


I have not tried to compile the source code. You should recompile it
with at least -Wall -Wextra and correct any warning if any.

Regards,

-- 
 Dr. Ludovic Rousseau
_______________________________________________
opensc-devel mailing list
[email protected]
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to