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