gnuk/ChangeLog
2010-11-26 16:24:36 +09:00

424 lines
14 KiB
Plaintext

2010-11-26 NIIBE Yutaka <gniibe@fsij.org>
* boards/STBEE_MINI/board.h (CPU_WITH_NO_GPIOE): New define.
* ChibiOS_2.0.6/os/hal/platforms/STM32/hal_lld.c: Use it.
* ChibiOS_2.0.6/os/hal/platforms/STM32/pal_lld.c: Likewise.
* ChibiOS_2.0.6/os/hal/platforms/STM32/pal_lld.h: Likewise.
* src/openpgp.c (cmd_pso): DigestInfo by SHA224/SHA384/SHA512 is supported.
2010-11-22 NIIBE Yutaka <gniibe@fsij.org>
Import changes of ChibiOS_2.0.6.
* ChibiOS_2.0.6/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h
* ChibiOS_2.0.6/os/hal/include/can.h
* ChibiOS_2.0.6/os/hal/platforms/AT91SAM7/hal_lld.c
* ChibiOS_2.0.6/os/hal/platforms/AT91SAM7/serial_lld.c
* ChibiOS_2.0.6/os/hal/platforms/LPC214x/serial_lld.c
* ChibiOS_2.0.6/os/hal/platforms/STM32/hal_lld_f103.h
* ChibiOS_2.0.6/os/hal/platforms/STM32/hal_lld_f105_f107.h
* ChibiOS_2.0.6/os/hal/platforms/STM32/pwm_lld.c
* ChibiOS_2.0.6/os/hal/platforms/STM32/serial_lld.h
* ChibiOS_2.0.6/os/hal/platforms/STM32/spi_lld.h
* ChibiOS_2.0.6/os/hal/src/adc.c
* ChibiOS_2.0.6/os/hal/src/spi.c
* ChibiOS_2.0.6/os/kernel/include/ch.h
* ChibiOS_2.0.6/os/kernel/include/chinline.h
* ChibiOS_2.0.6/os/kernel/include/chioch.h
* ChibiOS_2.0.6/os/kernel/include/chstreams.h
* ChibiOS_2.0.6/os/kernel/include/chthreads.h
* ChibiOS_2.0.6/os/kernel/src/chlists.c
* ChibiOS_2.0.6/os/kernel/src/chschd.c
* ChibiOS_2.0.6/os/kernel/src/chthreads.c
* ChibiOS_2.0.6/os/ports/GCC/ARM/rules.mk
* ChibiOS_2.0.6/os/ports/GCC/ARM7/chcore.h
* ChibiOS_2.0.6/os/ports/GCC/ARM7/port.dox
* ChibiOS_2.0.6/os/ports/GCC/ARMCMx/chcore_v6m.c
* ChibiOS_2.0.6/os/ports/GCC/ARMCMx/chcore_v6m.h
* ChibiOS_2.0.6/os/ports/GCC/ARMCMx/chcore_v7m.c
* ChibiOS_2.0.6/os/ports/GCC/ARMCMx/chcore_v7m.h
* ChibiOS_2.0.6/os/ports/GCC/ARMCMx/old/chcore_v7m.h
* ChibiOS_2.0.6/os/ports/GCC/AVR/chcore.h
* ChibiOS_2.0.6/os/ports/GCC/AVR/port.dox
* ChibiOS_2.0.6/os/ports/GCC/MSP430/chcore.c
* ChibiOS_2.0.6/os/ports/GCC/MSP430/chcore.h
* ChibiOS_2.0.6/os/ports/GCC/MSP430/port.dox
* ChibiOS_2.0.6/os/ports/GCC/PPC/chcore.h
* ChibiOS_2.0.6/os/ports/GCC/PPC/port.dox
* ChibiOS_2.0.6/os/ports/RC/STM8/port.dox
* ChibiOS_2.0.6/os/various/memstreams.h
* ChibiOS_2.0.6/readme.txt
* ChibiOS_2.0.6/docs/*/*: Updated
2010-11-14 NIIBE Yutaka <gniibe@fsij.org>
* src/openpgp.c (cmd_pso): DigestInfo by SHA256 is supported.
2010-11-12 NIIBE Yutaka <gniibe@fsij.org>
* src/usb_desc.c (gnukConfigDescriptor): Change dwFeatures.
* src/usb-icc.c (icc_send_params): Always return fixed result.
(icc_handle_data): Support ICC_GET_PARAMS.
2010-11-10 NIIBE Yutaka <gniibe@fsij.org>
* src/usb_desc.c (gnukConfigDescriptor): Fix bmAttributes.
2010-11-09 NIIBE Yutaka <gniibe@fsij.org>
* Version 0.4.
* src/usb_desc.c (gnukStringSerial): Updated.
* ChibiOS_2.0.2/os/hal/platforms/STM32/pal_lld.h (PALConfig):
STBee Mini uses STM32F103CBT6 which expose no GPIO E port.
* ChibiOS_2.0.2/os/hal/platforms/STM32/pal_lld.c (_pal_lld_init):
Likewise.
2010-11-08 NIIBE Yutaka <gniibe@fsij.org>
* tool/dump_mem.py: New tool.
Implement GC for data pool in flash memory.
* src/openpgp-do.c (gpg_write_digital_signature_counter): New.
(gpg_increment_digital_signature_counter): Fix for GC.
(gpg_data_scan): Rename from gpg_do_table_init.
(gpg_data_copy): New function for copying GC.
* src/main.c (main): Call gpg_data_scan with the address which
flash_init returns.
* src/flash.c (flash_erase_page): New function.
(FLASH_DATA_POOL_SIZE): data_pool is 2KiB now.
(flash_data): Put a header (GC generation).
(flash_init): Implement choosing a data pool page.
(flash_data_pool): Removed.
(flash_copying_gc): New function.
(flash_data_pool_allocate): Call flash_copying_gc when full.
(flash_do_write_internal, flash_put_data_internal)
(flash_bool_write_internal, flash_cnt123_write_internal): New
* src/gnuk.ld.in (gnuk_flash): data_pool is 2KiB now.
Bug fixes.
* src/openpgp.c (cmd_change_password, cmd_reset_user_password):
Write to APDU correctly.
* src/flash.c (flash_warning): Make it public.
* src/openpgp-do.c (do_hist_bytes, do_fp_all, do_cafp_all)
(do_kgtime_all, do_ds_count): Fix return value.
(rw_pw_status): Correctly return value.
(proc_resetting_code): Change func proto. to return success/failure.
(proc_key_import): Ditto.
(gpg_do_put_data): Handle return values.
(gpg_do_write_simple): Don't write to APDU.
2010-11-05 NIIBE Yutaka <gniibe@fsij.org>
Bug fixes.
* src/openpgp.c (gpg_change_keystring): Handle
GPG_KEY_FOR_AUTHENTICATION.
* src/openpgp-do.c (gpg_do_write_prvkey): Remove multiple call
of flash_do_release.
Bug fix.
* src/openpgp-do.c (gpg_do_write_prvkey): Don't hardcode 6, but
use strlen.
* src/flash.c, src/gnuk.ld.in: Rename "Flash DO Pool" to "Flash
Data Pool", because it's not only DO.
* src/gnuk.h, src/opengpg-do.c: Cleanup.
Digital Signature Counter implementation improvement.
* src/gnuk.h (NR_DO_DS_COUNT): Removed.
(NR_COUNTER_DS, NR_COUNTER_DS_LSB): New.
* src/openpgp-do.c (do_ds_count_initial_value): Removed.
(gpg_do_increment_digital_signature_counter): Removed.
(digital_signature_counter): New variable.
(do_ds_count, gpg_increment_digital_signature_counter): New functions.
(gpg_do_table): Change the entry for GPG_DO_DS_COUNT as DO_PROC_READ.
(gpg_do_table_init): Handle digital_signature_counter.
* src/flash.c (flash_data_pool_allocate, flash_put_data): New.
Password status implementation improvement.
* src/gnuk.h (PW_STATUS_PW1, PW_STATUS_RC, PW_STATUS_PW3): Removed.
(PW_ERR_PW1, PW_ERR_RC, PW_ERR_PW3): New define.
(NR_COUNTER_123, NR_BOOL_PW1_LIFETIME): New define.
(NR_NONE, NR_EMPTY): New define.
* src/flash.c (flash_bool_clear, flash_bool_write)
(flash_cnt123_get_value, flash_cnt123_increment)
(flash_cnt123_clear): New functions.
* src/openpgp-do.c (do_pw_status_bytes_template): Removed.
(PW_STATUS_BYTES_TEMPLATE, gpg_do_reset_pw_counter): Removed.
(PASSWORD_ERRORS_MAX, PW_LEN_MAX): New define.
(pw1_lifetime_p, pw_err_counter_p): New variables.
(gpg_get_pw1_lifetime): New function.
(gpg_get_pw_err_counter, gpg_passwd_locked, gpg_reset_pw_counter)
(gpg_increment_pw_counter): New functions.
(rw_pw_status): Use pw1_lifetime_p and pw_err_counter_p.
(gpg_do_table_init): Handle NR_COUNTER_123 and NR_BOOL_PW1_LIFETIME.
* src/ac.c (verify_pso_cds, verify_pso_other, verify_admin_0):
Follow the changes.
* src/openpgp.c (cmd_change_password, cmd_reset_user_password)
(cmd_pso, cmd_internal_authenticate): Likewise.
2010-11-04 NIIBE Yutaka <gniibe@fsij.org>
* src/flash.c (flash_warning): New.
(flash_do_pool): Added header for DO pool.
(flash_do_release): Fill zero.
(flash_do_write): Change DO format in flash.
* src/openpgp-do.c (gpg_do_table_init, copy_do_1)
(gpg_do_read_simple): Follow the change of DO format in flash.
* src/openpgp-do.c (DO_CMP_READ): Renamed.
(cmp_ch_data, cmp_app_data, cmp_ss_temp): Likewise.
(with_tag): Removed static global variable.
(do_hist_bytes, do_fp_all, do_cafp_all, do_kgtime_all)
(rw_pw_status, copy_do_1, copy_do, gpg_do_get_data): Added
with_tag argument.
(gpg_do_put_data): length > 255 will be error.
2010-11-03 NIIBE Yutaka <gniibe@fsij.org>
Bug fixes.
* src/ac.c (verify_admin_0): Initialize pwsb earlier.
* src/openpgp-do.c (copy_do_1): Access do_data[0] (was: do_data[1]).
2010-11-02 NIIBE Yutaka <gniibe@fsij.org>
DfuSe support.
* tool/dfuse.py (DFU_STM32.download): Put '#' for each 4-KiB.
Added 0-length write to finish download.
Take intel_hex object as argument.
(DFU_STM32.ll_upload_block): New method.
(DFU_STM32.dfuse_read_memory): New method.
(DFU_STM32.verify): New method.
(get_device): Support DFU_STM32PROTOCOL_0 too (for CQ STARM).
* tool/dfuse.py: Renamed from dfu_stmicroelectronics_extention.py.
2010-11-01 NIIBE Yutaka <gniibe@fsij.org>
* tool/intel_hex.py: New file.
* tool/dfu_stmicroelectronics_extention.py: New file.
2010-10-28 NIIBE Yutaka <gniibe@fsij.org>
* src/gnuk.h (OPENPGP_CARD_INITIAL_PW3): New.
* src/ac.c (verify_admin_0): Use OPENPGP_CARD_INITIAL_PW3.
2010-10-23 NIIBE Yutaka <gniibe@fsij.org>
* Version 0.3.
* src/usb_desc.c (gnukStringSerial): Updated.
2010-10-22 NIIBE Yutaka <gniibe@fsij.org>
* src/gnuk.ld.in (.gnuk_random): Fix description so that
padding with 0xffffffff will be in gnuk.hex.
* src/openpgp.c (file_selection): Change type (was: int).
(FILE_NONE..FILE_EF_SERIAL): Change the values.
* src/configure: Added STBee Mini support.
* boards/STBEE_MINI/mcuconf.h: New.
* boards/STBEE_MINI/board.mk: New.
* boards/STBEE_MINI/board.h: New.
* boards/STBEE_MINI/board.c: New.
* ChibiOS_2.0.2/os/hal/platforms/STM32/hal_lld.c
(pal_default_config): STBee Mini uses STM32F103CBT6 which expose
no GPIO E port.
2010-10-21 NIIBE Yutaka <gniibe@fsij.org>
* boards/common/hw_config.c (Get_SerialNum): Removed.
* src/usb_prop.c (gnuk_device_init): Remove calling Get_SerialNum.
* src/usb_desc.c (gnukStringSerial): Updated.
* boards/CQ_STARM/board.c (set_led): Fix polarity.
2010-10-20 NIIBE Yutaka <gniibe@fsij.org>
* FSIJ_SERIAL_NUMBER: New.
* src/configure (with_fsij): Added FSIJ serial number support.
* src/config.h.in (@FSIJ_DEFINE@, @SERIAL_NUMBER_FOUR_BYTES@): New.
* src/configure: Added CQ STARM target.
* boards/CQ_STARM/mcuconf.h: New.
* boards/CQ_STARM/board.mk: New.
* boards/CQ_STARM/board.h: New.
* boards/CQ_STARM/board.c: New.
2010-10-19 NIIBE Yutaka <gniibe@fsij.org>
* boards/STM32_PRIMER2/board.mk (BOARDSRC): Use common/hw_config.c.
* boards/OLIMEX_STM32_H103/board.mk (BOARDSRC): Likewise.
* boards/common/hw_config.c: Move board specific functions to ...
* boards/STM32_PRIMER2/board.c (USB_Cable_Config, set_led): ... here.
* boards/OLIMEX_STM32_H103/board.c (USB_Cable_Config, set_led): Ditto.
* boards/{OLIMEX_STM32_H103,STM32_PRIMER2}/hw_config.c: Removed.
* boards/common/hw_config.c: New file (was: boards/*/hw_config.c).
* .gitignore: New file.
2010-10-16 NIIBE Yutaka <gniibe@fsij.org>
Implement "INTERNAL AUTHENTICATE" command.
* src/gnuk.h (BY_USER, BY_RESETCODE, BY_ADMIN): New defines.
(NUM_ALL_PRV_KEYS): Now it's 3 (was: 2).
* src/openpgp.c (INS_INTERNAL_AUTHENTICATE): New define.
(cmd_internal_authenticate): New function.
(cmds): Added INS_INTERNAL_AUTHENTICATE.
(cmd_change_password): Use BY_USER.
(cmd_reset_user_password): Use BY_USER, BY_RESETCODE, BY_ADMIN.
(cmd_pso): Load GPG_KEY_FOR_DECRYPTION here.
(cmd_pso): Removed adding status word into res_APDU...
* src/call-rsa.c (rsa_sign): and moved adding status word into
res_APDU here.
* src/ac.c (pw1_keystring): New variable.
(ac_reset_pso_other): Clear pw1_keystring.
(verify_pso_cds): Use BY_USER.
(verify_pso_other): Just check the length of password here, and
defer real check to cmd_pso or cmd_internal_authenticate.
2010-10-14 NIIBE Yutaka <gniibe@fsij.org>
Adding 'configure' support.
* src/configure: New file.
* src/Makefile.in: Renamed from src/Makefile.
* src/config.h: Renamed from src/config.h.
* src/gnuk.ld: Renamed from src/gnuk.ld.
Adding DFU_SUPPORT.
* boards/common/hwinit0.c: New file adding DFU_SUPPORT.
* boards/common/hwinit1.c: New file.
* boards/OLIMEX_STM32_H103/board.c: Include config.h.
Use common/hwinit0.c and common/hwinit1.c.
* boards/STM32_PRIMER2/board.c: Likewise.
2010-09-16 NIIBE Yutaka <gniibe@fsij.org>
* src/usb-icc.c (icc_error): New function.
(icc_handle_data): Call icc_error.
Don't go to STATE_START on errors.
2010-09-13 NIIBE Yutaka <gniibe@fsij.org>
* Version 0.2.
* src/openpgp.c (cmd_select_file): Override data of number_of_bytes.
* src/openpgp-do.c (gpg_do_table_init): Calculate number of byte
which Data Objects consumes.
2010-09-12 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* src/call-rsa.c (rsa_decrypt): Debug output only when DEBUG.
* boards/STM32_PRIMER2/hw_config.c (USB_Cable_Config): Fix GPIO.
(set_led): Ditto.
* boards/STM32_PRIMER2/board.c (hwinit1): Added LED initialization.
2010-09-11 NIIBE Yutaka <gniibe@fsij.org>
* src/usb-icc.c (ATR): Fixed.
(icc_send_params): New function.
(icc_handle_data): Handle ICC_SET_PARAMS request.
* src/random.c (random_bytes_get, random_bytes_free, get_random):
Clear used random bytes.
* src/flash.c (flash_clear_halfword): New function.
2010-09-10 NIIBE Yutaka <gniibe@fsij.org>
* Version 0.1.
* src/usb_desc.c (gnukStringSerial): Change the value so that
libccid doesn't get confused.
* src/openpgp.c (gpg_change_keystring): Support key for decryption
as well.
(cmd_read_binary): Use openpgpcard_aid.
(cmd_pso): call ac_reset_pso_other.
* src/openpgp-do.c (openpgpcard_aid): Renamed from aid, and exported.
(do_ds_count_initial_value): New const variable.
(num_prv_keys): New variable.
(gpg_do_write_prvkey): Remove contents of keystring only if
++num_prv_keys == NUM_ALL_PRV_KEYS.
(gpg_do_chks_prvkey): Call flash_do_release.
(gpg_do_table_init): Initialize with do_ds_count_initial_value.
Initialize num_prv_keys.
(gpg_do_write_simple): Support removing DO.
(gpg_do_increment_digital_signature_counter): Call flash_do_release.
* src/gnuk.h (NUM_ALL_PRV_KEYS): New definition.
(OPENPGP_CARD_INITIAL_PW1): New definition.
(enum kind_of_key): Rename.
* src/ac.c (ac_reset_pso_cds): New function.
2010-09-09 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* boards/STM32_PRIMER2/{board.c,board.h,board.mk,hw_config.c,mcuconf.h}:
New files.
* boards/OLIMEX_STM32_H103/{mcuconf.h,hw_config.c}: Moved from src.
* src/main.c (main): Use set_led instead of palClearPad directly.
2010-09-08 NIIBE Yutaka <gniibe@fsij.org>
* src/ac.c (calc_md): Make SHA1 variable auto.
* src/debug.c (put_int): New.
* src/gnuk.ld (__process_stack_size__): Removed.
* src/main.c (STDOUTthread): Use Event.
(main): Make LED ON during command execution, blink usually.
* src/openpgp-do.c (encrypt, decrypt): Make AES variables auto.
(gpg_do_table): GPG_DO_ALG_AUT is NULL.
* src/openpgp.c (cmd_pso): Bug fix for extended Lc.
* src/usb-icc.c (icc_power_off): Make LED ON during command
execution.
(USB_ICC_TIMEOUT): Longer value (was: 1000).
* src/usb_desc.c (gnukConfigDescriptor): Fix bcdCCID value.
* src/vcomport.mk (VCOMSRC): Use our own usb_endp.c.
* src/usb_desc.c (gnukConfigDescriptor): ICC Descriptor is
Revision 1.0.
* polarssl-0.14.0/include/polarssl/config.h: Commend out
POLARSSL_SELF_TEST.
* polarssl-0.14.0/library/rsa.c (rsa_private): Don't check input,
so that we don't access ctx->N.
(rsa_pkcs1_decrypt): size of BUF is enough as 256.
* polarssl-0.14.0/library/sha1.c (sha1_file): #if-out to avoid
stdio of libc.
* polarssl-0.14.0/library/bignum.c (mpi_write_hlp)
(mpi_write_string, mpi_read_file, mpi_read_file): #if-out to avoid
stdio of libc.
2010-09-07 NIIBE Yutaka <gniibe@fsij.org>
* gnuk.svg: New file.
2010-09-06 NIIBE Yutaka <gniibe@fsij.org>
* Initial version 0.0.