version 0.4
authorNIIBE Yutaka <gniibe@fsij.org>
Tue, 9 Nov 2010 05:32:41 +0000 (14:32 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Tue, 9 Nov 2010 05:32:41 +0000 (14:32 +0900)
.gitignore
ChangeLog
ChibiOS_2.0.2/os/hal/platforms/STM32/pal_lld.c
ChibiOS_2.0.2/os/hal/platforms/STM32/pal_lld.h
NEWS
README
doc/DEMO-2 [new file with mode: 0644]
src/usb_desc.c
tool/dump_mem.py [new file with mode: 0755]

index 6cc6a0c..4029f69 100644 (file)
@@ -2,3 +2,13 @@
 src/Makefile
 src/config.h
 src/gnuk.ld
+*.lst
+*.o
+*.pyc
+src/.dep
+src/gnuk.bin
+src/gnuk.dmp
+src/gnuk.elf
+src/gnuk.hex
+src/gnuk.map
+src/random_bits
index 8e0afd2..f6149a7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
+2010-11-09  NIIBE Yutaka  <gniibe@fsij.org>
+
+       * Version 0.4.
+
+       * src/usb_desc.c (gnukStringSerial): Updated.
+
+       * ChibiOS_2.0.2/os/hal/platforms/STM32/pal_lld.h (PALConfig):
+       STBee Mini uses STM32F103CBT6 which expose no GPIO E port.
+       * ChibiOS_2.0.2/os/hal/platforms/STM32/pal_lld.c (_pal_lld_init):
+       Likewise.
+
 2010-11-08  NIIBE Yutaka  <gniibe@fsij.org>
 
+       * tool/dump_mem.py: New tool.
+
        Implement GC for data pool in flash memory.
        * src/openpgp-do.c (gpg_write_digital_signature_counter): New.
        (gpg_increment_digital_signature_counter): Fix for GC.
index 1ab8d06..677264e 100644 (file)
@@ -114,7 +114,7 @@ void _pal_lld_init(const PALConfig *config) {
   IOPORT4->ODR = config->PDData.odr;
   IOPORT4->CRH = config->PDData.crh;
   IOPORT4->CRL = config->PDData.crl;
-#if !defined(STM32F10X_LD) || defined(__DOXYGEN__)
+#if !(defined(STM32F10X_LD) || defined(BOARD_STBEE_MINI)) || defined(__DOXYGEN__)
   IOPORT5->ODR = config->PEData.odr;
   IOPORT5->CRH = config->PEData.crh;
   IOPORT5->CRL = config->PEData.crl;
index 81ff742..cbb2fc1 100644 (file)
@@ -83,7 +83,7 @@ typedef struct {
   stm32_gpio_setup_t    PCData;
   /** @brief Port D setup data.*/
   stm32_gpio_setup_t    PDData;
-#if !defined(STM32F10X_LD) || defined(__DOXYGEN__)
+#if !(defined(STM32F10X_LD) || defined(BOARD_STBEE_MINI)) || defined(__DOXYGEN__)
   /** @brief Port E setup data.*/
   stm32_gpio_setup_t    PEData;
 #endif
diff --git a/NEWS b/NEWS
index d0f8314..57e96a9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,10 +2,14 @@ Gnuk NEWS - User visible changes
 
 * Major changes in Gnuk 0.4
 
-  Released 2010-11-XX, by NIIBE Yutaka
+  Released 2010-11-09, by NIIBE Yutaka
+
+** New board support "STBee Mini".
 
 ** Flash writing tool for "DfuSe" is included now.
 
+** Since Flash GC is now implemented, it can be used longer.
+
 
 * Major changes in Gnuk 0.3
 
diff --git a/README b/README
index be62552..18f822d 100644 (file)
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
 Gnuk - software for GPG USB Token
 
                                                            Version 0.4
-                                                            2010-11-XX
+                                                            2010-11-09
                                                           Niibe Yutaka
                                      Free Software Initiative of Japan
 
@@ -26,7 +26,7 @@ USB Token by Gnuk everywhere.
 Release notes
 =============
 
-This is fourth release of Gnuk.  While it works well for specific
+This is fifth release of Gnuk.  While it works well for specific
 usages, it is still experimental.
 
 Tested features are:
diff --git a/doc/DEMO-2 b/doc/DEMO-2
new file mode 100644 (file)
index 0000000..022e715
--- /dev/null
@@ -0,0 +1,233 @@
+$ unset GPG_AGENT_INFO
+$ gpg --card-edit
+
+gpg: detected reader `FSIJ USB Token (20101023) 00 00'
+Application ID ...: D276000124010200F517000000010000
+Version ..........: 2.0
+Manufacturer .....: unknown
+Serial number ....: 00000001
+Name of cardholder: [not set]
+Language prefs ...: [not set]
+Sex ..............: unspecified
+URL of public key : [not set]
+Login data .......: [not set]
+Signature PIN ....: forced
+Key attributes ...: 2048R 2048R 2048R
+Max. PIN lengths .: 127 127 127
+PIN retry counter : 3 0 3
+Signature counter : 0
+Signature key ....: [none]
+Encryption key....: [none]
+Authentication key: [none]
+General key info..: [none]
+
+gpg/card> passwd
+gpg: OpenPGP card no. D276000124010200F517000000010000 detected
+gpg: gpg-agent is not available in this session
+
+Please enter the PIN
+Enter PIN: 123456
+           
+New PIN
+Enter New PIN: *************
+               
+New PIN
+Repeat this PIN: *************
+PIN changed.
+
+gpg/card> admin
+Admin commands are allowed
+
+gpg/card> sex
+Sex ((M)ale, (F)emale or space): m
+gpg: 3 Admin PIN attempts remaining before card is permanently locked
+
+Please enter the Admin PIN
+Enter Admin PIN: 12345678
+                 
+gpg/card> name
+Cardholder's surname: Niibe
+Cardholder's given name: Yutaka
+
+gpg/card> login
+Login data (account name): gniibe
+
+gpg/card> url
+URL to retrieve public key: http://www.gniibe.org/gniibe.asc
+
+gpg/card> lang
+Language preferences: ja
+
+gpg/card> passwd
+gpg: OpenPGP card no. D276000124010200F517000000010000 detected
+
+1 - change PIN
+2 - unblock PIN
+3 - change Admin PIN
+4 - set the Reset Code
+Q - quit
+
+Your selection? 3
+gpg: 3 Admin PIN attempts remaining before card is permanently locked
+
+Please enter the Admin PIN
+Enter Admin PIN: 12345678
+                 
+New Admin PIN
+Enter New Admin PIN: ***************
+                     
+New Admin PIN
+Repeat this PIN: ***************
+PIN changed.
+
+1 - change PIN
+2 - unblock PIN
+3 - change Admin PIN
+4 - set the Reset Code
+Q - quit
+
+Your selection? 4
+gpg: 3 Admin PIN attempts remaining before card is permanently locked
+
+Please enter the Admin PIN
+Enter Admin PIN: ***************
+                 
+New Reset Code
+Enter New PIN: ************
+               
+New Reset Code
+Repeat this PIN: ************
+Reset Code set.
+
+1 - change PIN
+2 - unblock PIN
+3 - change Admin PIN
+4 - set the Reset Code
+Q - quit
+
+Your selection? q
+
+gpg/card> quit
+$ gpg --edit-key 4CA7BABE
+gpg (GnuPG) 1.4.10; Copyright (C) 2008 Free Software Foundation, Inc.
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+
+Secret key is available.
+
+pub  2048R/4CA7BABE  created: 2010-10-15  expires: never       usage: SC  
+                     trust: ultimate      validity: ultimate
+sub  2048R/084239CF  created: 2010-10-15  expires: never       usage: E   
+sub  2048R/5BB065DC  created: 2010-10-22  expires: never       usage: A   
+[ultimate] (1). NIIBE Yutaka <gniibe@fsij.org>
+
+gpg> toggle
+
+sec  2048R/4CA7BABE  created: 2010-10-15  expires: never     
+ssb  2048R/084239CF  created: 2010-10-15  expires: never     
+ssb  2048R/5BB065DC  created: 2010-10-22  expires: never     
+(1)  NIIBE Yutaka <gniibe@fsij.org>
+
+gpg> keytocard
+Really move the primary key? (y/N) y
+gpg: detected reader `FSIJ USB Token (20101023) 00 00'
+Signature key ....: [none]
+Encryption key....: [none]
+Authentication key: [none]
+
+Please select where to store the key:
+   (1) Signature key
+   (3) Authentication key
+Your selection? 1
+
+You need a passphrase to unlock the secret key for
+user: "NIIBE Yutaka <gniibe@fsij.org>"
+2048-bit RSA key, ID 4CA7BABE, created 2010-10-15
+
+gpg: gpg-agent is not available in this session
+gpg: writing new key
+gpg: 3 Admin PIN attempts remaining before card is permanently locked
+
+Please enter the Admin PIN
+Enter Admin PIN: ***************
+                 
+sec  2048R/4CA7BABE  created: 2010-10-15  expires: never     
+                     card-no: F517 00000001
+ssb  2048R/084239CF  created: 2010-10-15  expires: never     
+ssb  2048R/5BB065DC  created: 2010-10-22  expires: never     
+(1)  NIIBE Yutaka <gniibe@fsij.org>
+
+gpg> key 1
+
+sec  2048R/4CA7BABE  created: 2010-10-15  expires: never     
+                     card-no: F517 00000001
+ssb* 2048R/084239CF  created: 2010-10-15  expires: never     
+ssb  2048R/5BB065DC  created: 2010-10-22  expires: never     
+(1)  NIIBE Yutaka <gniibe@fsij.org>
+
+gpg> keytocard
+Signature key ....: [none]
+Encryption key....: [none]
+Authentication key: [none]
+
+Please select where to store the key:
+   (2) Encryption key
+Your selection? 2
+
+You need a passphrase to unlock the secret key for
+user: "NIIBE Yutaka <gniibe@fsij.org>"
+2048-bit RSA key, ID 084239CF, created 2010-10-15
+
+gpg: writing new key
+
+sec  2048R/4CA7BABE  created: 2010-10-15  expires: never     
+                     card-no: F517 00000001
+ssb* 2048R/084239CF  created: 2010-10-15  expires: never     
+                     card-no: F517 00000001
+ssb  2048R/5BB065DC  created: 2010-10-22  expires: never     
+(1)  NIIBE Yutaka <gniibe@fsij.org>
+
+gpg> key 1
+
+sec  2048R/4CA7BABE  created: 2010-10-15  expires: never     
+                     card-no: F517 00000001
+ssb  2048R/084239CF  created: 2010-10-15  expires: never     
+                     card-no: F517 00000001
+ssb  2048R/5BB065DC  created: 2010-10-22  expires: never     
+(1)  NIIBE Yutaka <gniibe@fsij.org>
+
+gpg> key 2
+
+sec  2048R/4CA7BABE  created: 2010-10-15  expires: never     
+                     card-no: F517 00000001
+ssb  2048R/084239CF  created: 2010-10-15  expires: never     
+                     card-no: F517 00000001
+ssb* 2048R/5BB065DC  created: 2010-10-22  expires: never     
+(1)  NIIBE Yutaka <gniibe@fsij.org>
+
+gpg> keytocard
+Signature key ....: [none]
+Encryption key....: [none]
+Authentication key: [none]
+
+Please select where to store the key:
+   (3) Authentication key
+Your selection? 3
+
+You need a passphrase to unlock the secret key for
+user: "NIIBE Yutaka <gniibe@fsij.org>"
+2048-bit RSA key, ID 5BB065DC, created 2010-10-22
+
+gpg: writing new key
+
+sec  2048R/4CA7BABE  created: 2010-10-15  expires: never     
+                     card-no: F517 00000001
+ssb  2048R/084239CF  created: 2010-10-15  expires: never     
+                     card-no: F517 00000001
+ssb* 2048R/5BB065DC  created: 2010-10-22  expires: never     
+                     card-no: F517 00000001
+(1)  NIIBE Yutaka <gniibe@fsij.org>
+
+gpg> quit
+Save changes? (y/N) y
+$
index e1c705e..15386a4 100644 (file)
@@ -207,7 +207,7 @@ static const uint8_t gnukStringSerial[] = {
   8*2+2,                       /* bLength */
   USB_STRING_DESCRIPTOR_TYPE,  /* bDescriptorType */
   '2', 0, '0', 0, '1', 0, '0', 0,
-  '1', 0, '0', 0, '2', 0, '3', 0
+  '1', 0, '1', 0, '0', 0, '9', 0
 };
 
 const ONE_DESCRIPTOR Device_Descriptor = {
diff --git a/tool/dump_mem.py b/tool/dump_mem.py
new file mode 100755 (executable)
index 0000000..88ebd5c
--- /dev/null
@@ -0,0 +1,28 @@
+#! /usr/bin/python
+
+import sys
+from dfuse import *
+
+dev, config, intf = get_device()
+dfu = DFU_STM32(dev, config, intf)
+print dfu.ll_get_string(intf.iInterface)
+s = dfu.ll_get_status()
+dfu.ll_clear_status()
+s = dfu.ll_get_status()
+print s
+dfu.dfuse_set_address_pointer(int(sys.argv[1], 16))
+s = dfu.ll_get_status()
+dfu.ll_clear_status()
+s = dfu.ll_get_status()
+dfu.ll_clear_status()
+s = dfu.ll_get_status()
+print s
+block = dfu.dfuse_read_memory()
+count = 0
+for d in block:
+    print "%02x" % d,
+    if count & 0x0f == 0x0f:
+        print
+    count += 1
+dfu.ll_clear_status()
+s = dfu.ll_get_status()