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