-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChangeLog-1_0
2477 lines (1770 loc) · 82.8 KB
/
ChangeLog-1_0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2013-02-15 Niibe Yutaka <[email protected]>
* Version 1.0.2.
* src/usb_desc.c (gnukStringSerial): Updated.
2013-02-14 Niibe Yutaka <[email protected]>
* test/features/002_get_data_static.feature: Value of extended
capabilities changed.
* test/features/402_get_data_static.feature: Ditto.
* test/features/802_get_data_static.feature: Ditto.
* src/openpgp.c (cmd_write_binary): Move erasing page of update
keys to...
(modify_binary): ...here.
* src/flash.c (flash_write_binary): Handle removal of update keys.
2013-02-13 Niibe Yutaka <[email protected]>
* src/openpgp.c (cmd_get_challenge): Handle Le field.
* src/openpgp-do.c (extended_capabilities): Fix for GET CHALLENGE.
* src/gnuk.h (CHALLENGE_LEN): Moved here (was: openpgp.c).
* tool/gnuk_token.py (iso7816_compose): Add Le field.
2013-01-30 Niibe Yutaka <[email protected]>
* src/openpgp.c (cmd_external_authenticate): Fix off-by-one error.
* tool/gnuk_token.py (gnuk_token.cmd_external_authenticate): Add
KEYNO to the arguments.
* tool/upgrade_by_passwd.py (main): Explicitly say it's KEYNO.
2013-01-28 Niibe Yutaka <[email protected]>
* src/openpgp-do.c (gpg_pw_get_retry_counter): New.
* src/openpgp.c (cmd_verify): Implement VERIFY with empty data.
2013-01-22 Niibe Yutaka <[email protected]>
* tool/pinpadtest.py (Card.cmd_vega_alpha_disable_empty_verify):
New.
(main): call cmd_vega_alpha_disable_empty_verify if it's
COVADIS_VEGA_ALPHA.
2013-01-21 Niibe Yutaka <[email protected]>
* tool/pageant_proxy_to_gpg.py: New.
* tool/sexp.py: New.
2013-01-20 Niibe Yutaka <[email protected]>
* tool/gpg_agent.py: New.
2013-01-11 Niibe Yutaka <[email protected]>
* tool/pinpadtest.py: Add fixed length input.
2012-12-25 Niibe Yutaka <[email protected]>
* tool/rsa.py: New.
* tool/rsa_example.key: New. Example RSA key information.
* tool/upgrade_by_passwd.py: New.
2012-12-19 Niibe Yutaka <[email protected]>
* src/Makefile.in (USE_OPT): -O3 and -Os (was: -O2).
* tool/gnuk_token.py (gnuk_token.stop_gnuk, gnuk_token.mem_info)
(gnuk_token.download, gnuk_token.execute)
(gnuk_token.cmd_get_challenge)
(gnuk_token.cmd_external_authenticate): New.
(gnuk_devices_by_vidpid): New.
(regnual): New.
2012-12-18 Niibe Yutaka <[email protected]>
* test/gnuk.py: Remove.
* test/features/steps.py: Use tool/gnuk_token.py.
* tool/gnuk_put_binary_libusb.py: Use gnuk_token.py.
(main): Follow the API change.
* tool/gnuk_token.py (list_to_string): New.
(gnuk_token.get_string, gnuk_token.increment_seq)
(gnuk_token.reset_device, gnuk_token.release_gnuk): New.
(gnuk_token.icc_power_on): Set self.atr and it's now string.
(gnuk_token.icc_send_cmd): Handle time extension.
(gnuk_token.cmd_get_response): Return string (was: list).
(gnuk_token.cmd_get_data): Return "" when success.
(gnuk_token.cmd_change_reference_data, gnuk_token.cmd_put_data)
(gnuk_token.cmd_put_data_odd)
(gnuk_token.cmd_reset_retry_counter, gnuk_token.cmd_pso)
(gnuk_token.cmd_pso_longdata)
(gnuk_token.cmd_internal_authenticate, gnuk_token.cmd_genkey)
(gnuk_token.cmd_get_public_key): New.
(compare): New.
(get_gnuk_device): New.
2012-12-14 Niibe Yutaka <[email protected]>
* src/openpgp.c (cmd_change_password): Check password length
for admin less mode.
2012-12-13 Niibe Yutaka <[email protected]>
* src/openpgp-do.c (gpg_do_put_data): Add GPG_SUCCESS for
completeness (it worked because of lower layer goodness).
2012-12-12 Niibe Yutaka <[email protected]>
* tool/gnuk_token.py: Add module imports.
* tool/gnuk_remove_keys.py (main): Fix data object number
for KGTIME_SIG, KGTIME_DEC and KGTIME_AUT.
* tool/gnuk_remove_keys_libusb.py (main): Likewise.
2012-12-05 Niibe Yutaka <[email protected]>
* tool/gnuk_remove_keys_libusb.py: New.
* tool/gnuk_token.py: New.
2012-11-07 Niibe Yutaka <[email protected]>
* src/usb-icc.c (icc_send_data_block_internal): New.
(icc_send_data_block_time_extension): New.
(icc_handle_timeout): Use icc_send_data_block_time_extension.
(icc_send_data_block): Only one argument.
(USBthread): Follow the change.
2012-11-01 Niibe Yutaka <[email protected]>
* tool/gnuk_upgrade.py (main): New option '-k' to specify keygrip
for non-smartcard key.
(gpg_sign): Support non-smartcard key.
2012-10-31 Niibe Yutaka <[email protected]>
* tool/get_raw_public_key.py: New.
2012-10-26 Niibe Yutaka <[email protected]>
* GNUK_USB_DEVICE_ID (Product_STRING): It's considered better not
to include vendor name. Change the name to "Gnuk Token" (was:
FSIJ USB Token).
2012-10-13 Niibe Yutaka <[email protected]>
* boards/STBEE_MINI/board.c [!DFU_SUPPORT] (hwinit1): Don't run
when "user switch" is pushed. This is for JTAG/SWD debugger.
2012-09-25 Niibe Yutaka <[email protected]>
* tool/stlinkv2.py (main): Print out option bytes value.
Call reset_sys before blank_check.
2012-09-18 Niibe Yutaka <[email protected]>
* tool/stlinkv2.py (stlinkv2.option_bytes_erase)
(stlinkv2.flash_erase_all, stlinkv2.flash_erase_page): : Fix
OperationFailure (was OperationError).
(main): Call option_bytes_erase if it's not 0xff.
2012-09-12 Niibe Yutaka <[email protected]>
* src/sha256.c: Include <stdint.h>.
* src/sha256.h (SHA256_DIGEST_SIZE, SHA256_BLOCK_SIZE): Move
from sha256.c.
2012-08-29 Niibe Yutaka <[email protected]>
* tool/hub_ctrl.py (__main__): Fix to busnum (was: bunum).
Thanks to Henry Hu.
2012-08-03 Niibe Yutaka <[email protected]>
* Version 1.0.1.
* src/usb_desc.c (gnukStringSerial): Updated.
* src/main.c (ID_OFFSET): Fix.
2012-08-02 Niibe Yutaka <[email protected]>
* test/gnuk.py (gnuk_token.get_string): New.
* test/features/991_version_string.feature: New.
2012-07-21 Niibe Yutaka <[email protected]>
* Version 1.0.
* src/usb_desc.c (gnukStringSerial): Updated.
Documentation by Sphinx.
* doc/Makefile: New.
* doc/note: Old notes are moved here.
2012-07-20 Niibe Yutaka <[email protected]>
* test/features/002_get_data_static.feature: Support CERTDO enabled
Gnuk for the test of extended capabilities.
* test/features/802_get_data_static.feature: Ditto.
* test/features/402_get_data_static.feature: Ditto.
2012-07-10 Niibe Yutaka <[email protected]>
* test/features/*: Add test cases for PW1/PW3 of factory settings.
* test/features/202_keygen.feature: Add PSO signature test after
keygen.
* test/features/602_keygen.feature: Ditto.
Bug fix.
* src/openpgp-do.c (gpg_do_write_prvkey): Don't call ac_reset_*
here.
(proc_key_import): But call ac_reset_* here.
(gpg_do_keygen): Load private key for signing.
* tool/stlinkv2.py (stlinkv2.usb_disconnect): New.
2012-07-09 Niibe Yutaka <[email protected]>
* src/openpgp.c (cmd_pso): For decryption, return error sooner for
invalid data.
* tool/stlinkv2.py (stlinkv2.setup_gpio): Fix GPIOB_CRL.
* test/rsa_keys.py (integer_to_bytes_256): Rename from
integer_to_bytes and it should be exactly 256-byte long.
2012-07-06 Niibe Yutaka <[email protected]>
* Version 0.21.
* src/usb_desc.c (gnukStringSerial): Updated.
* boards/FST_01/board.h (VAL_GPIOACRL): Change for SPI flash.
* tool/stlinkv2.py (stlinkv2.setup_gpio): Likewise.
(stlinkv2.spi_flash_init, stlinkv2.spi_flash_select)
(stlinkv2.spi_flash_sendbyte, stlinkv2.spi_flash_read_id): New.
(main): Add SPI flash ROM id check.
2012-07-05 Niibe Yutaka <[email protected]>
* src/call-rsa.c (rsa_sign, rsa_decrypt): Don't need to setup N.
* polarssl-0.14.0/library/rsa.c (rsa_check_pubkey)
(rsa_check_privkey): Ifdef-out.
More tests.
* test/*: Add tests for admin-less mode.
* test/features/990_reset_passphrase.feature: This is now for
admin-less mode.
* test/features/970_key_removal.feature: Ditto.
* src/openpgp.c (cmd_change_password): Call ac_reset_admin when
admin-less mode.
(cmd_reset_user_password): Likewise.
* src/ac.c (ac_reset_admin, ac_fini): Clear ADMIN_AUTHORIZED.
Bug fix.
* src/ac.c (verify_admin): Call s2k with ADMIN_AUTHORIZED.
2012-07-04 Niibe Yutaka <[email protected]>
Bug fixes.
* src/ac.c (verify_admin_0): Compare PW_LEN and BUF_LEN.
* src/openpgp-do.c (gpg_do_chks_prvkey): Set do_ptr to NULL before
calling flash_do_write (which might cause GC).
(gpg_do_put_data, gpg_do_write_simple): Likewise.
* src/openpgp.c (cmd_reset_user_password): Write to
DO_KEYSTRING_PW1.
2012-07-03 Niibe Yutaka <[email protected]>
* test/features/040_passphrase_change.feature: New.
* test/features/203_passphrase_change.feature: New.
* test/features/210_compute_signature.feature: Rename (was:
203_compute_signature.feature)
* test/features/211_decryption.feature: Rename (was:
204_decryption.feature)
2012-07-02 Niibe Yutaka <[email protected]>
* tool/stlinkv2.py (stlinkv2.__init__): Don't call setAltInterface.
2012-06-30 Niibe Yutaka <[email protected]>
* src/openpgp.c (s2k): New.
(resetcode_s2k): Remove.
(cmd_reset_user_password, cmd_change_password): Use s2k (was:
sha256 directly or resetcode_s2k).
* src/openpgp-do.c (proc_resetting_code, gpg_do_write_prvkey):
Likewise.
* src/ac.c (verify_user_0, verify_admin): Likewise.
2012-06-29 Niibe Yutaka <[email protected]>
* regnual/Makefile: Don't copy usb_lld.c.
2012-06-28 Niibe Yutaka <[email protected]>
* test/features/204_decryption.feature: New.
* test/features/203_compute_signature.feature: New.
* test/features/202_keygen.feature: New.
* test/features/201_setup_passphrase.feature: New.
* test/features/200_key_removal.feature: New.
* test/rsa_keys.py (verify_signature): New.
(encrypt_with_pubkey): New.
* test/gnuk.py (gnuk_token): New method: increment_seq.
(gnuk_token.icc_send_cmd): Handle timeout.
(gnuk_token.cmd_genkey): New.
(gnuk_token.cmd_get_public_key): New.
2012-06-27 Niibe Yutaka <[email protected]>
* test/features/101_decryption.feature: New.
* test/features/100_compute_signature.feature: New.
* src/openpgp-do.c (gpg_do_chks_prvkey): Call flash_do_release before
flash_do_write.
(gpg_do_write_prvkey): Bug fix when GC occurs.
* src/openpgp.c (cmd_change_password): Support resetting to
factory setting of PW3.
* src/openpgp-do.c (gpg_do_write_prvkey): Don't reset signagure
counter here.
(proc_key_import): But reset here.
Call ac_reset_* when key is imported.
2012-06-26 Niibe Yutaka <[email protected]>
* test: New.
2012-06-25 Niibe Yutaka <[email protected]>
* tool/usb_strings.py: New.
2012-06-22 Niibe Yutaka <[email protected]>
* tool/stlinkv2.py (stlinkv2.blank_check): Add blank check of
Flash ROM.
2012-06-21 Niibe Yutaka <[email protected]>
* tool/asm-thumb/blank_check.S: New.
2012-06-20 Niibe Yutaka <[email protected]>
ST-Link/V2 flash ROM writer.
* tool/stlinkv2.py: New.
* tool/asm-thumb/opt_bytes_write.S: New.
* tool/asm-thumb/flash_write.S: New.
2012-06-19 Niibe Yutaka <[email protected]>
* Version 0.20.
* src/usb_desc.c (gnukStringSerial): Updated.
2012-06-18 Niibe Yutaka <[email protected]>
LED display output change.
* src/main.c (MAIN_TIMEOUT_INTERVAL): New.
(LED_TIMEOUT_INTERVAL, etc.): New values.
(main_mode, display_interaction): Remove.
(led_inverted, emit_led): New.
(display_status_code): Use emit_led.
(led_blink): Use LED_* for SPEC.
(main, fatal): New LED display output.
* src/gnuk.h (LED_ONESHOT, LED_TWOSHOTS, LED_SHOW_STATUS)
(LED_START_COMMAND, LED_FINISH_COMMAND, LED_FATAL): New semantics.
(main_thread): Remove.
* src/openpgp-do.c (gpg_do_keygen): Don't touch LED here.
* src/openpgp.c (get_pinpad_input): Call led_blink.
(cmd_pso, cmd_internal_authenticate): Don't touch LED here.
(GPGthread): Call led_blink.
* src/pin-cir.c (pinpad_getline): Change arg of led_blink.
* src/pin-dnd.c (pinpad_getline): Ditto.
* src/usb-icc.c (icc_handle_timeout): Ditto.
(icc_send_status): Call led_blink.
* src/usb_ctrl.c (gnuk_usb_event): Don't touch LED here.
2012-06-16 Niibe Yutaka <[email protected]>
Use SHA256 format for "external authenticate".
* tool/gnuk_upgrade.py (gpg_sign): SHA256 sign by "SCD PKAUTH".
(main): Not specify keygrip, but always use key for authentication.
* src/call-rsa.c (rsa_verify): It is SHA256 format (was: SHA1).
* src/openpgp.c (cmd_get_challenge): Don't add chip-id prefix.
(cmd_external_authenticate): Likewise.
2012-06-15 Niibe Yutaka <[email protected]>
* src/random.c (random_bytes_free): Clear out random bytes.
More protection improvements.
* src/random.c (RANDOM_BYTES_LENGTH): It's 32 now (was: 16).
* src/gnuk.h (struct key_data_internal): Remove check, random,
magic. Add checksum.
(struct prvkey_data): Remove crm_encrypted. Add iv and
checksum_encrypted.
* src/openpgp-do.c (encrypt, decrypt): Add IV argument.
(encrypt_dek, decrypt_dek): New. It's in ECB mode.
(compute_key_data_checksum): New.
(gpg_do_load_prvkey): Handle initial vector and checksum.
Use decrypt_dek to decrypt DEK. Clear DEK after use.
(calc_check32):Remove.
(gpg_do_write_prvkey): Use encrypt_dek to encrypt DEK.
(gpg_do_chks_prvkey): Likewise.
* polarssl-0.14.0/include/polarssl/aes.h (aes_crypt_cbc)
* polarssl-0.14.0/library/aes.c (aes_crypt_cbc): ifdef-out.
* src/configure (--enable-pinpad): Deprecate DND.
2012-06-14 Niibe Yutaka <[email protected]>
Protection improvement.
* src/openpgp.c (resetcode_s2k): New.
(cmd_reset_user_password): Use resetcode_s2k.
* src/openpgp-do.c (proc_resetting_code): Likewise.
* src/sha256.c (sha256_finish): Clear out CTX at the end.
* src/call-rsa.c (rsa_sign, rsa_decrypt, rsa_verify): Use
mpi_lset (was: mpi_read_string).
* polarssl-0.14.0/library/bignum.c (mpi_get_digit)
(mpi_read_string): ifdef-out.
KDF is now SHA-256 (was: SHA1).
* src/sha256.c: New file. Based on the implementation by Dr Brian
Gladman.
* src/openpgp.c (cmd_change_password, cmd_reset_user_password):
Use sha256.
* src/openpgp-do.c (proc_resetting_code, gpg_do_write_prvkey): Likewise.
* src/ac.c (verify_user_0, calc_md, verify_admin): Likewise.
* src/crypt.mk (CRYPTSRC): Add sha256.c, removing sha1.c.
* src/gnuk.h (KEYSTRING_MD_SIZE): It's 32 for SHA-256.
2012-06-13 Niibe Yutaka <[email protected]>
Bug fixes.
* src/main.c (display_interaction): Assign to main_mode.
* src/openpgp.c (cmd_change_password): Bug fix for admin less mode
to admin full mode. Variable who_old should be admin_authorized.
Key generation is configure option.
* src/configure (keygen): Add --enable-keygen option.
* src/Makefile.in (UDEFS): Add definition of KEYGEN_SUPPORT.
* src/call-rsa.c [KEYGEN_SUPPORT] (rsa_genkey): Conditionalize.
* src/random.c [KEYGEN_SUPPORT] (random_byte): Ditto.
* src/openpgp.c [KEYGEN_SUPPORT] (cmd_pgp_gakp): Ditto.
* src/openpgp-do.c [KEYGEN_SUPPORT] (gpg_do_keygen): Ditto.
* polarssl-0.14.0/include/polarssl/config.h: Ditto.
* polarssl-0.14.0/library/bignum.c [POLARSSL_GENPRIME]
(mpi_inv_mod): Unconditionalize.
2012-06-08 Niibe Yutaka <[email protected]>
* polarssl-0.14.0/library/bignum.c (mpi_cmp_mpi): Bug fix.
Though it doesn't matter for Gnuk usage.
Emit LED light while computation (or asking user input).
* src/usb-icc.c (icc_handle_timeout): Call led_blink.
* src/openpgp.c (cmd_pso, cmd_internal_authenticate): Call
LED_WAIT_MODE, LED_STATUS_MODE to show "it's under computation".
* src/openpgp-do.c (gpg_do_keygen): Ditto.
* src/gnuk.h (LED_WAIT_MODE): Rename (was: LED_INPUT_MODE).
* src/main.c (display_interaction): Change the behavior of LED,
now, it's mostly ON (was: mostly OFF).
2012-06-07 Niibe Yutaka <[email protected]>
* src/openpgp.c (cmd_internal_authenticate): Add check for input
length.
Implement key generation.
* src/openpgp.c (cmd_pgp_gakp): Call gpg_do_keygen.
* src/openpgp-do.c (proc_key_import): Call with modulus = NULL.
(gpg_do_keygen): New function.
(gpg_reset_digital_signature_counter): New function.
(gpg_do_write_prvkey): New argument MODULUS. Call
gpg_reset_digital_signature_counter.
* src/call-rsa.c (rsa_genkey): New function.
* src/random.c (random_byte): New function.
PolarSSL modification.
* polarssl-0.14.0/library/rsa.c (rsa_gen_key): Don't set D, DP,
DQ, and QP. It's only for key generation.
* polarssl-0.14.0/library/rsa.c (rsa_gen_key, rsa_pkcs1_encrypt):
Change f_rng function return type.
* polarssl-0.14.0/include/polarssl/rsa.h: Likewise.
* polarssl-0.14.0/library/bignum.c (mpi_is_prime, mpi_gen_prime):
Change f_rng function return type.
* polarssl-0.14.0/include/polarssl/bignum.h: Likewise.
2012-06-06 Niibe Yutaka <[email protected]>
* Version 0.19.
* src/usb_desc.c (gnukStringSerial): Updated.
* regnual/regnual.c (fetch): Better implementation.
2012-06-05 Niibe Yutaka <[email protected]>
Firmware update key handling.
* tool/gnuk_put_binary.py (GnukToken.cmd_get_response): Handle
larger data such as card holder certificate.
(GnukToken.cmd_write_binary): Bug fix for cert do write.
(GnukToken.cmd_read_binary): New.
(main): Support firmware update key.
Take advantage of the Thumb-2 "rbit" instruction.
* regnual/regnual.c (fetch): Reverse bits.
* src/usb_ctrl.c (rbit): New. Deleted reverse32.
(download_check_crc32): Use rbit.
* tool/gnuk_upgrade.py (crc32): Just use binascii.crc32.
(crctab): Remove.
2012-06-04 Niibe Yutaka <[email protected]>
Card holder certificate data object bug fixes.
* tool/gnuk_put_binary_libusb.py (gnuk_token.cmd_get_response):
Handle larger data such as card holder certificate.
* src/flash.c (flash_write_binary): Bug fix. Call
flash_check_blank with p + offset.
* src/gnuk.h (FLASH_CH_CERTIFICATE_SIZE): Define here (was: flash.c).
Implement CRC32 check for firmware update.
* src/usb_ctrl.c (download_check_crc32): New.
* regnual/regnual.c (calc_crc32): New.
(regnual_ctrl_write_finish): Call calc_crc32.
* tool/gnuk_upgrade.py (crc32): New.
(regnual.download): Check crc32code.
* regnual/regnual.c (regnual_ctrl_write_finish): Bug fix.
2012-06-01 Niibe Yutaka <[email protected]>
Support firmware update with public key authentication.
* tool/gnuk_upgrade.py (gpg_sign): New.
* tool/gnuk_put_binary_libusb.py (main): Support firmware update
key registration.
Update of reGNUal.
* regnual/regnual.c (main): Follow the change of usb_lld_init.
(regnual_config_desc): Include interface descriptor.
(usb-strings.c.inc): Change the file name.
* regnual/Makefile (regnual.o): Depend on sys.h.
* src/configure (usb-strings.c.inc): ifdef-out
gnuk_revision_detail and gnuk_config_options (for reGNUal).
* src/usb_desc.c (USB_STRINGS_FOR_GNUK): Define.
USB bug fixes.
* src/usb_ctrl.c (gnuk_usb_event): Bug fix for handling
USB_EVENT_CONFIG. Do nothing when current_conf == value.
* src/usb_lld.c (std_clear_feature): Bug fix. Always clear DTOG.
(usb_lld_init): New argument for FEATURE.
2012-05-31 Niibe Yutaka <[email protected]>
* polarssl-0.14.0/library/rsa.c (rsa_pkcs1_verify): BUF size is
256 (was: 1024).
* src/call-rsa.c (rsa_verify): It's SIG_RSA_SHA1.
* src/openpgp.c (cmd_external_authenticate): Follow the change of
rsa_verify.
Support "firmware update" keys.
* src/flash.c (flash_write_binary): Support update keys.
* src/gnuk.h (FILEID_UPDATE_KEY_0, FILEID_UPDATE_KEY_1)
(FILEID_UPDATE_KEY_2,FILEID_UPDATE_KEY_3): New.
* src/gnuk.ld.in (_updatekey_store): New.
* src/openpgp.c (FILE_EF_UPDATE_KEY_0, FILE_EF_UPDATE_KEY_1)
(FILE_EF_UPDATE_KEY_2, FILE_EF_UPDATE_KEY_3): New.
(gpg_get_firmware_update_key): New.
(cmd_read_binary): Support update keys and certificate.
(modify_binary): New.
(cmd_update_binary, cmd_write_binary): Use modify_binary.
(cmd_external_authenticate): Support up to four keys.
Version string of system service is now USB string.
* src/sys.h (unique_device_id): Define here, not as system
service.
* src/sys.c (sys_version): Version string for system service.
* src/usb_desc.c (String_Descriptors): Add sys_version.
* src/usb_conf.h (NUM_STRING_DESC): 7 (was: 6).
* src/gnuk.ld.in (.sys.version): New section.
2012-05-30 Niibe Yutaka <[email protected]>
* src/openpgp.c (CHALLENGE_LEN): New.
(cmd_external_authenticate): Authentication by response with
public key.
(cmd_get_challenge): 16-byte is enough for challenge.
2012-05-29 Niibe Yutaka <[email protected]>
* src/call-rsa.c (rsa_verify): New function.
* polarssl-0.14.0/include/polarssl/rsa.h (rsa_pkcs1_verify)
* polarssl-0.14.0/library/rsa.c (rsa_pkcs1_verify): Fix API.
* src/usb_conf.h (NUM_STRING_DESC): Incremented to 6 (was: 4).
* src/configure: Generate strings for revision detail and config
options.
* src/usb_desc.c (gnuk_revision_detail, gnuk_config_options): New.
* src/main.c (main) [DFU_SUPPORT]: Kill DFU and install .sys.
* src/config.h.in (FLASH_PAGE_SIZE): New.
* src/configure: Support FLASH_PAGE_SIZE for config.h
* boards/*/board.h (FLASH_PAGE_SIZE): Remove.
* src/flash.c (FLASH_PAGE_SIZE): Remove.
* src/sys.c (reset): Don't depend if DFU_SUPPORT or not.
(flash_erase_all_and_exec): Rename and change the argument.
* src/gnuk.ld.in (__flash_start__): Real flash ROM address,
regardless of DFU_SUPPORT.
* src/main.c (main): Call flash_erase_all_and_exec with SRAM
address.
* polarssl-0.14.0/library/aes.c (FT0, FT1, FT2): Specify sections
in detail, so that addresses won't be affected by compiler.
* src/gnuk.ld.in (.sys): Define sections in detail.
* boards/STBEE_MINI/board.h (SET_USB_CONDITION, GPIO_USB)
(IOPORT_USB, SET_LED_CONDITION, GPIO_LED, IOPORT_LED)
(FLASH_PAGE_SIZE): New.
* boards/STBEE_MINI/board.c (USB_Cable_Config, set_led): Remove.
* boards/STBEE/board.h (SET_USB_CONDITION, GPIO_USB, IOPORT_USB)
(SET_LED_CONDITION, GPIO_LED, IOPORT_LED, FLASH_PAGE_SIZE): New.
* boards/STBEE/board.c (USB_Cable_Config, set_led): Remove.
* boards/CQ_STARM/board.h (SET_USB_CONDITION)
(SET_LED_CONDITION, GPIO_LED, IOPORT_LED, FLASH_PAGE_SIZE): New.
* boards/CQ_STARM/board.c (USB_Cable_Config, set_led): Remove.
2012-05-28 Niibe Yutaka <[email protected]>
* boards/*/board.c (hwinit0): Removed...
* boards/common/hwinit.c (hwinit0): ... and define here.
(hwinit0) [DFU_SUPPORT]: Don't set SCB->VTOR here.
* src/sys.c (reset) [DFU_SUPPORT]: Set SCB->VTOR here.
(flash_write): Range check.
* polarssl-0.14.0/library/aes.c (FT0, FT1, FT2): Specify the
section ".sys", so that we will have more room for flash ROM.
* src/gnuk.ld.in (.sys): Add alignment settings.
* tool/gnuk_upgrade.py (main): First 4096-byte of Gnuk is system
block. Don't send it to reGNUal.
* regnual/sys.c (entry): Fix clearing BSS. It is called with all
interrupts disabled.
* regnual/regnual.ld (_flash_start): It's 0x08001000 now, because
there is system block now (was: 0x08000000).
2012-05-26 Niibe Yutaka <[email protected]>
* src/sys.c (reset): Set SCR->VCR here.
2012-05-25 Niibe Yutaka <[email protected]>
* src/gnuk.ld.in (.sys): New section.
* boards/OLIMEX_STM32_H103/board.h (SET_USB_CONDITION, GPIO_USB)
(IOPORT_USB, SET_LED_CONDITION, GPIO_LED, IOPORT_LED)
(FLASH_PAGE_SIZE): New.
* boards/OLIMEX_STM32_H103/board.c (USB_Cable_Config, set_led):
Remove.
* boards/STM32_PRIMER2/board.h (SET_USB_CONDITION, GPIO_USB)
(IOPORT_USB, SET_LED_CONDITION, GPIO_LED, IOPORT_LED)
(FLASH_PAGE_SIZE): New.
* boards/STM32_PRIMER2/board.c (USB_Cable_Config, set_led):
Remove.
* boards/FST_01_00/board.h (SET_USB_CONDITION, GPIO_USB)
(IOPORT_USB, SET_LED_CONDITION, GPIO_LED, IOPORT_LED)
(FLASH_PAGE_SIZE): New.
* boards/FST_01_00/board.c (USB_Cable_Config, set_led): Remove.
* boards/FST_01/board.h (SET_USB_CONDITION, GPIO_USB, IOPORT_USB)
(SET_LED_CONDITION, GPIO_LED, IOPORT_LED, FLASH_PAGE_SIZE): New.
* boards/FST_01/board.c (USB_Cable_Config, set_led): Remove.
* regnual/sys-stm8s-discovery.h, sys-stbee.h: Remove.
* boards/STM8S_DISCOVERY/board.h (SET_USB_CONDITION)
(SET_LED_CONDITION, GPIO_LED, IOPORT_LED, FLASH_PAGE_SIZE): New.
* boards/STM8S_DISCOVERY/board.c (USB_Cable_Config, set_led):
Remove.
* regnual/Makefile: Add -I ../src to CFLAGS.
* regnual/regnual.ld (vector): New.
* regnual/sys.c: Remove implementation, but jump to vector by sys.h.
* src/Makefile.in: Follow change of files.
* src/configure: Undo changes of 2012-05-22.
* boards/common/hw_config.c: Remove. Mov function to sys.c.
* src/flash.c: Move functions to sys.c.
* src/sys.c: New.
* src/main.c (main): Call flash_mass_erase_and_exec.
* src/usb_lld.c: Include sys.h.
* src/usb_lld_sys.c: Remove. Move interrupt handler to...
* src/usb_ctrl.c: ... this file.
* regnual/sys.c (clock_init, gpio_init, flash_unlock): Removed.
(entry): Rename (was: reset).
2012-05-24 Niibe Yutaka <[email protected]>
* src/main.c (good_bye): Care LSB of function pointer.
(flash_mass_erase_and_exec): Implemented in C.
2012-05-23 Niibe Yutaka <[email protected]>
* regnual/sys-stm8s-discovery.h: New.
* src/main.c (flash_mass_erase_and_exec, good_bye): New.
(main): Call good_bye.
* tool/gnuk_upgrade.py (regnual.protect): New.
(main): Call regnual.protect().
* regnual/regnual.c (regnual_setup): Don't call flash_write here.
(regnual_ctrl_write_finish): But call here.
(USB_REGNUAL_RESULT): New.
* regnual/sys.c (flash_protect): New.
2012-05-22 Niibe Yutaka <[email protected]>
* src/configure (../regnual/sys.h): Create symblic link.
* src/usb_ctrl.c: Rename (was: usb_prop.c).
* regnual/types.h, regnual/sys.c, regnual/regnual.ld: New.
* regnual/regnual.c, regnual/Makefile: New.
* regnual/sys-stbee.h: New.
* src/usb_lld.c: Support FREE_STANDING environment as well as
under ChibiOS/RT.
(usb_lld_init): Call usb_lld_sys_init. Don't call user defined
method. Call usb_lld_set_configuration.
(usb_lld_shutdown): Call usb_lld_sys_shutdown.
(Vector90): Move to usb_lld_sys.c.
(usb_interrupt_handler): Export to global.
* src/usb_lld_sys.c: New.
* src/usb_prop.c (Device_Method): Remove gnuk_device_init.
(gnuk_device_init): Remove.
2012-05-19 Niibe Yutaka <[email protected]>
* src/usb_lld.c (handle_datastage_in): Bug fix, erable RX when
sending ZLP. It will be possible to get OUT transaction soon
after IN transaction.
2012-05-18 Niibe Yutaka <[email protected]>
* src/usb_lld.c (handle_datastage_out): Fix rx copying.
(handle_setup0): Bug fix not stalling TX, it will be possible
to go IN transaction, soon after OUT transaction.
* src/usb_lld.h (USB_SETUP_SET, USB_SETUP_GET): New.
(usb_device_method.ctrl_write_finish): New.
(usb_device_method.setup): Merge setup_with_data, and
setup_with_nodata.
* src/usb_lld.c (usb_lld_shutdown, usb_lld_prepare_shutdown): New.
(handle_setup0): Call ->setup.
(handle_in0): Call ->ctrl_write_finish.
* src/usb_prop.c (vcom_port_data_setup): Merge
vcom_port_setup_with_nodata.
(download_check_crc32): New.
(gnuk_setup): Merge gnuk_setup_with_data and
gnuk_setup_with_nodata.
(gnuk_ctrl_write_finish): New.
2012-05-17 Niibe Yutaka <[email protected]>
* tool/gnuk_upgrade.py: New tool.
* src/gnuk.h (ICC_STATE_EXITED, ICC_STATE_EXEC_REQUESTED): New.
* src/openpgp.c (INS_EXTERNAL_AUTHENTICATE)
(cmd_external_authenticate): New.
(INS_GET_CHALLENGE, cmd_get_challenge): New.
* src/usb-icc.c (USBthread): Finish the thread with
ICC_STATE_EXITED, after EXTERNAL_AUTHENTICATE.
* src/usb_prop.c (gnuk_setup_endpoints_for_interface): Add STOP
argument.
(gnuk_usb_event): Disable all endpoints when configure(0).
(vcom_port_data_setup): Check direction and support
USB_CDC_REQ_SET_LINE_CODING.
(vcom_port_setup_with_nodata): Check direction.
(gnuk_setup_with_data): Check direction and add FSIJ_GNUK device
requests.
(gnuk_setup_with_nodata): Likewise.
* src/usb_lld.c (LAST_OUT_DATA): Remove.
(handle_datastage_out): Cleanup and call st103_ep_set_rxtx_status.
(handle_datastage_in): Call st103_ep_set_rxtx_status and
st103_ep_set_tx_status.
(handle_setup0): Likewise.
(handle_out0): Remove LAST_OUT_DATA.
(std_none, std_get_status, std_clear_feature, std_set_feature)
(std_set_address, std_get_descriptor, std_get_configuration)
(std_set_configuration, std_get_interface, std_set_interface):
Check direction.
(handle_setup0): Add length for setup_with_data.
2012-05-16 Niibe Yutaka <[email protected]>
* tool/gnuk_put_binary.py (main): Fix fileid.
* tool/gnuk_put_binary_libusb.py: Ditto.
* src/openpgp.c (FILE_EF_RANDOM): Remove.
(cmd_update_binary, cmds): ifdef CERTDO_SUPPORT.
(cmd_write_binary): Fix fileid.
* src/flash.c (flash_check_blank): Always enable.
(flash_erase_binary): ifdef CERTDO_SUPPORT.
(flash_write_binary): Call flash_check_blank.
2012-05-15 Niibe Yutaka <[email protected]>
* Version 0.18.
* src/usb_desc.c (gnukStringSerial): Updated.
* src/main.c (EP3_IN_Callback, EP5_OUT_Callback): Move from
usb_endp.c.
* src/usb_endp.c: Remove.
2012-05-14 Niibe Yutaka <[email protected]>
* tool/gnuk_remove_keys.py: New.
* src/openpgp-do.c (proc_key_import): Fix checking extended header.
* src/hardclock.c: Remove.
* src/usb_prop.c (MSC_INTERFACE_NO): New.
(gnuk_setup_endpoints_for_interface): Cleanup with MSC_INTERFACE_NO.
(gnuk_setup_with_data, gnuk_setup_with_nodata): Likewise.
* src/usb-msc.c: Rename from usb_msc.c.
* src/usb-msc.h: Rename from usb_msc.h.
* src/Makefile.in: Follow the rename of usb-msc.c and remove of
hardclock.c.
* src/pin-dnd.c, src/usb_prop.c: Follow the rename of usb-msc.h.
2012-05-12 Niibe Yutaka <[email protected]>
* src/usb_msc.c (ep6_out): Rename (was: ep7_out).
(usb_start_receive): Use ep6_out and ENDP6.
(EP6_OUT_Callback): Rename (was: EP7_OUT_Callback).
Use ep6_out and ENDP6.
(msc_handle_command): Use ep6_out and ENDP6.
* src/main.c (main): Wait USB reset.
* src/usb-icc.c (EP1_OUT_Callback): Rename from EP2_OUT_Callback.
(USBthread): Use ENDP1 for both of epi_init and epo_init.
* src/usb_conf.h (ENDP1_RXADDR, ENDP2_TXADDR, ENDP6_RXADDR): New.
(ENDP3_TXADDR, ENDP4_TXADDR, ENDP5_RXADDR): New value.
(ENDP7_RXADDR): Remove.
* src/usb_desc.c (gnukConfigDescriptor): Use endpoint OUT1 (was
IN2), endpoint OUT6 (IN7).
* src/usb_prop.c (gnuk_setup_endpoints_for_interface): Use ENDP1
and ENDP6 for both directions.
2012-05-11 Niibe Yutaka <[email protected]>
* src/configure (--vidpid): New mandatory option.
* GNUK_USB_DEVICE_ID: New file.
* src/usb_desc.c (gnukDeviceDescriptor): Include
usb-vid-pid-ver.c.inc.
(gnukStringVendor, gnukStringProduct): Remove. It's in the
file, usb-string-vender-product.c.inc.
* src/Makefile.in (distclean): Delete *.inc.
* src/usb_prop.c (vcom_port_setup_with_nodata) Rename.
(vcom_port_data_setup): Rename and fix return value.
* src/usb-cdc.h (VIRTUAL_COM_PORT_DATA_SIZE)
(VIRTUAL_COM_PORT_INT_SIZE): New.
* src/main.c (#include): Add usb-cdc.h.
* src/usb_desc.c (#include): Add usb-cdc.h.
* src/usb_endp.c (#include): Add usb_lld.h.
* src/configure ($help): Add FST_01.
2012-05-10 Niibe Yutaka <[email protected]>
* STM32_USB-FS-Device_Driver, Virtual_COM_Port: Remove.
* src/usb_lld.c (#include): Don't include usb_lib.h.
(RECIPIENT, REG_BASE PMA_ADDR, CNTR, ISTR, FNR, DADDR, BTABLE)
(ISTR_CTR, ISTR_DOVR, ISTR_ERR, ISTR_WKUP, ISTR_SUSP, ISTR_RESET)
(ISTR_SOF, ISTR_ESOF, ISTR_DIR, ISTR_EP_ID, CLR_CTR, CLR_DOVR)
(CLR_ERR, CLR_WKUP, CLR_SUSP, CLR_RESET, CLR_SOF, CLR_ESOF)
(CNTR_CTRM, CNTR_DOVRM, CNTR_ERRM, CNTR_WKUPM, CNTR_SUSPM)
(CNTR_RESETM, CNTR_SOFM, CNTR_ESOFM, CNTR_RESUME, CNTR_FSUSP)
(CNTR_LPMODE, CNTR_PDWN, CNTR_FRES, DADDR_EF, DADDR_ADD)
(EP_CTR_RX, EP_DTOG_RX, EPRX_STAT, EP_SETUP, EP_T_FIELD, EP_KIND)
(EP_CTR_TX, EP_DTOG_TX, EPTX_STAT, EPADDR_FIELD, EPREG_MASK)
(EP_TX_DIS, EP_TX_STALL, EP_TX_NAK, EP_TX_VALID, EPTX_DTOG1)
(EPTX_DTOG2, EP_RX_DIS, EP_RX_STALL, EP_RX_NAK, EP_RX_VALID)
(EPRX_DTOG1, EPRX_DTOG2): New. Compatible to ST's USB-FS-Device_Lib.
(CH_IRQ_HANDLER): Call usb_interrupt_handler (was: USB_Istr).
(EP1_IN_Callback, EP2_IN_Callback, EP3_IN_Callback)
(EP4_IN_Callback, EP5_IN_Callback, EP6_IN_Callback)
(EP7_IN_Callback, EP1_OUT_Callback, EP2_OUT_Callback)
(EP3_OUT_Callback, EP4_OUT_Callback, EP5_OUT_Callback)
(EP6_OUT_Callback, EP7_OUT_Callback): New. Implement here.
Compatible to ST's USB-FS-Device_Lib.
(USB_MAX_PACKET_SIZE): New.
(GET_STATUS, CLEAR_FEATURE, RESERVED1, SET_FEATURE, RESERVED2)
(SET_ADDRESS, GET_DESCRIPTOR, SET_DESCRIPTOR, GET_CONFIGURATION)
(SET_CONFIGURATION, GET_INTERFACE, SET_INTERFACE)
(SYNCH_FRAME,TOTAL_REQUEST): New for USB control transfer.
(enum CONTROL_STATE): New for state machine of control pipe.
(enum FEATURE_SELECTOR): New.
(struct DATA_INFO, struct CONTROL_INFO, struct DEVICE_INFO): New.
(ctrl_p, dev_p, data_p, Control_Info, Device_Info, Data_Info):
New.
(usb_lld_stall_tx, usb_lld_stall_rx)
(usb_lld_tx_data_len, usb_lld_txcpy, usb_lld_tx_enable)
(usb_lld_write, usb_lld_rx_enable, usb_lld_rx_data_len)
(usb_lld_rxcpy): Move from usb_lld.h and not inline.
(usb_lld_reset, usb_lld_setup_endpoint)
(usb_lld_set_configuration, usb_lld_current_configuration)
(usb_lld_set_feature, usb_lld_set_data_to_send): New.
(usb_lld_to_pmabuf, usb_lld_from_pmabuf): Clean up.
(usb_lld_init): New implementation.
(st103_set_btable, st103_get_istr, st103_set_istr, st103_set_cntr)
(st103_set_daddr, st103_set_epreg, st103_get_epreg)
(st103_set_tx_addr, st103_get_tx_addr, st103_set_tx_count)
(st103_get_tx_count, st103_set_rx_addr, st103_get_rx_addr)
(st103_set_rx_buf_size, st103_get_rx_count, st103_ep_clear_ctr_rx)
(st103_ep_clear_ctr_tx, st103_ep_set_rxtx_status)
(st103_ep_set_rx_status, st103_ep_get_rx_status)
(st103_ep_set_tx_status, st103_ep_get_tx_status)
(st103_ep_clear_dtog_rx, st103_ep_clear_dtog_tx): New lower-level
functions for USB related registers access.
(usb_interrupt_handler, usb_handle_transfer)
(handle_datastage_out, handle_datastage_in, handle_setup0)
(handle_in0, handle_out0)
(std_none, std_get_status, std_clear_feature, std_set_feature,
std_set_address, std_get_descriptor, std_get_configuration,
std_set_configuration, std_get_interface, std_set_interface)
(std_request_handler): New USB stack implementation.
* src/usb_lld.h (usb_lld_stall_tx, usb_lld_stall_rx)
(usb_lld_tx_data_len, usb_lld_txcpy, usb_lld_tx_enable)
(usb_lld_write, usb_lld_rx_enable, usb_lld_rx_data_len)
(usb_lld_rxcpy): Those are not inline functions anymore.
(USB_DEVICE_DESCRIPTOR_TYPE, USB_CONFIGURATION_DESCRIPTOR_TYPE)
(USB_STRING_DESCRIPTOR_TYPE, USB_INTERFACE_DESCRIPTOR_TYPE)
(USB_ENDPOINT_DESCRIPTOR_TYPE, STANDARD_ENDPOINT_DESC_SIZE)