version 0.9
authorNIIBE Yutaka <gniibe@fsij.org>
Tue, 1 Feb 2011 06:25:36 +0000 (15:25 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Tue, 1 Feb 2011 06:25:36 +0000 (15:25 +0900)
ChangeLog
NEWS
README
src/openpgp-do.c
src/usb_prop.c
tool/gnuk_update_binary.py

index 53cd95e..e5a4489 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-02-01  NIIBE Yutaka  <gniibe@fsij.org>
+
+       * Version 0.9.
+
+       * src/openpgp-do.c (extended_capabilities): Change value for card
+       holder certificate.
+
+       * src/usb_prop.c (gnuk_device_SetInterface): New.
+
 2011-01-29  NIIBE Yutaka  <gniibe@fsij.org>
 
        * src/usb_prop.c (gnuk_device_Get_Interface_Setting): Handle the
diff --git a/NEWS b/NEWS
index 5d888fe..2329bea 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,9 +2,12 @@ Gnuk NEWS - User visible changes
 
 * Major changes in Gnuk 0.9
 
-  Released 2011-01-XX, by NIIBE Yutaka
+  Released 2011-02-01, by NIIBE Yutaka
 
-** Card Holder Certificate is supported.
+** Card Holder Certificate is supported (still this is experimental).
+Gnuk can support card holder certificate now.  Note that GnuPG is not
+ready yet.  The tool/gnuk_update_binary.py is for writing card holder
+certificate to Gnuk Token.
 
 ** Better interoperability to OpenSC.
 Gnuk is not yet supported by OpenSC, but it could be.  With the
diff --git a/README b/README
index 1dc0f31..e576604 100644 (file)
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
 Gnuk - software for GPG USB Token
 
                                                            Version 0.9
-                                                            2011-01-30
+                                                            2011-02-01
                                                           Niibe Yutaka
                                      Free Software Initiative of Japan
 
index e5ef24e..7df6bc9 100644 (file)
@@ -143,11 +143,15 @@ static const uint8_t extended_capabilities[] __attribute__ ((aligned (1))) = {
                                 */
   0,             /* Secure Messaging Algorithm: N/A (TDES=0, AES=1) */
   0x00, 0x00,    /* Max get challenge */
-  0x00, 0x00,    /* max. length of cardholder certificate */
+  0x07, 0xfe,    /* max. length of cardholder certificate (2KB - 2)*/
   /* Max. length of command data */
   (MAX_CMD_APDU_SIZE>>8), (MAX_CMD_APDU_SIZE&0xff),
   /* Max. length of response data */
+#if 0
   (MAX_RES_APDU_SIZE>>8), (MAX_RES_APDU_SIZE&0xff),
+#else
+  0x08, 0x00,               /* the case of cardholder ceritificate */
+#endif
 };
 
 /* Algorithm Attributes */
index b75b597..0298729 100644 (file)
@@ -149,6 +149,31 @@ gnuk_device_SetConfiguration (void)
     bDeviceState = CONFIGURED;
 }
 
+static void
+gnuk_device_SetInterface (void)
+{
+  uint16_t intf = pInformation->USBwIndex0;
+  
+  /* alternateSetting: pInformation->USBwValue0 should be 0 */
+
+  if (intf == 0)
+    {
+      ClearDTOG_RX (0x02);
+      ClearDTOG_TX (0x81);
+    }
+#ifdef ENABLE_VIRTUAL_COM_PORT
+  else if (intf == 1)
+    {
+      ClearDTOG_TX (0x84);
+    }
+  else if (intf == 2)
+    {
+      ClearDTOG_RX (0x05);
+      ClearDTOG_TX (0x83);
+    }
+#endif
+}
+
 static void
 gnuk_device_SetDeviceAddress (void)
 {
@@ -205,7 +230,7 @@ gnuk_device_GetStringDescriptor (uint16_t Length)
 
 #ifdef ENABLE_VIRTUAL_COM_PORT
 #define NUM_INTERFACES 3       /* two for CDC, one for CCID */
-#define
+#else
 #define NUM_INTERFACES 1       /* CCID only */
 #endif
 
@@ -338,7 +363,7 @@ const USER_STANDARD_REQUESTS User_Standard_Requests = {
   NOP_Process,                 /* GetConfiguration */ 
   gnuk_device_SetConfiguration,
   NOP_Process,                 /* GetInterface */
-  NOP_Process,                 /* SetInterface */
+  gnuk_device_SetInterface,
   NOP_Process,                 /* GetStatus */
   NOP_Process,                 /* ClearFeature */
   NOP_Process,                 /* SetEndPointFeature */
index a634720..0ef16e7 100755 (executable)
@@ -232,7 +232,7 @@ def main(filename):
     if icc.icc_get_status() == 2:
         raise ValueError, "No ICC present"
     elif icc.icc_get_status() == 1:
-        print icc.icc_power_on()
+        icc.icc_power_on()
     icc.cmd_verify(3, "12345678")
     icc.cmd_update_binary(0, data)
     icc.cmd_select_openpgp()