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