9280bb280ac892a1e09204ca68c594ae9eaa1b61
[gnuk/gnuk.git] / ChangeLog
1 2011-02-24  NIIBE Yutaka  <gniibe@fsij.org>
2
3         * src/usb_prop.c (gnuk_device_SetInterface): Fix argument to
4         ClearDTOG_TX.
5
6 2011-02-10  NIIBE Yutaka  <gniibe@fsij.org>
7
8         * Version 0.10.
9
10         * src/configure, src/Makefile.in (BOARD_DIR): New.
11
12         * boards/CQ_STARM/board.mk, boards/OLIMEX_STM32_H103/board.mk:
13         Removed.
14         * boards/STBEE/board.mk, boards/STBEE_MINI/board.mk: Removed.
15         * boards/STM32_PRIMER2/board.mk, boards/STM8S_DISCOVERY/board.mk:
16         Removed.
17
18         * src/Makefile.in (OUTFILES): Don't include random_bits.
19
20 2011-02-09  NIIBE Yutaka  <gniibe@fsij.org>
21
22         * src/usb_prop.c (gnukStringSerial): Updated.
23
24         * tool/gnuk_put_binary.py (gnuk_token.__del__): Removed.
25         Releasing the interface is done in PyUSB.
26
27         * tool/dfuse.py (DFU_STM32.__del__): Removed.
28
29         * src/openpgp.c (cmd_write_binary): Support random bits and card
30         holder certificate as well.
31
32         * src/openpgp-do.c (do_openpgpcard_aid): Add volatile to prevent
33         compiler optimization to access AID.
34
35 2011-02-08  NIIBE Yutaka  <gniibe@fsij.org>
36
37         * tool/gnuk_put_binary.py: Renamed (was: gnuk_update_binary.py).
38         (gnuk_token.cmd_write_binary): New.
39         (main): Support writing serial number.
40
41         * GNUK_SERIAL_NUMBER: Renamed (was: FSIJ_SERIAL_NUMBER).
42
43         * src/config.h.in (@SERIAL_DEFINE@): Removed.
44
45         * src/gnuk.h (FILEID_SERIAL_NO): New.
46
47         * src/openpgp.c (INS_WRITE_BINARY, cmd_write_binary): New.
48
49         * src/configure: Remove --with-fixed-serial support.
50
51         * src/openpgp-do.c (do_openpgpcard_aid): Remove support of
52         SERIAL_NUMBER_IN_AID.
53
54         * src/flash.c (flash_write_binary): Support FILEID_SERIAL_NO.
55
56 2011-02-04  NIIBE Yutaka  <gniibe@fsij.org>
57
58         * tool/gnuk_update_binary.py: Support updating random bits.
59
60         * src/random.c (random_bits_start): Renamed.
61         (random_bytes_get): Check initial erased state.
62
63         * src/Makefile.in (random-data.o): Removed.
64
65         * src/gnuk.ld.in (.gnuk_random): Don't have .gnuk_random any more.
66
67         * src/flash.c (flash_erase_binary): Support FILEID_RANDOM.
68         (flash_write_binary): Ditto.
69
70         * src/openpgp.c (cmd_reset_user_password): Fix PINPAD_SUPPORT case
71         with reset code.
72
73 2011-02-01  NIIBE Yutaka  <gniibe@fsij.org>
74
75         * Version 0.9.
76
77         * src/openpgp-do.c (extended_capabilities): Change value for card
78         holder certificate.
79
80         * src/usb_prop.c (gnuk_device_SetInterface): New.
81
82 2011-01-29  NIIBE Yutaka  <gniibe@fsij.org>
83
84         * src/usb_prop.c (gnuk_device_Get_Interface_Setting): Handle the
85         case where we have multiple interfaces.
86
87 2011-01-28  NIIBE Yutaka  <gniibe@fsij.org>
88
89         * tool/gnuk_update_binary.py: New.
90
91         * src/openpgp-do.c (gpg_do_get_data): Fix length adding two for
92         status word at the end and adding four for the tag and the length.
93
94         * src/usb-icc.c (icc_handle_data): Fix decrementing res_APDU_size.
95         (icc_power_off): Status should be the one *after* power off.
96
97         * src/openpgp.c (cmd_update_binary): Fix return code.
98
99 2011-01-27  NIIBE Yutaka  <gniibe@fsij.org>
100
101         * src/usb-icc.c (res_APDU_pointer): New.
102         (icc_handle_data, USBthread): Handle res_APDU_pointer.
103
104         * src/openpgp.h (GPG_COMMAND_NOT_ALLOWED): New.
105
106         * src/openpgp.c (INS_UPDATE_BINARY, FILE_EF_CH_CERTIFICATE)
107         (FILE_EF_RANDOM, cmd_update_binary): New.
108         (process_command_apdu): Initialize res_APDU_pointer.
109
110         * src/openpgp-do.c (gpg_do_get_data): Handle GPG_DO_CH_CERTIFICATE.
111
112         * src/gnuk.ld.in (.gnuk_ch_certificate): New.
113
114         * src/flash.c (flash_check_blank, flash_erase_binary)
115         (flash_write_binary): New.
116
117         * src/openpgp-do.c (gpg_do_table): Exclude GPG_DO_CH_CERTIFICATE.
118
119         * src/openpgp.c (cmd_reset_user_password): Add PINPAD_SUPPORT.
120
121         * src/gnuk.ld.in: Fix alignment and filling.
122
123 2011-01-26  NIIBE Yutaka  <gniibe@fsij.org>
124
125         * boards/STBEE/mcuconf.h: New.
126         * boards/STBEE/board.mk: New.
127         * boards/STBEE/board.h: New.
128         * boards/STBEE/board.c: New.
129
130         * tool/dfuse.py (DFU_STM32.verify): Add double ll_clear_status.
131
132         * src/configure (target): Add STBEE.
133
134 2011-01-25  NIIBE Yutaka  <gniibe@fsij.org>
135
136         * src/openpgp.c (cmd_pso): Support DigestInfo by MD5 (for opensc).
137
138 2011-01-22  NIIBE Yutaka  <gniibe@fsij.org>
139
140         * src/openpgp.c (cmd_pgp_gakp): Handle case of non-extended Lc.
141         (cmd_select_file): Return DF name when FCI is requested.
142
143         * src/openpgp-do.c (copy_do): Don't add tag if not requested.
144
145         * src/gnuk.h (memmove): Add declaration.
146
147 2011-01-21  NIIBE Yutaka  <gniibe@fsij.org>
148
149         * src/openpgp-do.c (copy_do): Fix off-by-one error.
150
151         * src/openpgp.c (get_pinpad_input): Ifdef-out PINPAD_SUPPORT.
152
153 2011-01-19  NIIBE Yutaka  <gniibe@fsij.org>
154
155         * Version 0.8.
156
157         * src/pin-cir.c (pin_main): Fix typo, call cir_ext_disable.
158
159         * src/usb_prop.c (gnukStringSerial): Updated.
160
161         * src/pin-dial.c: New.
162
163         * boards/STBEE_MINI/board.c (hwinit1): Add PINPAD_DIAL_SUPPORT.
164         (dial_sw_disable, dial_sw_enable, EXTI2_IRQHandler): New.
165
166         * src/gnuk.h: Add PINPAD_DIAL_SUPPORT.
167
168         * src/usb-icc.c (icc_handle_data): Handle PIN modification.
169
170         * src/usb_desc.c (gnukConfigDescriptor): bPinSupport = 3 when
171         PINPAD_DIAL_SUPPORT is enabled.
172
173 2011-01-18  NIIBE Yutaka  <gniibe@fsij.org>
174
175         * src/pin-cir.c (pin_main): Call cir_ext_disable at the end.
176
177 2011-01-17  NIIBE Yutaka  <gniibe@fsij.org>
178
179         * src/gnuk.h (PIN_INPUT_CURRENT, PIN_INPUT_NEW)
180         (PIN_INPUT_CONFIRM): New.
181
182         * src/pin-cir.c (pin_main): New argument MSG_CODE.
183
184         * src/openpgp.c (get_pinpad_input): New.
185         (cmd_verify): Use get_pinpad_input.
186         (cmd_change_password): Added PINPAD_SUPPORT.
187
188         * src/openpgp.c (cmd_nop): Removed.
189
190         * src/config.h.in: ifdef-out (not for ASSEMBLER).
191
192 2011-01-15  NIIBE Yutaka  <gniibe@fsij.org>
193
194         * Version 0.7.
195
196         * src/usb-icc.c (icc_handle_data): Bug fix: add break for case
197         ICC_STATE_SEND.
198
199 2011-01-14  NIIBE Yutaka  <gniibe@fsij.org>
200
201         * Version 0.6.
202
203         * src/usb_prop.c (gnukStringSerial): Include version number (again).
204
205         * boards/STM8S_DISCOVERY/board.c (hwinit1): Initialize TIM3 and
206         remap TIM3.
207         (cir_ext_disable, cir_ext_enable, EXTI9_5_IRQHandler)
208         (TIM3_IRQHandler): New.
209
210         * boards/STBEE_MINI/board.h (HAVE_7SEGLED): New.
211
212         * boards/STM8S_DISCOVERY/board.h: Include "config.h".
213         (VAL_GPIOBODR): PB0 (TIM3_CH3) is pull-down for PINPAD_SUPPORT.
214
215         * src/pin-cir.c (pindisp): Handle the board with no 7 segment
216         display.
217
218 2011-01-11  NIIBE Yutaka  <gniibe@fsij.org>
219
220         * src/openpgp-do.c (do_openpgpcard_aid): Fix length of res_p;
221
222 2011-01-08  NIIBE Yutaka  <gniibe@fsij.org>
223
224         * src/usb-icc.c (icc_handle_data): Handle the case of
225         ICC_STATE_SEND (back again to the implementation of v0.4).
226         (USBthread): Don't send back larger block (for libccid 1.3.11).
227
228 2011-01-07  NIIBE Yutaka  <gniibe@fsij.org>
229
230         * src/openpgp.c (cmd_read_binary): Call gpg_do_get_data for AID.
231
232         * src/openpgp-do.c (gpg_do_get_data): Added new argument WITH_TAG.
233
234         * src/usb_prop.c (gnuk_device_init)
235         (gnuk_device_GetStringDescriptor): gnukStringSerial with unique
236         chip ID.
237
238         * src/openpgp-do.c (do_openpgpcard_aid): New.
239         (openpgpcard_aid): Removed.
240
241         * boards/common/hw_config.c (unique_device_id): New.
242
243 2011-01-06  NIIBE Yutaka  <gniibe@fsij.org>
244
245         * src/config.h.in (PINPAD_MORE_DEFINE): Added.
246
247         * src/configure: Requiring bash (for variable substitution), added
248         PINPAD.
249
250         * src/Makefile.in: Support PINPAD.
251
252         * src/pin-cir.c (cir_timer_interrupt): Support Sharp protocol.
253
254 2011-01-04  NIIBE Yutaka  <gniibe@fsij.org>
255
256         * src/chconf.h (CH_USE_DYNAMIC): It's TRUE now.
257
258         * src/usb_desc.c (gnukConfigDescriptor): Added PINPAD_SUPPORT.
259
260         * src/pin-cir.c (cir_timer_interrupt): Added CIR_PERIOD_INHIBIT_CHATTER.
261
262 2010-12-29  NIIBE Yutaka  <gniibe@fsij.org>
263
264         * src/pin-cir.c (cir_timer_interrupt): Support Philips RC-5 protocol.
265
266 2010-12-28  NIIBE Yutaka  <gniibe@fsij.org>
267
268         * src/pin-cir.c (cir_timer_interrupt): Support Philips RC-6 protocol.
269
270 2010-12-27  NIIBE Yutaka  <gniibe@fsij.org>
271
272         * src/pin-cir.c (cir_timer_interrupt): Support Sony protocol.
273
274 2010-12-24  NIIBE Yutaka  <gniibe@fsij.org>
275
276         * src/pin-cir.c: New file.
277
278 2010-12-20  NIIBE Yutaka  <gniibe@fsij.org>
279
280         * src/openpgp.c (GPGthread): Added PINPAD_SUPPORT.
281         * boards/STBEE_MINI/mcuconf.h: Simplified.
282         * boards/STBEE_MINI/board.h: Include config.h.
283         (PINPAD_SUPPORT): Added.
284         * boards/STBEE_MINI/board.c (hwinit1): Added PINPAD_SUPPORT.
285
286 2010-12-15  NIIBE Yutaka  <gniibe@fsij.org>
287
288         * src/configure (FLASH_SIZE): Without 'k'.
289         * src/gnuk.ld.in (MEMORY): Append "k" here.
290         (.gnuk_flash): End point should be aligned too.
291
292         * src/config.h.in (@PINPAD_DEFINE@): New.
293         * src/Makefile.in (@PINPAD_MAKE_OPTION@): New.
294         * src/configure (PINPAD_MAKE_OPTION, PINPAD_DEFINE): New.
295
296 2010-12-14  NIIBE Yutaka  <gniibe@fsij.org>
297
298         * src/configure (FLASH_PAGE_SIZE): Always set.
299
300 2010-12-13  NIIBE Yutaka  <gniibe@fsij.org>
301
302         * Version 0.5.
303
304         * src/usb_desc.c (gnukStringSerial): Updated.
305
306 2010-12-10  NIIBE Yutaka  <gniibe@fsij.org>
307
308         * src/usb-cdc-vport.c (Virtual_Com_Port_Data_Setup)
309         (Virtual_Com_Port_NoData_Setup): No check for class&interface
310         request.
311
312         * src/usb-icc.c (ATR): Fixed.
313
314         * src/usb_desc.c (/* ICC Descriptor*/): bcdCCID = 1.1.
315         dwDefaultClock = dwMaximumClock = 3571.
316         dwFeatures 0x00040842.
317
318         * src/usb_prop.c (gnuk_clock_frequencies, gnuk_data_rates): New.
319         (gnuk_nothing_todo): Removed.
320         (gnuk_setup_with_data, gnuk_setup_with_nodata): New.
321         (Device_Property): Changed to call gnuk_setup_with_data and
322         gnuk_setup_with_nodata.
323
324 2010-12-09  NIIBE Yutaka  <gniibe@fsij.org>
325
326         * src/usb-icc.c (icc_power_off): Set icc_data_size = 0 to specify
327         no command APDU.  Signal GPGThread.
328         (icc_handle_data, USBthread): Don't signal main thread any more.
329
330         * src/openpgp.c (GPGthread): Only process the command APDU, if any.
331
332         * src/openpgp-do.c (do_tag_to_nr): Don't call fatal.
333         * src/main.c (fatal_code): New.
334         (main): Implemented 1-bit LED status display.
335         (fatal): Added argument CODE.
336         * src/flash.c (flash_data_pool_allocate): Supply argument FATAL_FLASH.
337         * src/random.c (random_bytes_get): Supply argument FATAL_RANDOM.
338         * src/ac.c (auth_status): Added volatile, and remove static.
339
340 2010-12-08  NIIBE Yutaka  <gniibe@fsij.org>
341
342         * src/gnuk.h (AC_OTHER_AUTHORIZED): Renamed (was:
343         AC_PSO_OTHER_AUTHORIZED).
344         * src/ac.c (ac_reset_other): Renamed (was: ac_reset_pso_other).
345         (verify_other): Renamed (was: verify_pso_other).
346         (ac_reset_admin): New.
347         * src/openpgp.c (cmd_change_password): Call ac_reset_admin.
348
349         * src/main.c (main): Don't create GPGThread here.
350         * src/usb-icc.c (icc_power_on): But create here, when requested.
351         (icc_power_off): Terminate GPGThread.
352         * src/openpgp.c (gpg_init, gpg_fini): New.
353         (GPGthread): Check chThdShouldTerminate.  Call gpg_init and gpg_fini.
354
355 2010-12-07  NIIBE Yutaka  <gniibe@fsij.org>
356
357         USB CCID/ICC implementation changes.
358         * src/usb_desc.c (dwMaxCCIDMessageLength): Updated.
359         * src/usb-icc.c (EV_TX_FINISHED): New.
360         (icc_rcv_data, icc_tx_data): Removed.
361         (icc_buffer, icc_seq): New.
362         (icc_next_p, icc_chain_p): New.
363         (icc_tx_ready): Removed.
364         (EP1_IN_Callback): Handle multiple transactions.
365         (icc_prepare_receive): New.
366         (EP2_OUT_Callback): Handle multiple transactions.
367         (icc_error, icc_send_status): Handle the case of receive in chain.
368         (icc_power_on, icc_send_params): Specify it's a single transaction.
369         (icc_send_data_block_filling_header): New.
370         (icc_send_data_block): Simplify.
371         (icc_handle_data): Removed the case of ICC_STATE_SEND.
372         Handle buffer of multiple transactions.
373         (USBthread): Don't use sending in chain.
374         * src/gnuk.h (USB_LL_BUF_SIZE): New.
375         (USB_BUF_SIZE): Now, it's larger value.
376         * src/configure: Echo for --enable-debug.
377         * src/call-rsa.c (rsa_sign): Use temp[] buffer as rsa_pkcs1_sign
378         writes OUTPUT in early stage.
379
380 2010-12-04  NIIBE Yutaka  <gniibe@fsij.org>
381
382         * src/flash.c (flash_keystore_release): Reset keystore storage.
383
384 2010-12-03  NIIBE Yutaka  <gniibe@fsij.org>
385
386         Keystore management changes.
387         * src/flash.c (flash_key_alloc): Check FLASH_KEYSTORE_SIZE.
388         (flash_key_release): Removed.
389         (flash_keystore_release): New function.
390         * src/openpgp-do.c (gpg_do_write_prvkey): Make it static.
391         When there is a key already, return as error.
392         (proc_key_import): Call flash_keystore_release when all keys removed.
393         * src/gnuk.ld.in (_keystore_pool): Size of keystore is now 1.5KB.
394
395 2010-11-30  NIIBE Yutaka  <gniibe@fsij.org>
396
397         Flash ROM fixes for STM32F10X_HD.
398         * src/gnuk.ld.in (.gnuk_flash): Use FLASH_PAGE_SIZE.
399         * src/configure (FLASH_PAGE_SIZE): Defined for gnuk.ld.
400         * src/flash.c (FLASH_PAGE_SIZE): New define.
401         (FLASH_DATA_POOL_SIZE): Use FLASH_PAGE_SIZE.
402
403         Import changes of ChibiOS_2.0.8.
404         * ChibiOS_2.0.8/os/hal/include/pwm.h
405         * ChibiOS_2.0.8/os/hal/platforms/STM32/pwm_lld.c
406         * ChibiOS_2.0.8/os/hal/platforms/STM32/pwm_lld.h
407         * ChibiOS_2.0.8/os/hal/src/pwm.c
408         * ChibiOS_2.0.8/os/hal/templates/pwm_lld.c
409         * ChibiOS_2.0.8/os/hal/templates/pwm_lld.h
410         * ChibiOS_2.0.8/os/kernel/include/ch.h
411         * ChibiOS_2.0.8/os/kernel/src/chevents.c
412         * ChibiOS_2.0.8/os/kernel/src/chthreads.c
413         * ChibiOS_2.0.8/boards/OLIMEX_LPC_P2148/board.h
414         * ChibiOS_2.0.8/readme.txt
415         * ChibiOS_2.0.8/test/testdyn.c
416         * ChibiOS_2.0.8/docs/*/*: Updated.
417
418         New private key management.
419         * src/ac.c (ac_reset_pso_cds, ac_reset_pso_other): Call
420         gpg_do_clear_prvkey.
421         (verify_pso_other): load private keys here.
422         * src/openpgp-do.c (kd): Keydata for Signing, Decryption, and
423         Authentication.
424         (gpg_do_load_prvkey, gpg_do_write_prvkey): Use kd[].
425         (gpg_do_clear_prvkey): New function.
426         * src/openpgp.c (cmd_pso, cmd_internal_authenticate): Use new API
427         of rsa_sign and rsa_decrypt.
428         (cmd_pso): Fixed bug of checking return value of gpg_get_pw1_lifetime.
429         * src/call-rsa.c (rsa_sign): New argument KD.
430         (rsa_decrypt): Likewise.
431
432         Don't use malloc/free in C library.
433         * src/stdlib.h (malloc, free): Use chHeapAlloc and chHeapFree.
434
435 2010-11-26  NIIBE Yutaka  <gniibe@fsij.org>
436
437         * boards/STM8S_DISCOVERY/*: New.
438         * src/configure: STM8S_DISCOVERY only has 64KB flash memory.
439
440         * boards/STBEE_MINI/board.h (CPU_WITH_NO_GPIOE): New define.
441         * ChibiOS_2.0.6/os/hal/platforms/STM32/hal_lld.c: Use it.
442         * ChibiOS_2.0.6/os/hal/platforms/STM32/pal_lld.c: Likewise.
443         * ChibiOS_2.0.6/os/hal/platforms/STM32/pal_lld.h: Likewise.
444
445         * src/openpgp.c (cmd_pso): DigestInfo by SHA224/SHA384/SHA512 is
446         supported.
447
448 2010-11-22  NIIBE Yutaka  <gniibe@fsij.org>
449
450         Import changes of ChibiOS_2.0.6.
451         * ChibiOS_2.0.6/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h
452         * ChibiOS_2.0.6/os/hal/include/can.h
453         * ChibiOS_2.0.6/os/hal/platforms/AT91SAM7/hal_lld.c
454         * ChibiOS_2.0.6/os/hal/platforms/AT91SAM7/serial_lld.c
455         * ChibiOS_2.0.6/os/hal/platforms/LPC214x/serial_lld.c
456         * ChibiOS_2.0.6/os/hal/platforms/STM32/hal_lld_f103.h
457         * ChibiOS_2.0.6/os/hal/platforms/STM32/hal_lld_f105_f107.h
458         * ChibiOS_2.0.6/os/hal/platforms/STM32/pwm_lld.c
459         * ChibiOS_2.0.6/os/hal/platforms/STM32/serial_lld.h
460         * ChibiOS_2.0.6/os/hal/platforms/STM32/spi_lld.h
461         * ChibiOS_2.0.6/os/hal/src/adc.c
462         * ChibiOS_2.0.6/os/hal/src/spi.c
463         * ChibiOS_2.0.6/os/kernel/include/ch.h
464         * ChibiOS_2.0.6/os/kernel/include/chinline.h
465         * ChibiOS_2.0.6/os/kernel/include/chioch.h
466         * ChibiOS_2.0.6/os/kernel/include/chstreams.h
467         * ChibiOS_2.0.6/os/kernel/include/chthreads.h
468         * ChibiOS_2.0.6/os/kernel/src/chlists.c
469         * ChibiOS_2.0.6/os/kernel/src/chschd.c
470         * ChibiOS_2.0.6/os/kernel/src/chthreads.c
471         * ChibiOS_2.0.6/os/ports/GCC/ARM/rules.mk
472         * ChibiOS_2.0.6/os/ports/GCC/ARM7/chcore.h
473         * ChibiOS_2.0.6/os/ports/GCC/ARM7/port.dox
474         * ChibiOS_2.0.6/os/ports/GCC/ARMCMx/chcore_v6m.c
475         * ChibiOS_2.0.6/os/ports/GCC/ARMCMx/chcore_v6m.h
476         * ChibiOS_2.0.6/os/ports/GCC/ARMCMx/chcore_v7m.c
477         * ChibiOS_2.0.6/os/ports/GCC/ARMCMx/chcore_v7m.h
478         * ChibiOS_2.0.6/os/ports/GCC/ARMCMx/old/chcore_v7m.h
479         * ChibiOS_2.0.6/os/ports/GCC/AVR/chcore.h
480         * ChibiOS_2.0.6/os/ports/GCC/AVR/port.dox
481         * ChibiOS_2.0.6/os/ports/GCC/MSP430/chcore.c
482         * ChibiOS_2.0.6/os/ports/GCC/MSP430/chcore.h
483         * ChibiOS_2.0.6/os/ports/GCC/MSP430/port.dox
484         * ChibiOS_2.0.6/os/ports/GCC/PPC/chcore.h
485         * ChibiOS_2.0.6/os/ports/GCC/PPC/port.dox
486         * ChibiOS_2.0.6/os/ports/RC/STM8/port.dox
487         * ChibiOS_2.0.6/os/various/memstreams.h
488         * ChibiOS_2.0.6/readme.txt
489         * ChibiOS_2.0.6/docs/*/*: Updated
490
491 2010-11-14  NIIBE Yutaka  <gniibe@fsij.org>
492
493         * src/openpgp.c (cmd_pso): DigestInfo by SHA256 is supported.
494
495 2010-11-12  NIIBE Yutaka  <gniibe@fsij.org>
496
497         * src/usb_desc.c (gnukConfigDescriptor): Change dwFeatures.
498
499         * src/usb-icc.c (icc_send_params): Always return fixed result.
500         (icc_handle_data): Support ICC_GET_PARAMS.
501
502 2010-11-10  NIIBE Yutaka  <gniibe@fsij.org>
503
504         * src/usb_desc.c (gnukConfigDescriptor): Fix bmAttributes.
505
506 2010-11-09  NIIBE Yutaka  <gniibe@fsij.org>
507
508         * Version 0.4.
509
510         * src/usb_desc.c (gnukStringSerial): Updated.
511
512         * ChibiOS_2.0.2/os/hal/platforms/STM32/pal_lld.h (PALConfig):
513         STBee Mini uses STM32F103CBT6 which expose no GPIO E port.
514         * ChibiOS_2.0.2/os/hal/platforms/STM32/pal_lld.c (_pal_lld_init):
515         Likewise.
516
517 2010-11-08  NIIBE Yutaka  <gniibe@fsij.org>
518
519         * tool/dump_mem.py: New tool.
520
521         Implement GC for data pool in flash memory.
522         * src/openpgp-do.c (gpg_write_digital_signature_counter): New.
523         (gpg_increment_digital_signature_counter): Fix for GC.
524         (gpg_data_scan): Rename from gpg_do_table_init.
525         (gpg_data_copy): New function for copying GC.
526         * src/main.c (main): Call gpg_data_scan with the address which
527         flash_init returns.
528         * src/flash.c (flash_erase_page): New function.
529         (FLASH_DATA_POOL_SIZE): data_pool is 2KiB now.
530         (flash_data): Put a header (GC generation).
531         (flash_init): Implement choosing a data pool page.
532         (flash_data_pool): Removed.
533         (flash_copying_gc): New function.
534         (flash_data_pool_allocate): Call flash_copying_gc when full.
535         (flash_do_write_internal, flash_put_data_internal)
536         (flash_bool_write_internal, flash_cnt123_write_internal): New
537         * src/gnuk.ld.in (gnuk_flash): data_pool is 2KiB now.
538
539         Bug fixes.
540         * src/openpgp.c (cmd_change_password, cmd_reset_user_password):
541         Write to APDU correctly.
542         * src/flash.c (flash_warning): Make it public.
543         * src/openpgp-do.c (do_hist_bytes, do_fp_all, do_cafp_all)
544         (do_kgtime_all, do_ds_count): Fix return value.
545         (rw_pw_status): Correctly return value.
546         (proc_resetting_code): Change func proto. to return success/failure.
547         (proc_key_import): Ditto.
548         (gpg_do_put_data): Handle return values.
549         (gpg_do_write_simple): Don't write to APDU.
550
551 2010-11-05  NIIBE Yutaka  <gniibe@fsij.org>
552
553         Bug fixes.
554         * src/openpgp.c (gpg_change_keystring): Handle
555         GPG_KEY_FOR_AUTHENTICATION.
556         * src/openpgp-do.c (gpg_do_write_prvkey): Remove multiple call
557         of flash_do_release.
558
559         Bug fix.
560         * src/openpgp-do.c (gpg_do_write_prvkey): Don't hardcode 6, but
561         use strlen.
562
563         * src/flash.c, src/gnuk.ld.in: Rename "Flash DO Pool" to "Flash
564         Data Pool", because it's not only DO.
565         * src/gnuk.h, src/opengpg-do.c: Cleanup.
566
567         Digital Signature Counter implementation improvement.
568         * src/gnuk.h (NR_DO_DS_COUNT): Removed.
569         (NR_COUNTER_DS, NR_COUNTER_DS_LSB): New.
570         * src/openpgp-do.c (do_ds_count_initial_value): Removed.
571         (gpg_do_increment_digital_signature_counter): Removed.
572         (digital_signature_counter): New variable.
573         (do_ds_count, gpg_increment_digital_signature_counter): New functions.
574         (gpg_do_table): Change the entry for GPG_DO_DS_COUNT as DO_PROC_READ.
575         (gpg_do_table_init): Handle digital_signature_counter.
576         * src/flash.c (flash_data_pool_allocate, flash_put_data): New.
577
578         Password status implementation improvement.
579         * src/gnuk.h (PW_STATUS_PW1, PW_STATUS_RC, PW_STATUS_PW3): Removed.
580         (PW_ERR_PW1, PW_ERR_RC, PW_ERR_PW3): New define.
581         (NR_COUNTER_123, NR_BOOL_PW1_LIFETIME): New define.
582         (NR_NONE, NR_EMPTY): New define.
583         * src/flash.c (flash_bool_clear, flash_bool_write)
584         (flash_cnt123_get_value, flash_cnt123_increment)
585         (flash_cnt123_clear): New functions.
586         * src/openpgp-do.c (do_pw_status_bytes_template): Removed.
587         (PW_STATUS_BYTES_TEMPLATE, gpg_do_reset_pw_counter): Removed.
588         (PASSWORD_ERRORS_MAX, PW_LEN_MAX): New define.
589         (pw1_lifetime_p, pw_err_counter_p): New variables.
590         (gpg_get_pw1_lifetime): New function.
591         (gpg_get_pw_err_counter, gpg_passwd_locked, gpg_reset_pw_counter)
592         (gpg_increment_pw_counter): New functions.
593         (rw_pw_status): Use pw1_lifetime_p and pw_err_counter_p.
594         (gpg_do_table_init): Handle NR_COUNTER_123 and NR_BOOL_PW1_LIFETIME.
595         * src/ac.c (verify_pso_cds, verify_pso_other, verify_admin_0):
596         Follow the changes.
597         * src/openpgp.c (cmd_change_password, cmd_reset_user_password)
598         (cmd_pso, cmd_internal_authenticate): Likewise.
599
600 2010-11-04  NIIBE Yutaka  <gniibe@fsij.org>
601
602         * src/flash.c (flash_warning): New.
603         (flash_do_pool): Added header for DO pool.
604         (flash_do_release): Fill zero.
605         (flash_do_write): Change DO format in flash.
606         * src/openpgp-do.c (gpg_do_table_init, copy_do_1)
607         (gpg_do_read_simple): Follow the change of DO format in flash.
608
609         * src/openpgp-do.c (DO_CMP_READ): Renamed.
610         (cmp_ch_data, cmp_app_data, cmp_ss_temp): Likewise.
611         (with_tag): Removed static global variable.
612         (do_hist_bytes, do_fp_all, do_cafp_all, do_kgtime_all)
613         (rw_pw_status, copy_do_1, copy_do, gpg_do_get_data): Added
614         with_tag argument.
615         (gpg_do_put_data): length > 255 will be error.
616
617 2010-11-03  NIIBE Yutaka  <gniibe@fsij.org>
618
619         Bug fixes.
620         * src/ac.c (verify_admin_0): Initialize pwsb earlier.
621         * src/openpgp-do.c (copy_do_1): Access do_data[0] (was: do_data[1]).
622
623 2010-11-02  NIIBE Yutaka  <gniibe@fsij.org>
624
625         DfuSe support.
626         * tool/dfuse.py (DFU_STM32.download): Put '#' for each 4-KiB.
627         Added 0-length write to finish download.
628         Take intel_hex object as argument.
629         (DFU_STM32.ll_upload_block): New method.
630         (DFU_STM32.dfuse_read_memory): New method.
631         (DFU_STM32.verify): New method.
632         (get_device): Support DFU_STM32PROTOCOL_0 too (for CQ STARM).
633
634         * tool/dfuse.py: Renamed from dfu_stmicroelectronics_extention.py.
635
636 2010-11-01  NIIBE Yutaka  <gniibe@fsij.org>
637
638         * tool/intel_hex.py: New file.
639         * tool/dfu_stmicroelectronics_extention.py: New file.
640
641 2010-10-28  NIIBE Yutaka  <gniibe@fsij.org>
642
643         * src/gnuk.h (OPENPGP_CARD_INITIAL_PW3): New.
644         * src/ac.c (verify_admin_0): Use OPENPGP_CARD_INITIAL_PW3.
645
646 2010-10-23  NIIBE Yutaka  <gniibe@fsij.org>
647
648         * Version 0.3.
649
650         * src/usb_desc.c (gnukStringSerial): Updated.
651
652 2010-10-22  NIIBE Yutaka  <gniibe@fsij.org>
653
654         * src/gnuk.ld.in (.gnuk_random): Fix description so that
655         padding with 0xffffffff will be in gnuk.hex.
656
657         * src/openpgp.c (file_selection): Change type (was: int).
658         (FILE_NONE..FILE_EF_SERIAL): Change the values.
659
660         * src/configure: Added STBee Mini support.
661         * boards/STBEE_MINI/mcuconf.h: New.
662         * boards/STBEE_MINI/board.mk: New.
663         * boards/STBEE_MINI/board.h: New.
664         * boards/STBEE_MINI/board.c: New.
665
666         * ChibiOS_2.0.2/os/hal/platforms/STM32/hal_lld.c
667         (pal_default_config): STBee Mini uses STM32F103CBT6 which expose
668         no GPIO E port.
669
670 2010-10-21  NIIBE Yutaka  <gniibe@fsij.org>
671
672         * boards/common/hw_config.c (Get_SerialNum): Removed.
673         * src/usb_prop.c (gnuk_device_init): Remove calling Get_SerialNum.
674         * src/usb_desc.c (gnukStringSerial): Updated.
675         * boards/CQ_STARM/board.c (set_led): Fix polarity.
676
677 2010-10-20  NIIBE Yutaka  <gniibe@fsij.org>
678
679         * FSIJ_SERIAL_NUMBER: New.
680         * src/configure (with_fsij): Added FSIJ serial number support.
681         * src/config.h.in (@FSIJ_DEFINE@, @SERIAL_NUMBER_FOUR_BYTES@): New.
682
683         * src/configure: Added CQ STARM target.
684         * boards/CQ_STARM/mcuconf.h: New.
685         * boards/CQ_STARM/board.mk: New.
686         * boards/CQ_STARM/board.h: New.
687         * boards/CQ_STARM/board.c: New.
688
689 2010-10-19  NIIBE Yutaka  <gniibe@fsij.org>
690
691         * boards/STM32_PRIMER2/board.mk (BOARDSRC): Use common/hw_config.c.
692         * boards/OLIMEX_STM32_H103/board.mk (BOARDSRC): Likewise.
693
694         * boards/common/hw_config.c: Move board specific functions to ...
695         * boards/STM32_PRIMER2/board.c (USB_Cable_Config, set_led): ... here.
696         * boards/OLIMEX_STM32_H103/board.c (USB_Cable_Config, set_led): Ditto.
697
698         * boards/{OLIMEX_STM32_H103,STM32_PRIMER2}/hw_config.c: Removed.
699         * boards/common/hw_config.c: New file (was: boards/*/hw_config.c).
700
701         * .gitignore: New file.
702
703 2010-10-16  NIIBE Yutaka  <gniibe@fsij.org>
704
705         Implement "INTERNAL AUTHENTICATE" command.
706
707         * src/gnuk.h (BY_USER, BY_RESETCODE, BY_ADMIN): New defines.
708         (NUM_ALL_PRV_KEYS): Now it's 3 (was: 2).
709
710         * src/openpgp.c (INS_INTERNAL_AUTHENTICATE): New define.
711         (cmd_internal_authenticate): New function.
712         (cmds): Added INS_INTERNAL_AUTHENTICATE.
713         (cmd_change_password): Use BY_USER.
714         (cmd_reset_user_password): Use BY_USER, BY_RESETCODE, BY_ADMIN.
715         (cmd_pso): Load GPG_KEY_FOR_DECRYPTION here.
716         (cmd_pso): Removed adding status word into res_APDU...
717         * src/call-rsa.c (rsa_sign): and moved adding status word into
718         res_APDU here.
719
720         * src/ac.c (pw1_keystring): New variable.
721         (ac_reset_pso_other): Clear pw1_keystring.
722         (verify_pso_cds): Use BY_USER.
723         (verify_pso_other): Just check the length of password here, and
724         defer real check to cmd_pso or cmd_internal_authenticate.
725
726 2010-10-14  NIIBE Yutaka  <gniibe@fsij.org>
727
728         Adding 'configure' support.
729         * src/configure: New file.
730         * src/Makefile.in: Renamed from src/Makefile.
731         * src/config.h: Renamed from src/config.h.
732         * src/gnuk.ld: Renamed from src/gnuk.ld.
733
734         Adding DFU_SUPPORT.
735         * boards/common/hwinit0.c: New file adding DFU_SUPPORT.
736         * boards/common/hwinit1.c: New file.
737         * boards/OLIMEX_STM32_H103/board.c: Include config.h.
738         Use common/hwinit0.c and common/hwinit1.c.
739         * boards/STM32_PRIMER2/board.c: Likewise.
740
741 2010-09-16  NIIBE Yutaka  <gniibe@fsij.org>
742
743         * src/usb-icc.c (icc_error): New function.
744         (icc_handle_data): Call icc_error.
745         Don't go to STATE_START on errors.
746
747 2010-09-13  NIIBE Yutaka  <gniibe@fsij.org>
748
749         * Version 0.2.
750
751         * src/openpgp.c (cmd_select_file): Override data of number_of_bytes.
752
753         * src/openpgp-do.c (gpg_do_table_init): Calculate number of byte
754         which Data Objects consumes.
755
756 2010-09-12  Kaz Kojima <kkojima@rr.iij4u.or.jp>
757
758         * src/call-rsa.c (rsa_decrypt): Debug output only when DEBUG.
759
760         * boards/STM32_PRIMER2/hw_config.c (USB_Cable_Config): Fix GPIO.
761         (set_led): Ditto.
762
763         * boards/STM32_PRIMER2/board.c (hwinit1): Added LED initialization.
764
765 2010-09-11  NIIBE Yutaka  <gniibe@fsij.org>
766
767         * src/usb-icc.c (ATR): Fixed.
768         (icc_send_params): New function.
769         (icc_handle_data): Handle ICC_SET_PARAMS request.
770
771         * src/random.c (random_bytes_get, random_bytes_free, get_random):
772         Clear used random bytes.
773
774         * src/flash.c (flash_clear_halfword): New function.
775
776 2010-09-10  NIIBE Yutaka  <gniibe@fsij.org>
777
778         * Version 0.1.
779
780         * src/usb_desc.c (gnukStringSerial): Change the value so that
781         libccid doesn't get confused.
782
783         * src/openpgp.c (gpg_change_keystring): Support key for decryption
784         as well.
785         (cmd_read_binary): Use openpgpcard_aid.
786         (cmd_pso): call ac_reset_pso_other.
787
788         * src/openpgp-do.c (openpgpcard_aid): Renamed from aid, and exported.
789         (do_ds_count_initial_value): New const variable.
790         (num_prv_keys): New variable.
791         (gpg_do_write_prvkey): Remove contents of keystring only if
792         ++num_prv_keys == NUM_ALL_PRV_KEYS.
793         (gpg_do_chks_prvkey): Call flash_do_release.
794         (gpg_do_table_init): Initialize with do_ds_count_initial_value.
795         Initialize num_prv_keys.
796         (gpg_do_write_simple): Support removing DO.
797         (gpg_do_increment_digital_signature_counter): Call flash_do_release.
798
799         * src/gnuk.h (NUM_ALL_PRV_KEYS): New definition.
800         (OPENPGP_CARD_INITIAL_PW1): New definition.
801         (enum kind_of_key): Rename.
802
803         * src/ac.c (ac_reset_pso_cds): New function.
804
805 2010-09-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
806
807         * boards/STM32_PRIMER2/{board.c,board.h,board.mk,hw_config.c,mcuconf.h}:
808         New files.
809
810         * boards/OLIMEX_STM32_H103/{mcuconf.h,hw_config.c}: Moved from src.
811
812         * src/main.c (main): Use set_led instead of palClearPad directly.
813
814 2010-09-08  NIIBE Yutaka  <gniibe@fsij.org>
815
816         * src/ac.c (calc_md): Make SHA1 variable auto.
817
818         * src/debug.c (put_int): New.
819
820         * src/gnuk.ld (__process_stack_size__): Removed.
821
822         * src/main.c (STDOUTthread): Use Event.
823         (main): Make LED ON during command execution, blink usually.
824
825         * src/openpgp-do.c (encrypt, decrypt): Make AES variables auto.
826         (gpg_do_table): GPG_DO_ALG_AUT is NULL.
827
828         * src/openpgp.c (cmd_pso): Bug fix for extended Lc.
829
830         * src/usb-icc.c (icc_power_off): Make LED ON during command
831         execution.
832         (USB_ICC_TIMEOUT): Longer value (was: 1000).
833
834         * src/usb_desc.c (gnukConfigDescriptor): Fix bcdCCID value.
835
836         * src/vcomport.mk (VCOMSRC): Use our own usb_endp.c.
837
838         * src/usb_desc.c (gnukConfigDescriptor): ICC Descriptor is
839         Revision 1.0.
840
841         * polarssl-0.14.0/include/polarssl/config.h: Commend out
842         POLARSSL_SELF_TEST.
843
844         * polarssl-0.14.0/library/rsa.c (rsa_private): Don't check input,
845         so that we don't access ctx->N.
846         (rsa_pkcs1_decrypt): size of BUF is enough as 256.
847
848         * polarssl-0.14.0/library/sha1.c (sha1_file): #if-out to avoid
849         stdio of libc.
850
851         * polarssl-0.14.0/library/bignum.c (mpi_write_hlp)
852         (mpi_write_string, mpi_read_file, mpi_read_file): #if-out to avoid
853         stdio of libc.
854
855 2010-09-07  NIIBE Yutaka  <gniibe@fsij.org>
856
857         * gnuk.svg: New file.
858
859 2010-09-06  NIIBE Yutaka  <gniibe@fsij.org>
860
861         * Initial version 0.0.