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