1 2009-07-21 Werner Koch <wk@g10code.com>
3 * ccid-driver.c [HAVE_PTH]: Include pth.h.
5 (bulk_in): s/gnupg_sleep/my_sleep/.
7 2009-07-20 Werner Koch <wk@g10code.com>
9 * apdu.c [GNUPG_MAJOR_VERSION==1]: Include dynload.h.
11 2009-07-16 Werner Koch <wk@g10code.com>
13 * command.c (update_reader_status_file): Test for unplugged reader.
14 (TEST_CARD_REMOVAL): Ditto.
15 * app.c (select_application): Ditto.
16 * ccid-driver.c (bulk_out): Return CCID_DRIVER_ERR_NO_READER if a
18 (struct ccid_driver_s): Turn nonnull_nad into an unsigned char.
19 Turn apdu_level, auto_ifsd, powered_off, has_pinpad into
20 bitfields. Add enodev_seen.
21 * apdu.c (apdu_prepare_exit): New.
22 (get_status_ccid): Return the status word and nut just -1.
23 * scdaemon.c (scd_exit): Call it.
25 2009-07-13 Werner Koch <wk@g10code.com>
27 * ccid-driver.c (struct ccid_driver_s): Add fields last_progress,
28 progress_cb and progress_cb_arg.
29 (ccid_set_progress_cb): New.
30 (print_progress): New.
31 (ccid_transceive): Call print_progress for wait time extensions.
32 * apdu.c (struct reader_table_s): Add field set_progress_cb.
33 (new_reader_slot): Clear that field.
34 (open_ccid_reader): Set it to ..
35 (set_progress_cb_ccid_reader): ... new fucntion.
36 * app.c (print_progress_line): New.
37 (lock_reader): Add arg CTRL to set a progress callback and
38 change all callers to provide it.
39 (unlock_reader): Remove the progress callback.
41 2009-07-10 Werner Koch <wk@g10code.com>
43 * iso7816.c (iso7816_compute_ds): Add args EXTENDED_MODE and LE.
44 Change all callers to use 0.
45 (iso7816_internal_authenticate): Add args EXTENDED_MODE and LE.
46 * app-openpgp.c (do_sign): Take exmode and Le from card
47 capabilities and pass them to iso7816_compute_ds.
48 (do_auth): Ditto for iso7816_internal_authenticate.
49 (change_keyattr): Reset CHV verification status.
51 2009-07-09 Werner Koch <wk@g10code.com>
53 * app-openpgp.c (change_keyattr): New.
54 (do_writekey): Call it.
56 * app-openpgp.c (does_key_exist): Add arg GENERATING. Change
59 2009-06-30 Werner Koch <wk@g10code.com>
61 * ccid-driver.c (ccid_transceive): Set RESYNCING flag.
63 2009-06-29 Werner Koch <wk@g10code.com>
65 * ccid-driver.c (ccid_transceive): Add a hack to support extended
66 length for Omnikey readers.
68 (parse_ccid_descriptor): Track short+extended apdu exchange level.
70 2009-06-18 Werner Koch <wk@g10code.com>
72 * app-openpgp.c (verify_chv2): Remove special case for v2 cards.
73 (get_public_key): Use extended mode.
75 2009-06-17 Werner Koch <wk@g10code.com>
77 * iso7816.c (iso7816_get_data): Add arg EXTENDED_MODE. Change all
79 * app-openpgp.c (data_objects): Use bit flags. Add flag
81 (get_cached_data): Add arg TRY_EXTLEN and use it for iso7816_get_data.
82 (get_one_do): Use extended length APDU if necessary.
84 2009-06-10 Werner Koch <wk@g10code.com>
86 * app-openpgp.c (store_fpr): Change first arg to app_t; adjust
87 callers. Flush the cache.
89 2009-06-09 Werner Koch <wk@g10code.com>
91 * app-openpgp.c (do_readcert): Return NOT_FOUND if the retrieved
92 data has a length of zero.
93 (do_getattr): Add EXTCAP subkey "sm".
95 2009-05-20 Werner Koch <wk@g10code.com>
97 * app-openpgp.c (verify_chv2): Add case for v2 cards.
98 (verify_chv3): Factor some code out to ..
99 (build_enter_admin_pin_prompt): .. new.
100 (do_change_pin): Properly handle v2 cards.
102 2009-05-19 Werner Koch <wk@g10code.com>
104 * scdaemon.c (create_server_socket): Use SUN_LEN.
105 (JNLIB_NEED_AFLOCAL): Define.
107 2009-05-13 Werner Koch <wk@g10code.com>
109 * ccid-driver.c (abort_cmd): Add arg SEQNO and change callers.
110 (bulk_in): Retry on seqno mismatch.
112 * apdu.c (send_le): Release result_buffer.
113 (apdu_send_direct): Implemend extended length.
114 * command.c (cmd_apdu): Add option "--exlen".
116 2009-05-11 Werner Koch <wk@g10code.com>
118 * apdu.c (send_le): Replace log_error by log_info.
120 2009-05-08 Werner Koch <wk@g10code.com>
122 * app-openpgp.c (do_genkey): Allow larger key sizes.
123 (do_decipher): Ditto.
124 * iso7816.c (do_generate_keypair): Add arg EXTENDED_MODE an LE.
125 (iso7816_generate_keypair, iso7816_read_public_key): Ditto.
127 * apdu.c (send_le): Implement extended length return values.
129 * ccid-driver.c (bulk_in): Retry on EAGAIN.
130 (abort_cmd): Change seqno handling.
132 2009-04-28 Werner Koch <wk@g10code.com>
134 * app-help.c (app_help_count_bits): New.
136 * app-nks.c (switch_application): Detect mass signature cards.
137 Take care of new NEED_APP_SELECT flag.
138 (do_sign): Don't allow mass signature cards.
141 (app_select_nks): Register do_readkey.
143 2009-04-01 Werner Koch <wk@g10code.com>
145 * app-openpgp.c (do_setattr, do_writekey): Prepare for extended
148 2009-03-31 Werner Koch <wk@g10code.com>
150 * command.c (percent_plus_unescape): Remove.
151 (cmd_setattr): Use percent_plus_unescape_inplace.
153 2009-03-30 Werner Koch <wk@g10code.com>
155 * app-nks.c (do_decipher): Make it work for TCOS 3.
156 * iso7816.c (iso7816_decipher): Add arg EXTENDED_MODE.
157 * apdu.c (apdu_send): Add arg EXTENDED_MODE and change all callers.
158 (apdu_send_le): Ditto.
159 (apdu_send_direct): Ditto, but not yet functional.
160 (send_le): Fix command chaining. Implement extended length option.
161 * ccid-driver.c (ccid_transceive): Remove restriction on apdu length.
162 (struct ccid_driver_s): Add field IFSC.
163 (ccid_get_atr): Set IFSC.
164 (ccid_transceive): Use negotiated IFSC and support S(IFS) command.
166 2009-03-26 Werner Koch <wk@g10code.com>
168 * command.c (cmd_pksign): Allow more hash algorithms.
170 * scdaemon.h (MAX_DIGEST_LEN): Change to 64.
172 * apdu.c (open_ccid_reader): Clear the is_to flag.
174 * app-nks.c (filelist): Add field KID.
175 (do_getattr): Change standard authentication key.
176 (do_sign): Setup a security environment for TCOS 3 cards and support
177 all SHA-2 algorithms.
179 2009-03-24 Werner Koch <wk@g10code.com>
181 * command.c (struct server_local_s): Add flag
182 APP_CTX_MARKED_FOR_RELEASE.
183 (do_reset): Set the flag.
184 (open_card): Act on this flag.
185 * app-common.h (struct app_ctx_s): Add flag NO_REUSE.
186 (application_notify_card_reset): Set the flag.
187 * app.c (select_application, release_application): Take care of
190 2009-03-20 Werner Koch <wk@g10code.com>
192 * app-nks.c (keygripstr_from_pk_file): Fix for TCOS 3 cards.
194 2009-03-18 Werner Koch <wk@g10code.com>
196 * apdu.c (open_pcsc_reader_wrapped): Use close_all_fds.
198 * command.c (cmd_learn): Add option --keypairinfo.
199 * app.c (app_write_learn_status): Add arg FLAGS.
200 * app-common.h (struct app_ctx_s): Add arg FLAGS to LEARN_STATUS.
201 Change all implementors.
202 * app-p15.c (do_learn_status): Take care of flag bit 0.
203 * app-nks.c (do_learn_status, do_learn_status_core): Ditto.
205 2009-03-10 Werner Koch <wk@g10code.com>
207 * app-openpgp.c (send_key_attr): New.
208 (do_getattr): New attribute KEY_ATTR.
209 * command.c (send_status_direct): New.
211 2009-03-06 Werner Koch <wk@g10code.com>
213 * app-nks.c (do_learn_status): Factor code out to..
214 (do_learn_status_core): .. new.
215 (do_readcert, do_sign, do_decipher): Switch to SigG if needed.
216 (verify_pin): Use DESC also for keypad based verify.
218 2009-03-05 Werner Koch <wk@g10code.com>
220 * app-openpgp.c (verify_a_chv): Remove special case for keypads.
221 (verify_chv3): Ditto.
223 * app-nks.c (get_chv_status): New.
224 (parse_pwidstr): New.
225 (verify_pin): Add args PWID and DESC and use them. Remove the
227 (do_change_pin): Allow PIN selection and add reset mode.
228 (do_learn_status): Use NKS-NKS3 tag for TCOS 3 cards.
229 (do_readcert, do_sign): Allow NKS-NKS3 tag.
231 2009-03-04 Werner Koch <wk@g10code.com>
233 * app-nks.c (do_getattr): New.
234 (app_select_nks): Register it.
235 (verify_pin): Factor some code out to...
236 (basic_pin_checks): New.
237 (do_change_pin): Call the basic check.
238 (app_select_nks): Move AID to ..
241 (switch_application): New.
242 (do_getattr, do_learn_status, do_readcert, do_sign, do_decipher)
243 (do_change_pin, do_check_pin): Make sure we are in NKS mode.
245 2009-03-03 Werner Koch <wk@g10code.com>
247 * command.c (scd_command_handler): Remove dereference of STOPME
250 2009-02-27 Werner Koch <wk@g10code.com>
252 * app.c (get_supported_applications): New.
253 * command.c (cmd_getinfo): New subcommand "app_list"
255 (register_commands): Register command KILLSCD.
256 (struct server_local_s): Add field STOPME.
257 (scd_command_handler): Act upon this.
259 2009-02-25 Werner Koch <wk@g10code.com>
261 * apdu.c (apdu_get_status): Factor all code out to ...
262 (apdu_private_get_status): .. new. Add arg NO_ATR_RESET.
263 (apdu_connect): Call new function.
265 * scdaemon.c: New option --debug-log-tid.
266 (tid_log_callback): New.
267 (main): Move debug-wait code after debug stream init.
269 2009-02-24 Werner Koch <wk@g10code.com>
271 * ccid-driver.c (ccid_get_atr): Move debug output to ..
272 (print_r2p_parameters): .. new.
273 (print_r2p_header, print_pr_data, print_r2p_unknown)
274 (print_r2p_datablock, print_r2p_slotstatus, print_r2p_escape)
275 (print_r2p_datarate): New.
276 (bulk_in): Call parameter printing.
277 (ccid_set_debug_level): Add debug level 3.
278 (convert_le_u16): New.
279 (print_p2r_header, print_p2r_iccpoweron, print_p2r_iccpoweroff)
280 (print_p2r_getslotstatus, print_p2r_xfrblock)
281 (print_p2r_getparameters, print_p2r_resetparameters)
282 (print_p2r_setparameters, print_p2r_escape, print_p2r_iccclock)
283 (print_p2r_to0apdu, print_p2r_secure, print_p2r_mechanical)
284 (print_p2r_abort, print_p2r_setdatarate, print_r2p_unknown): New.
285 (bulk_out): Add arg NO_DEBUG and change all callers to pass 0.
286 Call parameter printing.
287 (ccid_slot_status): Call with NO_DEBUG set.
288 (abort_cmd, send_escape_cmd, ccid_get_atr, ccid_get_atr)
289 (ccid_transceive_apdu_level, ccid_transceive)
290 (ccid_transceive_secure): Remove old debug print code.
292 2009-02-12 Werner Koch <wk@g10code.com>
294 * command.c (cmd_getinfo): Add new subcommand "deny_admin".
296 2009-01-28 Werner Koch <wk@g10code.com>
298 * scdaemon.c (main): Make --allow-admin the default and make the
301 2009-01-27 Werner Koch <wk@g10code.com>
303 * app-geldkarte.c: Changed to use an AID.
305 * app.c (app_munge_serialno): Add case for no serialno.
306 (app_get_serial_and_stamp): Ditto.
308 2009-01-26 Werner Koch <wk@g10code.com>
310 * app-geldkarte.c: New.
311 * Makefile.am (card_apps): Add new file.
312 * app.c (select_application): Test for geldkarte.
314 2009-01-12 Werner Koch <wk@g10code.com>
316 * command.c (send_client_notifications) [HAVE_W32_SYSTEM]: Fix
319 2009-01-08 Werner Koch <wk@g10code.com>
321 * iso7816.c (iso7816_read_record, iso7816_read_binary): Pass 0 for
322 L_e because the problem with the CCID driver has gone.
323 (iso7816_apdu_direct): New.
325 * app-nks.c (filelist): Add NKS_VER field. Add NKS 3 specific
327 (app_local_s, do_deinit): New.
328 (get_nks_version): New.
329 (app_select_nks): Setup local data.
330 (keygripstr_from_pk_file): Replace SLOT by APP and take care of
332 (do_learn_status): Take care of NKS version.
334 2009-01-05 Werner Koch <wk@g10code.com>
336 * apdu.c (apdu_get_status): Save the last status.
338 2008-12-18 Werner Koch <wk@g10code.com>
340 * ccid-driver.c (abort_cmd): New.
341 (bulk_in): Call abort_cmd after severe errors.
343 * apdu.c (reader_table_s): Add field ANY_STATUS.
344 (new_reader_slot): Clear it.
345 (apdu_get_status): Use ANY_STATUS to update the change counter.
346 Remove the use of the flag bit from LAST_STATUS everywhere.
347 * command.c (update_reader_status_file): Factor code out to ...
348 (send_client_notifications): New. Track signals already sent.
349 (update_reader_status_file): Shutdown the reader after a failed
352 2008-12-09 Werner Koch <wk@g10code.com>
354 * scdaemon.c (main): Call i18n_init before init_common_subsystems.
356 2008-12-08 Werner Koch <wk@g10code.com>
358 * scdaemon.c (handle_connections): Sync ticker to the next full
360 (TIMERTICK_INTERVAL_USEC): Change to 500ms.
362 2008-12-05 Werner Koch <wk@g10code.com>
364 * app-openpgp.c (app_local_s): Add field ALGO_ATTR_CHANGE.
365 (app_select_openpgp): Parse new capability.
366 (show_caps): Show new capability.
368 2008-12-03 Werner Koch <wk@g10code.com>
370 * scdaemon.c (opts): Use ARGPARSE_ macros. Add option
372 * command.c (update_reader_status_file): Implement it.
374 2008-11-18 Werner Koch <wk@g10code.com>
376 * scdaemon.c (make_libversion): New.
377 (my_strusage): Print libgcrypt and libksba version.
379 2008-11-03 Werner Koch <wk@g10code.com>
381 * command.c (server_local_s): Add field DISCONNECT_ALLOWED.
382 (cmd_disconnect): Implement command.
383 (open_card): Reset disconnect flag.
384 (update_reader_status_file): Disconnect if allowed.
386 * app-common.h (app_ctx_s): Remove INITIALIZED. Make REF_COUNT
388 * app.c (select_application): Remove INITIALIZED.
389 (app_write_learn_status, app_readcert, app_readkey, app_getattr)
390 (app_setattr, app_sign, app_decipher, app_writecert)
391 (app_writekey, app_get_challenge, app_change_pin, app_check_pin):
392 Replace INITIALIZED by REF_COUNT check.
393 (application_notify_card_removed): Rename to ..
394 (application_notify_card_reset): .. this. Change all callers.
395 * command.c (do_reset): Call application_notify_card_reset after
397 (update_reader_status_file): Add arg SET_CARD_REMOVED.
398 (scd_update_reader_status_file): Pass true for new flag.
399 (do_reset): Pass false for new flag.
401 * app.c (app_get_serial_and_stamp): Use bin2hex.
402 * app-help.c (app_help_get_keygrip_string): Ditto.
403 * app-p15.c (send_certinfo, send_keypairinfo, do_getattr): Ditto.
404 * app-openpgp.c (send_fpr_if_not_null, send_key_data)
405 (retrieve_fpr_from_card, send_keypair_info): Ditto.
406 * app-nks.c (keygripstr_from_pk_file): Ditto.
407 * command.c (cmd_apdu): Ditto.
409 2008-10-21 Marcus Brinkmann <marcus@g10code.com>
411 * command.c (open_card): If connect error is SW_HOST_NO_CARD,
412 return a more descriptive error.
414 2008-10-20 Werner Koch <wk@g10code.com>
416 * pcsc-wrapper.c (read_32): Use provided arg and not stdin. Is
417 called with stdin, though.
418 (handle_close): Mark unused arg.
419 (handle_status, handle_reset): Ditto.
421 * ccid-driver.c (ccid_check_card_presence): Mark not yet used arg.
423 * scdaemon.c (scd_deinit_default_ctrl): Mark unused arg.
424 * command.c (cmd_unlock, cmd_restart, cmd_disconnect): Ditto.
425 * apdu.c (ct_get_status): Ditto.
426 (ct_send_apdu, pcsc_send_apdu_wrapped)
427 (apdu_open_remote_reader): Ditto.
428 * app.c (select_application): Ditto.
429 * app-openpgp.c (do_writecert, do_change_pin, do_writekey): Ditto.
430 * app-nks.c (do_change_pin, do_check_pin): Ditto.
432 2008-10-16 Werner Koch <wk@g10code.com>
434 * command.c (cmd_disconnect): New dummy command.
435 (register_commands): Register command.
437 2008-10-15 Werner Koch <wk@g10code.com>
439 * command.c (scd_command_handler): Return true if there is no more
441 * scdaemon.c (start_connection_thread): Set shutdown flag if
442 requested by command handler.
443 (main): Make PIPE_SERVER module global.
444 (handle_connections): Disable listen_fd if a shutdown is pending.
446 2008-10-14 Werner Koch <wk@g10code.com>
448 * apdu.c (reader_table_s): Add fields connect_card and
450 (new_reader_slot): Set them to NULL.
451 (apdu_connect, apdu_disconnect): New.
452 (apdu_close_reader, apdu_shutdown_reader): Call apdu_disconnect.
453 (connect_pcsc_card, disconnect_pcsc_card): new.
454 (reset_pcsc_reader_direct): Implement in terms of
455 disconnect_pcsc_card and connect_pcsc_card.
456 (apdu_get_atr): Return NULL if there is no ATR.
457 * sc-copykeys.c (main): Add call to apdu_connect.
458 * command.c (open_card): Ditto.
460 * apdu.h (SW_HOST_ALREADY_CONNECTED): New.
461 (APDU_CARD_USABLE, APDU_CARD_PRESENT, APDU_CARD_ACTIVE): New.
462 * apdu.c: Replace constants by the new macros.
463 (open_pcsc_reader): Factor code out to ...
464 (open_pcsc_reader_direct, open_pcsc_reader_wrapped): New.
465 (reset_pcsc_reader): Factor code out to ...
466 (reset_pcsc_reader_direct, reset_pcsc_reader_wrapped): New.
467 (pcsc_get_status): Factor code out to ...
468 (pcsc_get_status_direct, pcsc_get_status_wrapped): New.
469 (pcsc_send_apdu): Factor code out to ...
470 (pcsc_send_apdu_direct, pcsc_send_apdu_wrapped): New.
471 (close_pcsc_reader): Factor code out to ...
472 (close_pcsc_reader_direct, close_pcsc_reader_wrapped): New.
474 * command.c (update_reader_status_file): Open the reader if not
477 * scdaemon.c (TIMERTICK_INTERVAL_SEC, TIMERTICK_INTERVAL_USEC):
478 New to replace TIMERTICK_INTERVAL. Chnage from 2s (4 under W32)
481 2008-10-13 Werner Koch <wk@g10code.com>
483 * command.c (option_handler) [W32]: Use strtoul with base 16.
484 (update_reader_status_file) [W32]: Set Event.
485 (scd_command_handler): Use INT2FD to silent warning.
487 2008-09-29 Werner Koch <wk@g10code.com>
489 * scdaemon.h (GCRY_MD_USER): Rename to GCRY_MODULE_ID_USER.
490 (GCRY_MD_USER_TLS_MD5SHA1): Rename to MD_USER_TLS_MD5SHA1 and
493 2008-09-28 Marcus Brinkmann <marcus@g10code.com>
495 * apdu.c (pcsc_get_status): Fix last change.
497 2008-09-25 Werner Koch <wk@g10code.com>
499 * app-openpgp.c (do_setattr): Do not allow setting of the reset
501 (do_change_pin): Allow setting of the reset code.
503 2008-09-24 Werner Koch <wk@g10code.com>
505 * app-openpgp.c (verify_chv3): Set the did_chv3 flag which was
506 accidently removed on 2008-03-26.
507 (verify_chv2): Revert last change.
508 (do_change_pin): Do not change CHV2. Add reset code logic for v2
510 * iso7816.c (iso7816_reset_retry_counter_with_rc): New.
512 * app-openpgp.c (add_tlv, build_privkey_template): New.
513 (do_writekey): Support v2 keys and other key lengths than 1024.
514 * iso7816.c (iso7816_put_data_odd): New.
516 2008-09-23 Werner Koch <wk@g10code.com>
518 * app-openpgp.c (do_sign): Support SHA-2 digests.
519 (verify_chv2): No CHV auto-sync for v2 cards.
520 (do_auth): Allow 2048 bit keys.
521 (parse_algorithm_attribute): New.
522 (rsa_key_format_t): New.
523 (struct app_local_s): Add struct KEYATTR.
525 2008-09-23 Marcus Brinkmann <marcus@g10code.com>
527 * apdu.c (pcsc_get_status): Be more relaxed with the usable flag
530 2008-09-23 Werner Koch <wk@g10code.com>
532 * app-openpgp.c (do_setattr): Use command chaining for long
534 * iso7816.c (iso7816_put_data): Add arg EXTENDED_MODE. Change all
536 * apdu.c (apdu_send_simple): Add arg EXTENDED_MODE. Change all
538 (send_le): Implement command chaining.
539 * ccid-driver.c (ccid_transceive_apdu_level): Increase allowed
541 (ccid_transceive): Alow for APDUS of up to 259 bytes.
542 * apdu.h: Add new SW_ codes.
544 2008-09-16 Werner Koch <wk@g10code.com>
546 * command.c (cmd_writecert): New.
547 (register_commands): Register it.
548 * app-common.h (app_ctx_s): Add member WRITECERT.
549 * app.c (app_writecert): New.
550 * app-openpgp.c (do_writecert): New.
551 (parse_historical): New.
553 (dump_all_do): Print only the length of longs DOs.
554 * command.c (cmd_writekey, cmd_apdu, cmd_pksign)
555 (cmd_passwd): Replace open coding by skip_options.
557 2008-08-30 Moritz <moritz@gnu.org>
559 * scdaemon.c (main): Use estream_asprintf instead of asprintf.
560 * command.c (update_reader_status_file): Likewise.
561 (cmd_serialno): Use estream_asprintf instead of asprintf
562 and xfree instead of free to release memory allocated
563 through (estream_)asprintf.
564 (cmd_learn): Likewise.
566 * app-openpgp.c (get_public_key): Likewise.
568 2008-08-18 Werner Koch <wk@g10code.com>
570 * app-openpgp.c (do_setattr): Fix test for v2 cards.
572 2008-08-11 Werner Koch <wk@g10code.com>
574 * apdu.c (reset_pcsc_reader, open_pcsc_reader)
575 (reset_rapdu_reader, open_rapdu_reader): Allow ATRs of up to 33
576 bytes. Provide maximum size of ATR buffer using DIM. Such long
577 ATR are never seen in reality but the PC/SC library of MAC OS X is
578 just too buggy. Reported by Ludovic Rousseau. Fixes bug #948.
580 2008-07-30 Werner Koch <wk@g10code.com>
582 * app-openpgp.c (verify_a_chv): Use xtrymalloc and make the prompt
583 for CHV2 more user friendly.
585 2008-07-03 Werner Koch <wk@g10code.com>
587 * app-openpgp.c (do_readcert): New.
588 (app_local_s): Add fields IS_V2 and MAX_CERTLEN_3.
589 (app_select_openpgp): Set them and register do_readcert.
590 (do_setattr): Allow storing of the certificate.
592 2008-06-25 Werner Koch <wk@g10code.com>
594 * app-dinsig.c (do_sign): Allow for SHA256.
596 2008-06-24 Werner Koch <wk@g10code.com>
598 * app-common.h (app_ctx_s): Renamed reset_mode parameter of
599 change_pin to mode_Flags and make it an unsigned int.
600 (APP_CHANGE_FLAG_RESET, APP_CHANGE_FLAG_NULLPIN): New.
601 * app-openpgp.c (do_change_pin): Adjust for that.
603 * command.c (cmd_passwd): Add option --nullpin.
604 * app-nks.c (do_check_pin, do_change_pin): New.
605 (app_select_nks): Register new functions.
607 2008-04-21 Moritz Schulte <mo@g10code.com> (wk)
609 * app-openpgp.c (verify_a_chv): Make use of the default CHV flag.
611 2008-03-26 Werner Koch <wk@g10code.com>
613 * app-openpgp.c (verify_chv3): Support the keypad.
615 2008-02-09 Marcus Brinkmann <marcus@g10code.de>
617 * scdaemon.c (main): Use CONFIG_FILENAME as filename if it is set
618 in gpgconf-list output.
620 2007-12-10 Werner Koch <wk@g10code.com>
622 * app-openpgp.c (do_decipher): Take care of cryptograms shorter
623 that 128 bytes. Fixes bug#851.
625 2007-11-14 Werner Koch <wk@g10code.com>
627 * scdaemon.c (main): Pass STANDARD_SOCKET flag to
628 create_server_socket.
630 2007-11-13 Werner Koch <wk@g10code.com>
632 * scdaemon.c (start_connection_thread): Do not call
633 assuan_sock_check_nonce if we are running in --server mode.
635 2007-11-07 Werner Koch <wk@g10code.com>
637 * scdaemon.h: Remove errors.h.
639 2007-10-02 Werner Koch <wk@g10code.com>
641 * command.c (cmd_getinfo): Add "pid" subcommand.
643 2007-10-01 Werner Koch <wk@g10code.com>
645 * scdaemon.c (create_server_socket): Use Assuan socket wrappers
646 and remove Windows specific code.
648 (start_connection_thread): Check nonce.
650 2007-09-14 Marcus Brinkmann <marcus@g10code.de>
652 * scdaemon.c (main): New variable STANDARD_SOCKET, which is 1 for
653 W32 targets. Use it for create_socket_name.
655 2007-08-07 Werner Koch <wk@g10code.com>
657 * tlv.c, tlv.h: Move to ../common/.
659 2007-08-02 Werner Koch <wk@g10code.com>
661 * scdaemon.c: Include gc-opt-flags.h and remove their definition
664 2007-08-01 Werner Koch <wk@g10code.com>
666 * apdu.c (send_le): Implement exact length hack. Suggested by
669 2007-07-05 Werner Koch <wk@g10code.com>
671 * command.c (has_option_name, skip_options): New.
672 (cmd_genkey): Add option --timestamp.
673 (cmd_writekey): Enter confidential mode while inquiring the key data.
675 * app.c (app_genkey): Add arg CREATETIME.
676 * app-common.h (app_ctx_s): Likewise
677 * app-openpgp.c (do_genkey): Ditto. Use it.
680 2007-07-04 Werner Koch <wk@g10code.com>
682 * command.c (cmd_getinfo): New subcommand "version".
684 * scdaemon.c (TIMERTICK_INTERVAL): New.
685 (handle_connections) [W32]: Enable a dummy sigs event.
686 (handle_connections): Use a proper count for select and not
688 (fixed_gcry_pth_init, main): Kludge to fix pth initialization.
690 2007-06-21 Werner Koch <wk@g10code.com>
692 * scdaemon.h (ctrl_t): Remove. It is now declared in ../common/util.h.
694 2007-06-18 Marcus Brinkmann <marcus@g10code.de>
696 * scdaemon.c (main): Percent escape output of --gpgconf-list.
698 2007-06-12 Werner Koch <wk@g10code.com>
700 * scdaemon.c (main): Replace some calls by init_common_subsystems.
702 2007-06-11 Werner Koch <wk@g10code.com>
704 * Makefile.am (scdaemon_LDADD): Use libcommonpth macro.
706 * command.c (initialize_module_command): New.
707 * scdaemon.c (main) [W32]: Do not use sigpipe code.
708 (main): Call initialize_module_command.
710 2007-06-06 Werner Koch <wk@g10code.com>
712 * app-openpgp.c (do_sign): Fix arithmetic on void*.
714 * app.c (dump_mutex_state) [W32]: Handle the W32Pth case.
716 * apdu.c: Remove dynload.h.
718 * scdaemon.c (i18n_init): Remove.
720 2007-04-20 Werner Koch <wk@g10code.com>
722 * sc-copykeys.c (my_gcry_logger): Removed.
723 (main): Call setup_libgcrypt_logging helper.
724 * scdaemon.c (my_gcry_logger): Removed.
725 (main): Call setup_libgcrypt_logging helper.
727 2007-04-03 Werner Koch <wk@g10code.com>
729 * command.c (cmd_getinfo): New subcommand "reader_list".
730 * ccid-driver.c (scan_or_find_devices): Ignore EBUSY in scan mode
731 for special transports.
733 2007-03-07 Werner Koch <wk@g10code.com>
735 * app-dinsig.c: Include i18n.h.
736 (verify_pin): Support PIN pads.
737 * app-nks.c (verify_pin): Ditto.
739 * ccid-driver.c (bulk_in): Handle time extension before checking
741 (ccid_transceive_secure): Support the Cherry XX44 keyboard.
742 Kudos to the nice folks at Cherry for helping with that.
744 2007-02-18 Werner Koch <wk@g10code.com>
746 * scdaemon.c (DEFAULT_PCSC_DRIVER): Add a default for OS X.
748 2007-01-25 Werner Koch <wk@g10code.com>
750 * Makefile.am (scdaemon_LDADD): Added LIBICONV. Noted by Billy
753 2006-12-21 Werner Koch <wk@g10code.com>
755 * app-openpgp.c (verify_chv2): Factored most code out into...
756 (verify_a_chv): ... new.
757 (do_sign): Factored verification code out to new function and
758 take care of a keypad entered PIN.
759 (compare_fingerprint): Print an additional diagnostic.
761 2006-11-28 Werner Koch <wk@g10code.com>
763 * apdu.c (send_le, apdu_send_direct): Increase RESULTLEN to 258 to
764 allow for full 256 byte and the status word. This might break
765 some old PC/SC drivers or cards, but we will see. Suggested by
768 2006-11-23 Werner Koch <wk@g10code.com>
770 * command.c (scd_command_handler): Fixed use of CTRL.
772 2006-11-21 Werner Koch <wk@g10code.com>
774 * Makefile.am (libexec_PROGRAMS): Put pscs-wrapper into libexec.
775 Renamed to gnupg-pcsc-wrapper.
776 * apdu.c (open_pcsc_reader): Use GNUPG_LIBEXECDIR to accces the
777 wrapper. Suggested by Eric Dorland.
779 2006-11-20 Werner Koch <wk@g10code.com>
781 * app-openpgp.c (verify_chv2): Support for keypads (only CHV2).
783 * ccid-driver.c (ccid_transceive_secure): Made it work for Kaan
786 2006-11-17 Werner Koch <wk@g10code.com>
788 * ccid-driver.c (scan_or_find_devices): Use DEBUGOUT_2 instead of
789 log_debug. Removed few other log_debug.
791 * iso7816.c (iso7816_check_keypad): Allow for a SW of 0.
793 * command.c (pin_cb): New mode to prompt for a keypad entry.
795 * scdaemon.c (main) <gpgconf-list>: Add disable-keypad.
797 2006-11-15 Werner Koch <wk@g10code.com>
799 * app-p15.c (read_ef_odf): Cast one printf arg.
801 * scdaemon.h (struct server_control_s): Add field THREAD_STARTUP.
802 * command.c (scd_command_handler): Add new arg CTRL.
803 * scdaemon.c (scd_init_default_ctrl): Made static.
804 (scd_deinit_default_ctrl): New.
805 (start_connection_thread): Call init/deinit of ctrl.
806 (handle_connections): Allocate CTRL.
808 * apdu.c (PCSC_ERR_MASK): New.
809 (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu)
810 (close_pcsc_reader, open_pcsc_reader): Use it after shifting error
811 values. Reported by Henrik Nordstrom. Fixes bug #724.
813 2006-10-24 Werner Koch <wk@g10code.com>
815 * scdaemon.h (GCRY_MD_USER_TLS_MD5SHA1): New.
816 (MAX_DIGEST_LEN): Increased to 36.
817 * app-p15.c (do_sign): Support for TLS_MD5SHA1.
818 (do_auth): Detect TLS_MD5SHA1.
819 (do_sign): Tweaks for that digest.
821 2006-10-23 Werner Koch <wk@g10code.com>
823 * scdaemon.c (main): New command --gpgconf-test.
825 2006-10-17 Werner Koch <wk@g10code.com>
827 * Makefile.am (scdaemon_LDADD): Link against libcommonpth.
829 2006-10-12 Werner Koch <wk@g10code.com>
831 * apdu.c: Include pth.h after unistd.h for the sake of newer Pth
834 2006-10-11 Werner Koch <wk@g10code.com>
836 * app-openpgp.c (do_sign): Redirect to do_auth for OpenPGP.3.
838 2006-10-06 Werner Koch <wk@g10code.com>
840 * Makefile.am (AM_CFLAGS): Use PTH version of libassuan.
841 (scdaemon_LDADD): Ditto.
843 * scdaemon.h (send_status_info): Mark with sentinel attribute.
845 2006-10-02 Marcus Brinkmann <marcus@g10code.de>
847 * command.c (update_reader_status_file): Increase buffer of
848 NUMBUF2 (fixing typo).
850 2006-09-24 Marcus Brinkmann <marcus@g10code.de>
852 * app-openpgp.c (do_sign): Advance INDATA by the SHA1 resp. RMD160
855 2006-09-14 Werner Koch <wk@g10code.com>
857 Replaced all call gpg_error_from_errno(errno) by
858 gpg_error_from_syserror().
860 * command.c (scd_command_handler): Replaced
861 init_connected_socket_server by init_socket_server_ext.
863 2006-09-07 Werner Koch <wk@g10code.com>
865 * command.c (update_reader_status_file): Execute an event handler
868 2006-09-06 Werner Koch <wk@g10code.com>
870 * apdu.c (pcsc_end_transaction):
871 * pcsc-wrapper.c (pcsc_end_transaction: Fixed dclaration.
872 Reported by Bob Dunlop.
874 * scdaemon.h (CTRL,APP): Removed and changed everywhere to
877 Replaced all Assuan error codes by libgpg-error codes. Removed
878 all map_to_assuan_status and map_assuan_err.
880 * scdaemon.c (main): Call assuan_set_assuan_err_source to have Assuan
881 switch to gpg-error codes.
882 * command.c (set_error): Adjusted.
884 2006-09-02 Marcus Brinkmann <marcus@g10code.de>
886 * command.c (get_reader_slot): Return the slot_table index, not
887 the APDU slot number.
888 (update_reader_status_file): Use the slot_table index in the
889 update_card_removed invocation.
891 2006-09-01 Marcus Brinkmann <marcus@g10code.de>
893 * command.c (cmd_getinfo): Handle status command.
895 2006-08-30 Marcus Brinkmann <marcus@g10code.de>
897 * command.c (do_reset): Delay resetting CTRL->reader_slot until
898 after update_card_removed invocation.
900 2006-08-28 Marcus Brinkmann <marcus@g10code.de>
902 * app-openpgp.c (do_decipher, do_sign): Allow "OPENPGP.2"
903 resp. "OPENPGP.1" for KEYIDSTR.
905 2006-08-21 Werner Koch <wk@g10code.com>
907 * pcsc-wrapper.c (handle_open, handle_close): Reset card and
908 protocol on error/close.
909 (handle_status): Don't set the state if the state is unknown.
910 (handle_reset): Ignore an error if already disconnected. May
911 happen due to system wake-up after hibernation. Suggested by Bob
914 2006-06-28 Werner Koch <wk@g10code.com>
916 * app-openpgp.c (do_writekey): Fixed computation of memmove
917 length. This led to garbled keys if E was larger than one byte.
918 Thanks to Achim Pietig for hinting at the garbled E.
920 2006-06-09 Marcus Brinkmann <marcus@g10code.de>
922 * Makefile.am (scdaemon_LDADD): Add $(NETLIBS).
924 2006-04-14 Marcus Brinkmann <marcus@g10code.de>
926 * app.c (select_application): Cover up a slot mismatch error in
927 case it happens (it shouldn't happen).
928 (release_application): Use APP->slot. Lock the reader.
929 (application_notify_card_removed): Lock the reader.
931 2006-04-11 Werner Koch <wk@g10code.com>
933 * command.c (hex_to_buffer): New.
936 2006-04-03 Werner Koch <wk@g10code.com>
938 * scdaemon.c [__GLIBC__]: Default to libpcsclite.so.1.
940 2006-03-21 Werner Koch <wk@g10code.com>
942 * command.c (cmd_pksign): Add --hash option.
944 2006-03-01 Werner Koch <wk@g10code.com>
946 * command.c (status_file_update_lock): New.
947 (scd_update_reader_status_file): Use lock and factor existing code
949 (update_reader_status_file): .. this.
950 (do_reset): Use the lock and call update_reader_status_file.
952 2006-02-20 Werner Koch <wk@g10code.com>
954 * apdu.c (open_pcsc_reader): Fixed double free. Thanks to Moritz.
956 2006-02-09 Werner Koch <wk@g10code.com>
958 * command.c (get_reader_slot, do_reset)
959 (scd_update_reader_status_file): Rewrote.
961 * app.c (release_application): Factored code out to ..
962 (deallocate_app): new function.
963 (select_application): Introduce new saved application stuff.
964 (application_notify_card_removed): New.
965 * command.c (update_card_removed): Call it here.
966 (do_reset): And here.
968 * app.c (check_application_conflict): New.
969 * command.c (open_card): Use it here.
970 (cmd_restart): New command.
972 * command.c (cmd_lock): Fixed --wait option to actually terminate.
974 2006-02-08 Werner Koch <wk@g10code.com>
976 * ccid-driver.c (ccid_get_atr): Read Parameter and select T=1
977 using these parameters.
978 (scan_or_find_devices): Check for NULL r_fd.
980 2006-02-02 Werner Koch <wk@g10code.com>
982 * ccid-driver.c (special_transport): New
983 (ccid_open_reader, do_close_reader, ccid_shutdown_reader)
984 (bulk_out, bulk_in): Add support for CardMan 4040 reader.
986 * ccid-driver.c (scan_or_find_devices): Factored most code out to
987 (scan_or_find_usb_device): .. new.
988 (make_reader_id): Fixed vendor mask.
990 2006-01-01 Werner Koch <wk@g10code.com>
992 * app-openpgp.c (do_sign): Give user error if hash algorithm is
993 not supported by the card.
995 2005-12-06 Werner Koch <wk@g10code.com>
997 * apdu.c (open_pcsc_reader): Check that pcsc-wrapper is actually
1000 2005-11-23 Werner Koch <wk@g10code.com>
1002 * app-nks.c (verify_pin): Give a special error message for a Nullpin.
1004 2005-10-29 Werner Koch <wk@g10code.com>
1006 * ccid-driver.c (send_escape_cmd): New args RESULT, RESULTLEN and
1007 RESULTMAX. Changed all callers.
1008 (ccid_transceive_escape): New.
1010 2005-10-27 Werner Koch <wk@g10code.com>
1012 * apdu.c [__CYGWIN__]: Make cygwin environment similar to _WIN32.
1013 Suggested by John P. Clizbe.
1014 * scdaemon.c [__CYGWIN__]: Set default PC/SC driver to winscard.dll.
1016 2005-10-19 Werner Koch <wk@g10code.com>
1018 * ccid-driver.h (CCID_DRIVER_ERR_NO_KEYPAD): New.
1019 * apdu.h (SW_HOST_NO_KEYPAD): New.
1020 * iso7816.h (struct iso7816_pininfo_s): New.
1021 * iso7816.c (map_sw): Support new code.
1022 (iso7816_check_keypad): New.
1023 (iso7816_verify_kp, iso7816_change_reference_data_kp)
1024 (iso7816_reset_retry_counter_kp): New. Extended versions of the
1026 * apdu.c (host_sw_string): Support new code.
1027 (reader_table_s): New field CHECK_KEYPAD.
1028 (new_reader_slot, open_ct_reader, open_pcsc_reader)
1029 (open_ccid_reader, open_rapdu_reader): Initialize it.
1030 (check_ccid_keypad): New.
1031 (apdu_check_keypad): New.
1032 (apdu_send_le): Factored all code out to ...
1033 (send_le): .. new. Takes an additional arg; changed all callers
1034 of the orginal function to use this one with a NULL for the new
1036 (apdu_send_simple_kp): New.
1037 (ct_send_apdu, pcsc_send_apdu, my_rapdu_send_apdu)
1038 (send_apdu_ccid): New arg PININFO.
1039 (send_apdu_ccid): Use the new arg.
1041 * scdaemon.c: New option --disable-keypad.
1043 2005-10-08 Marcus Brinkmann <marcus@g10code.de>
1045 * Makefile.am (scdaemon_LDADD): Add ../gl/libgnu.a after
1046 ../common/libcommon.a.
1048 2005-09-20 Werner Koch <wk@g10code.com>
1050 * app-dinsig.c (verify_pin): Try ISO 9564 BCD encoding.
1052 * iso7816.c (iso7816_select_application): Add arg FLAGS. Changed
1053 all callers to pass 0.
1054 * app-openpgp.c (app_select_openpgp): But this one requires a
1057 * app-p15.c (app_select_p15): Don't use select application for the
1060 2005-09-09 Werner Koch <wk@g10code.com>
1062 * pcsc-wrapper.c (main): Removed bogus free.
1064 * app-p15.c (do_auth): New.
1065 (do_getattr): New attribs $AUTHKEYID and $DISPSERIALNO.
1066 * app-openpgp.c (do_getattr): Ditto.
1068 2005-09-08 Werner Koch <wk@g10code.com>
1070 * app-openpgp.c (do_getattr): New key $AUTHKEYID.
1072 2005-09-06 Werner Koch <wk@g10code.com>
1074 * app-p15.c (do_sign): Tweaked for BELPIC cards.
1075 (read_home_df): New arg R_BELPIC.
1076 (app_select_p15): Set card type for BELPIC.
1078 2005-09-05 Werner Koch <wk@g10code.com>
1080 * iso7816.c (iso7816_select_path): New.
1081 * app-p15.c (select_ef_by_path): Allow for direct path selection.
1082 (app_select_p15): Try using the Belgian variant of pkcs#15.
1083 (read_home_df): New.
1084 (read_ef_odf): Generalized.
1085 (read_ef_tokeninfo): New.
1086 (read_p15_info): Set serialnumber from TokenInfo.
1087 (app_select_p15): Don't munge serialNumber - that must be done
1090 * iso7816.c (iso7816_read_binary): Use Le=0 when reading all
1091 data. Handle 6C00 error and take 6B00 as indication for EOF.
1092 * apdu.h (SW_EXACT_LENGTH_P): New.
1093 * apdu.c (new_reader_slot, reset_pcsc_reader, pcsc_get_status)
1094 (open_pcsc_reader): Set new reader state IS_T0.
1095 (apdu_send_le): When doing T=0 make sure not to send Lc and Le.
1096 Problem reported by Carl Meijer.
1097 (apdu_send_direct): Initialize RESULTLEN.
1098 * pcsc-wrapper.c (handle_status): Return the current protocol as
1101 2005-08-05 Werner Koch <wk@g10code.com>
1103 * apdu.c (open_rapdu_reader): Set the reader number.
1105 2005-07-05 Werner Koch <wk@g10code.com>
1107 * app-openpgp.c (do_readkey): Return a mallcoed copy of the key as
1108 required by the description. Thanks to Moritz for tracking this
1111 2005-06-21 Werner Koch <wk@g10code.com>
1113 * scdaemon.c (main): ifdef call to ccid_set_debug_level.
1115 * apdu.c (reset_pcsc_reader, open_pcsc_reader): Cast size_t to
1118 2005-06-06 Werner Koch <wk@g10code.com>
1120 * scdaemon.c (main): New option --debug-allow-core-dump.
1122 2005-06-03 Werner Koch <wk@g10code.com>
1124 * scdaemon.c (handle_connections): Make sure that the signals we
1125 are handling are not blocked.Block signals while creating new
1127 (handle_connections): Include the file descriptor into the name of
1130 2005-06-02 Werner Koch <wk@g10code.com>
1132 * app.c (app_dump_state, dump_mutex_state): New.
1133 * scdaemon.c (handle_signal): Print it on SIGUSR1.
1135 * app-openpgp.c (do_writekey): Typo fix.
1137 * command.c (open_card): Check for locked state even if an
1138 application context is available.
1140 * app-common.h: Add REF_COUNT field.
1141 * app.c (release_application, select_application): Implement
1142 reference counting to share the context beween connections.
1144 * app.c (lock_reader, unlock_reader): Take SLOT instead of APP as
1145 argument. Changed all callers.
1146 (select_application): Unlock the reader on error. This should fix
1147 the hangs I noticed last week.
1149 * scdaemon.h: Removed card_ctx_t cruft.
1151 2005-06-01 Werner Koch <wk@g10code.com>
1153 * scdaemon.c: Include mkdtemp.h.
1155 2005-05-31 Werner Koch <wk@g10code.com>
1157 * tlv.c [GNUPG_MAJOR_VERSION==1]: Define constants instead of
1158 including a gnupg 1.4 header.
1160 2005-05-30 Werner Koch <wk@g10code.com>
1162 * tlv.c: Add hack to compile without gpg-error.h when used with
1165 2005-05-23 Werner Koch <wk@g10code.com>
1167 * Makefile.am: Do not build sc-copykeys anymore.
1169 * app-openpgp.c (app_openpgp_storekey, app_openpgp_readkey)
1170 (app_openpgp_cardinfo): Removed.
1172 * ccid-driver.c (parse_ccid_descriptor): SCR335 FW version 5.14 is
1174 (do_close_reader): Never do a reset. The caller should instead
1175 make sure that the reader has been closed properly. The new retry
1176 code in ccid_slot_status will make sure that the readersatrts up
1177 fine even if the last process didn't closed the USB connection
1179 (ccid_get_atr): For certain readers try switching to ISO mode.
1180 Thanks to Ludovic Rousseau for this hint and the magic numbers.
1181 (print_command_failed): New.
1182 (bulk_in): Use it here. Add new arg NO_DEBUG.
1183 (ccid_slot_status): Disabled debugging.
1185 2005-05-21 Werner Koch <wk@g10code.com>
1187 * scdaemon.c (handle_signal): Print thread info on SIGUSR1.
1189 2005-05-20 Werner Koch <wk@g10code.com>
1191 * ccid-driver.c: Replaced macro DEBUG_T1 by a new debug level.
1192 (parse_ccid_descriptor): Mark SCR335 firmware version 5.18 good.
1193 (ccid_transceive): Arghhh. The seqno is another bit in the
1194 R-block than in the I block, this was wrong at one place.
1196 * scdaemon.c: New options --debug-ccid-driver and
1197 --debug-disable-ticker.
1199 * app-openpgp.c (do_genkey, do_writekey): Factored code to check
1200 for existing key out into ..
1201 (does_key_exist): .. New function.
1203 2005-05-19 Werner Koch <wk@g10code.com>
1205 * tlv.c (parse_sexp): New.
1207 * command.c (cmd_writekey): New.
1208 * app.c (app_writekey): New.
1209 * app-common.c (app_t): Add function ptr WRITEKEY.
1210 * app-openpgp.c (do_writekey): New.
1212 * app-openpgp.c (do_readkey) [GNUPG_MAJOR_VERSION==1]: Return error.
1213 * app-common.h (app_t) [GNUPG_MAJOR_VERSION==1]: Add a field to
1214 store the Assuan context.
1216 2005-05-17 Werner Koch <wk@g10code.com>
1218 * scdaemon.c: Removed non-pth code paths.
1219 (create_socket_name, create_server_socket): New. Taken from
1221 (cleanup): Changed to adjust for SOCKET_NAME now being malloced.
1222 (ticker_thread): Always use pth_event_occurred; it is again
1223 defined for all decent PTH versions.
1224 (handle_connections): New. Based on the gpg-agent code.
1225 (start_connection_thread): Ditto.
1226 (ticker_thread): Removed.
1227 (cleanup_sh): Removed.
1228 (main): Run the handler for the pipe server in a separate
1229 thread. This replaces the old ticker thread.
1230 (scd_get_socket_name): New.
1231 * command.c (cmd_getinfo): New command GETINFO.
1232 (scd_command_handler): Renamed argument and changed code to use an
1233 already connected FD.
1235 2005-05-15 Werner Koch <wk@g10code.com>
1237 * app.c, app-common.h, app-nks.c, app-p15.c, app-dinsig.c
1238 * app-openpgp.c: Change most function return types from int to
1240 * command.c (pin_cb): Ditto.
1241 * sc-copykeys.c (pincb): Ditto.
1243 * app.c (lock_reader, unlock_reader): New. Changed call handler
1244 wrappers to make use of these functions.
1246 2005-05-07 Werner Koch <wk@g10code.com>
1248 * ccid-driver.c (do_close_reader): Don't do a reset before close.
1249 Some folks reported that it makes the SCR335 hang less often.
1250 Look at the source on how to re-enable it.
1252 2005-04-27 Werner Koch <wk@g10code.com>
1254 * app-p15.c (micardo_mse): New.
1256 * iso7816.c (iso7816_manage_security_env): Allow passing DATA as
1257 NULL to indicate an empty Lc.
1258 * tlv.c (find_tlv): Check that a found object fits into the
1260 (find_tlv_unchecked): New as replacement for the old non-checking
1262 * app.c (select_application): Keep on using the non-checking
1264 * app-openpgp.c (get_one_do, dump_all_do): Ditto.
1267 Removal of the old OpenSC based code.
1269 * app-p15.c: New. Basic support for pkcs15 cards without OpenSC.
1270 There are quite a couple of things missing but at least I can use
1271 my old TCOS cards from the Aegypten-1 development for signing.
1272 * app.c (select_application): Detect pkcs15 applications.
1273 * Makefile.am (scdaemon_SOURCES): Removed card.c, card-common.h
1274 and card-p15.c because they are now obsolete. Added app-p15.c.
1275 Removed all OpenSC stuff.
1276 * command.c (do_reset, open_card, cmd_serialno, cmd_learn)
1277 (cmd_readcert, cmd_readkey, cmd_pksign, cmd_pkdecrypt): Removed
1278 all special cases for the old card.c based mechanisms.
1279 * scdaemon.c, apdu.c: Removed all special cases for OpenSC.
1281 2005-04-20 Werner Koch <wk@g10code.com>
1283 * command.c: Use GPG_ERR_LOCKED instead of EBUSY.
1285 2005-04-14 Werner Koch <wk@g10code.com>
1287 * app-openpgp.c (retrieve_key_material): Rewritten. Return a
1289 (retrieve_next_token): Removed.
1290 (retrieve_fpr_from_card): Rewritten to make use of DO caching and
1291 to take the KEYNO as arg.
1292 (get_public_key): Renamed variable for clarity.
1294 2005-04-12 Werner Koch <wk@g10code.com>
1296 Basic support for several sessions.
1298 * command.c (scd_command_handler): Replace the primary_connection
1299 stuff by a real connection list. Release the local context on
1301 (scd_update_reader_status_file): Update accordingly. Send signal
1302 to all connections who registered an event signal.
1303 (cmd_lock, cmd_unlock, register_commands): New commands LOCK and
1305 (cmd_setdata, cmd_pksign, cmd_pkauth, cmd_pkdecrypt, cmd_setattr)
1306 (cmd_genkey, cmd_passwd, cmd_checkpin): Return an error if reader
1308 (do_reset): Handle locking.
1309 (open_card): Ditto. Share the reader slot with other sessions.
1310 (get_reader_slot): New.
1311 (update_card_removed): New. Use it in the TEST_CARD_REMOVAL macro.
1313 2005-04-07 Werner Koch <wk@g10code.com>
1315 * app-openpgp.c (do_check_pin): Add hack to allow verification of
1317 (get_public_key): Don't use gcry functions to create S-expressions.
1318 (do_deinit, do_readkey, do_genkey, send_keypair_info): Adjust for
1321 2005-03-29 Moritz Schulte <moritz@g10code.com>
1323 * app-openpgp.c (retrieve_fpr_from_card): New function.
1324 (retrieve_next_token): New function.
1325 (retrieve_key_material): New function.
1326 (get_public_key): Implement retrival of key through expernal
1327 helper (gpg) in case the openpgp card is not cooperative enough.
1329 2005-03-16 Werner Koch <wk@g10code.com>
1331 * ccid-driver.c (parse_ccid_descriptor): Make SCM workaround
1332 reader type specific.
1333 (scan_or_find_devices): Do not check the interface subclass in the
1334 SPR532 kludge, as this depends on the firmware version.
1335 (ccid_get_atr): Get the Slot status first. This solves the
1336 problem with readers hanging on recent Linux 2.6.x.
1337 (bulk_in): Add argument TIMEOUT and changed all callers to pass an
1338 appropriate one. Change the standard timeout from 10 to 5 seconds.
1339 (ccid_slot_status): Add a retry code with an initial short timeout.
1340 (do_close_reader): Do an usb_reset before closing the reader.
1342 2005-02-25 Werner Koch <wk@g10code.com>
1344 * app-openpgp.c (get_public_key): Make sure not to return negative
1346 (do_sign): Allow passing of indata with algorithm prefix.
1347 (do_auth): Allow OPENPGP.3 as an alternative ID.
1349 * app.c (app_getattr): Return just the S/N but not the timestamp.
1351 2005-02-24 Werner Koch <wk@g10code.com>
1353 * app.c (app_getattr): Return APPTYPE or SERIALNO type even if the
1354 application does dot support the getattr call.
1356 * app-openpgp.c (get_one_do): Never try to get a non cacheable
1357 object from the cache.
1358 (get_one_do): Add new arg to return an error code. Changed all
1360 (do_getattr): Let it return a proper error code.
1362 * app.c (select_application): Return an error code and the
1363 application context in an new arg.
1364 * command.c (open_card): Adjusted for that. Don't use the
1365 fallback if no card is present. Return an error if the card has
1366 been removed without a reset.
1367 (do_reset, cmd_serialno): Clear that error flag.
1368 (TEST_CARD_REMOVAL): New. Use it with all command handlers.
1369 (scd_update_reader_status_file): Set the error flag on all changes.
1371 * scdaemon.c (ticker_thread): Termintate if a shutdown is pending.
1373 * apdu.c: Added some PCSC error codes.
1374 (pcsc_error_to_sw): New.
1375 (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu)
1376 (open_pcsc_reader): Do proper error code mapping.
1378 2005-03-16 Werner Koch <wk@g10code.com>
1380 * ccid-driver.c (parse_ccid_descriptor): Make SCM workaround
1381 reader type specific.
1382 (scan_or_find_devices): Do not check the interface subclass in the
1383 SPR532 kludge, as this depends on the firmware version.
1384 (ccid_get_atr): Get the Slot status first. This solves the
1385 problem with readers hanging on recent Linux 2.6.x.
1387 2005-02-22 Werner Koch <wk@g10code.com>
1389 * app-openpgp.c (app_local_s): New field PK.
1390 (do_deinit, do_genkey, app_openpgp_storekey): Clear it.
1391 (get_public_key, send_keypair_info): New.
1392 (do_learn_status): Send KEYPAIR info
1394 * app-common.h (app_ctx_t): Add function pointer READKEY.
1395 * app.c (app_readkey): New.
1396 * command.c (cmd_readkey): Use READKEY function if possible.
1398 2005-01-26 Werner Koch <wk@g10code.com>
1400 * ccid-driver.c (parse_ccid_descriptor): Need the CSM workaround
1401 also for newer firmware versions. Need to get a list of fixed
1402 firmware versions and use that.
1404 2005-01-25 Werner Koch <wk@g10code.com>
1406 * apdu.c (apdu_send_le, apdu_send_direct): Fix some compiler
1409 * app-openpgp.c (get_cached_data): New arg GET_IMMEDIATE to bypass
1410 the cache. Changed all callers.
1411 (get_one_do): Bypass the cache if the value would have been read
1412 directly for v1.1 cards.It makes things a bit slower but obnly for
1413 1.0 cards and there are not that many cards out in the wild. This
1414 is required to fix a caching bug when generating new keys; as a
1415 side effect of the retrieval of the the C4 DO from the 6E DO the
1416 cached fingerprint will get updated to the old value and later
1417 when signing the generated key the checking of the fingerprint
1418 fails because it won't match the new one. Thanks to Moritz for
1419 analyzing this problem.
1420 (verify_chv3): Removed the CHV status reread logic because we
1421 won't cache the C4 DO anymore.
1423 2004-12-28 Werner Koch <wk@g10code.com>
1425 * ccid-driver.c (find_endpoint): New.
1426 (scan_or_find_devices): Add new args to return endpoint info and
1428 (ccid_open_reader, ccid_shutdown_reader): Take care of these new
1430 (bulk_in, bulk_out): Use the correct endpoints.
1431 (ccid_transceive_apdu_level): New.
1432 (ccid_transceive): Divert to above.
1433 (parse_ccid_descriptor): Allow APDU level exchange mode.
1434 (do_close_reader): Pass the interface number to usb_release_interface.
1436 2004-12-21 Werner Koch <wk@g10code.com>
1438 * scdaemon.c (main): Use default_homedir().
1440 2004-12-18 Werner Koch <wk@g10code.com>
1442 * scdaemon.c (main) [W32]: Remove special Pth initialize..
1444 * scdaemon.h (map_assuan_err): Define in terms of
1445 map_assuan_err_with_source.
1447 2004-12-15 Werner Koch <wk@g10code.com>
1449 * scdaemon.c [W32]: Various hacks to make it run under W32.
1451 * command.c (scd_update_reader_status_file) [W32]: Don't use kill.
1453 * apdu.c [W32]: Disable use of pcsc_wrapper.
1455 * Makefile.am (scdaemon_LDADD): Reorder libs.
1456 (sc_copykeys_LDADD): Add libassuan because it is needed for W32.
1458 2004-12-06 Werner Koch <wk@g10code.com>
1460 * Makefile.am (pkglib_PROGRAMS): Build only for W32.
1462 2004-10-22 Werner Koch <wk@g10code.com>
1464 * app-openpgp.c (verify_chv3): The minium length for CHV3 is
1465 8. Changed string to match the other ones.
1467 2004-10-21 Werner Koch <wk@g10code.com>
1469 * app-openpgp.c (do_sign): Replace asprintf by direct allocation.
1470 This avoids problems with missing vasprintf implementations in
1473 * app-common.h (app_openpgp_storekey: Add prototype.
1475 2004-10-20 Werner Koch <wk@g10code.com>
1477 * sc-investigate: Removed.
1478 * Makefile.am (sc_investigate): Removed.
1480 * pcsc-wrapper.c (load_pcsc_driver): Load get_status_change func.
1481 (handle_open): Succeed even without a present card.
1482 (handle_status, handle_reset): New.
1484 * apdu.c (apdu_open_reader): Load pcsc_get_status_change fucntion.
1485 (pcsc_get_status): Implemented.
1486 (reset_pcsc_reader): Implemented.
1487 (open_pcsc_reader): Succeed even with no card inserted.
1488 (open_ccid_reader): Set LAST_STATUS.
1490 * iso7816.c (iso7816_select_application): Always use 0 for P1.
1492 2004-10-18 Werner Koch <wk@g10code.com>
1494 * ccid-driver.c (ccid_get_atr): Reset T=1 state info.
1496 2004-10-14 Werner Koch <wk@g10code.com>
1498 * app-openpgp.c (parse_login_data): New.
1499 (app_select_openpgp): Call it.
1500 (do_setattr): Reparse it after change.
1502 2004-10-06 Werner Koch <wk@g10code.de>
1504 * ccid-driver.c (ccid_open_reader): Store the vendor ID.
1505 (ccid_transceive_secure): New.
1506 (parse_ccid_descriptor): Workaround for an SCM reader problem.
1508 2004-10-04 Werner Koch <wk@g10code.de>
1510 * ccid-driver.c (send_escape_cmd): New.
1512 2004-09-30 Werner Koch <wk@g10code.com>
1514 * Makefile.am: Adjusted for gettext 0.14.
1516 * app-openpgp.c (do_sign): Add the error string to the verify
1519 2004-09-27 Werner Koch <wk@g10code.com>
1523 * app-openpgp.c: Made all strings translatable.
1524 (verify_chv3) [GNUPG_MAJOR_VERSION]: Make opt.allow_admin
1525 available for use in gnupg 2.
1526 (verify_chv3): Reimplemented countdown showing to use only
1527 functions from this module. Flush the CVH status cache on a
1529 (get_one_do): Hack to bypass the cache for cards versions > 1.0.
1530 (store_fpr): Store the creation date for card version > 1.0.
1532 * app-openpgp.c (app_openpgp_storekey): Call flush_cache.
1533 (get_cached_data): Move local data initialization to ..
1534 (app_select_openpgp): .. here. Read some flags for later use.
1535 (do_getattr): New read-only attribute EXTCAP.
1537 * apdu.c (open_pcsc_reader): Do not print empty reader string.
1539 * ccid-driver.c (do_close_reader): Factored some code out from ...
1540 (ccid_close_reader): ..here.
1541 (ccid_shutdown_reader): New.
1543 * apdu.c (apdu_shutdown_reader): New.
1544 (shutdown_ccid_reader): New.
1546 * apdu.c (open_ccid_reader): New arg PORTSTR. Pass it to
1548 (apdu_open_reader): Pass portstr to open_ccid_reader.
1549 (apdu_open_reader): No fallback if a full CCID reader id has been
1552 * ccid-driver.c (ccid_get_reader_list): New.
1553 (ccid_open_reader): Changed API to take a string for the reader.
1554 Removed al the cruft for the libusb development vesion which seems
1555 not to be maintained anymore and there are no packages anyway.
1556 The stable library works just fine.
1557 (struct ccid_reader_id_s): Deleted and replaced everywhere by a
1559 (usb_get_string_simple): Removed.
1560 (bulk_in): Do valgrind hack here and not just everywhere.
1562 * ccid-driver.c (read_device_info): Removed.
1563 (make_reader_id, scan_or_find_devices): New.
1564 (ccid_open_reader): Simplified by make use of the new functions.
1565 (ccid_set_debug_level): New. Changed the macros to make use of
1566 it. It has turned out that it is often useful to enable debugging
1567 at runtime so I added this option.
1569 From gnupg 1.3 - David Shaw <dshaw@jabberwocky.com>
1571 * app-openpgp.c (verify_chv3): Show a countdown of how many wrong
1572 admin PINs can be entered before the card is locked.
1574 * app-openpgp.c (get_cached_data): Avoid mallocing zero since it
1575 breaks us when using --enable-m-guard.
1577 * ccid-driver.c (usb_get_string_simple): Replacement function to
1578 work with older libusb.
1580 * ccid-driver.c (read_device_info): Fix segfault when usb device
1582 (ccid_open_reader): Allow working with an even older version of
1583 libusb (usb_busses global instead of usb_get_busses()).
1585 2004-09-11 Werner Koch <wk@g10code.com>
1587 * app-openpgp.c (app_select_openpgp): Its app_munge_serialno and
1588 not app_number_serialno.
1590 2004-08-20 Werner Koch <wk@g10code.de>
1592 * app.c (select_application): Fixed serial number extraction and
1593 added the BMI card workaround.
1594 (app_munge_serialno): New.
1595 * app-openpgp.c (app_select_openpgp): Try munging serialno.
1597 2004-08-05 Werner Koch <wk@g10code.de>
1599 * scdaemon.c (main): New option --disable-application.
1600 * app.c (is_app_allowed): New.
1601 (select_application): Use it to check for disabled applications.
1603 * ccid-driver.h (CCID_DRIVER_ERR_ABORTED): New.
1604 * ccid-driver.c (ccid_open_reader): Support the stable 0.1 version
1606 (ccid_get_atr): Handle short messages.
1608 * apdu.c (my_rapdu_get_status): Implemented.
1610 2004-07-27 Moritz Schulte <moritz@g10code.com>
1612 * apdu.c: Include <signal.h>.
1614 * Makefile.am: Use @DL_LIBS@ instead of -ldl.
1616 2004-07-22 Werner Koch <wk@g10code.de>
1618 * Makefile.am: Make OpenSC lib link after libgcrypt. Do not link
1620 * apdu.c: Don't use Pth if we use OpenSC.
1621 * sc-investigate.c, scdaemon.c: Disable use of pth if OpenSC is used.
1623 * scdaemon.c (main): Bumbed thread stack size up to 512k.
1625 2004-07-16 Werner Koch <wk@gnupg.org>
1627 * apdu.c (reader_table_s): Add function pointers for the backends.
1628 (apdu_close_reader, apdu_get_status, apdu_activate)
1629 (send_apdu): Make use of them.
1630 (new_reader_slot): Intialize them to NULL.
1631 (dump_ccid_reader_status, ct_dump_reader_status): New.
1632 (dump_pcsc_reader_status): New.
1633 (open_ct_reader, open_pcsc_reader, open_ccid_reader)
1634 (open_osc_reader, open_rapdu_reader): Intialize function pointers.
1635 (ct_activate_card, ct_send_apdu, pcsc_send_apdu, osc_send_apdu)
1636 (error_string): Removed. Replaced by apdu_strerror.
1637 (get_ccid_error_string): Removed.
1638 (ct_activate_card): Remove the unused loop.
1639 (reset_ct_reader): Implemented.
1640 (ct_send_apdu): Activate the card if not yet done.
1641 (pcsc_send_apdu): Ditto.
1643 2004-07-15 Werner Koch <wk@gnupg.org>
1645 * ccid-driver.h: Add error codes.
1646 * ccid-driver.c: Implement more or less proper error codes all
1649 * apdu.c (apdu_send_direct): New.
1650 (get_ccid_error_string): Add some error code mappings.
1651 (send_apdu): Pass error codes along for drivers already supporting
1653 (host_sw_string): New.
1654 (get_ccid_error_string): Use above.
1655 (send_apdu_ccid): Reset the reader if it has not yet been done.
1656 (open_ccid_reader): Don't care if the ATR can't be read.
1657 (apdu_activate_card): New.
1658 (apdu_strerror): New.
1659 (dump_reader_status): Only enable it with opt.VERBOSE.
1660 * iso7816.c (map_sw): Add mappings for the new error codes.
1662 2004-07-02 Werner Koch <wk@gnupg.org>
1664 * apdu.c (open_ct_reader, open_pcsc_reader, open_ccid_reader)
1665 (reset_ccid_reader, open_osc_reader): Call dump_reader_status only
1668 2004-07-01 Werner Koch <wk@gnupg.org>
1670 * sc-investigate.c: Initialize Pth which is now required.
1671 (interactive_shell): New command "readpk".
1673 * app-openpgp.c (do_getattr): Fix for sending CA-FPR.
1675 2004-06-30 Werner Koch <wk@gnupg.org>
1677 * app-openpgp.c (app_openpgp_readkey): Fixed check for valid
1680 2004-06-18 Werner Koch <wk@g10code.com>
1682 * sc-investigate.c (my_read_line): Renamed from read_line.
1684 2004-06-16 Werner Koch <wk@gnupg.org>
1686 * apdu.c (osc_get_status): Fixed type in function name. Noted by
1687 Axel Thimm. Yes, I didn't tested it with OpenSC :-(.
1689 2004-04-28 Werner Koch <wk@gnupg.org>
1691 * app-openpgp.c (do_setattr): Sync FORCE_CHV1.
1693 2004-04-27 Werner Koch <wk@gnupg.org>
1695 * app-common.h: Do not include ksba.h for gnupg 1.
1697 2004-04-26 Werner Koch <wk@gnupg.org>
1699 * app-common.h: New members FNC.DEINIT and APP_LOCAL.
1700 * app.c (release_application): Call new deconstructor.
1701 * app-openpgp.c (do_deinit): New.
1702 (get_cached_data, flush_cache_item, flush_cache_after_error)
1704 (get_one_do): Replaced arg SLOT by APP. Make used of cached data.
1705 (verify_chv2, verify_chv3): Flush some cache item after error.
1706 (do_change_pin): Ditto.
1708 (do_setattr): Flush cache item.
1709 (do_genkey): Flush the entire cache.
1710 (compare_fingerprint): Use cached data.
1712 * scdaemon.c (main): Do the last change the usual way. This is so
1713 that we can easily test for versioned config files above.
1715 2004-04-26 Marcus Brinkmann <marcus@g10code.de>
1717 * scdaemon.c (main): For now, always print default filename for
1718 --gpgconf-list, and never /dev/null.
1720 2004-04-21 Werner Koch <wk@gnupg.org>
1722 * command.c (scd_update_reader_status_file): Send a signal back to
1724 (option_handler): Parse the new event-signal option.
1726 * scdaemon.c (handle_signal): Do not use SIGUSR{1,2} anymore for
1727 changing the verbosity.
1729 2004-04-20 Werner Koch <wk@gnupg.org>
1731 * command.c (scd_update_reader_status_file): Write status files.
1733 * app-help.c (app_help_read_length_of_cert): Fixed calculation of
1736 * pcsc-wrapper.c: New.
1737 * Makefile.am (pkglib_PROGRAMS): Install it here.
1738 * apdu.c (writen, readn): New.
1739 (open_pcsc_reader, pcsc_send_apdu, close_pcsc_reader): Use the
1740 pcsc-wrapper if we are using Pth.
1741 (apdu_send_le): Reinitialize RESULTLEN. Handle SW_EOF_REACHED
1744 2004-04-19 Werner Koch <wk@gnupg.org>
1746 * ccid-driver.c (parse_ccid_descriptor): Store some of the reader
1747 features away. New arg HANDLE
1748 (read_device_info): New arg HANDLE. Changed caller.
1749 (bulk_in): Handle time extension requests.
1750 (ccid_get_atr): Setup parameters and the IFSD.
1751 (compute_edc): New. Factored out code.
1752 (ccid_transceive): Use default NADs when required.
1754 2004-04-14 Werner Koch <wk@gnupg.org>
1756 * scdaemon.h (server_control_s): Add member READER_SLOT.
1757 * scdaemon.c (scd_init_default_ctrl): Initialize READER_SLOT to -1.
1758 * command.c (open_card): Reuse an open slot.
1759 (reset_notify): Just reset the slot if supported by the reader.
1760 (do_reset): Factored code from above out.
1761 (scd_command_handler): Use it for cleanup.
1763 * apdu.h: New pseudo stati SW_HOST_NOT_SUPPORTED,
1764 SW_HOST_LOCKING_FAILED and SW_HOST_BUSY.
1765 * iso7816.c (map_sw): Map it.
1767 * ccid-driver.c (ccid_slot_status): Add arg STATUSBITS.
1768 * apdu.c (apdu_get_status): New.
1769 (ct_get_status, pcsc_get_status, ocsc_get_status): New stubs.
1770 (get_status_ccid): New.
1772 (reset_ct_reader, reset_pcsc_reader, reset_osc_reader): New stubs.
1773 (reset_ccid_reader): New.
1774 (apdu_enum_reader): New.
1776 * apdu.c (lock_slot, trylock_slot, unlock_slot): New helpers.
1777 (new_reader_slot) [USE_GNU_PTH]: Init mutex.
1778 (apdu_reset, apdu_get_status, apdu_send_le): Run functions
1781 * command.c (scd_update_reader_status_file): New.
1782 * scdaemon.c (handle_tick): Call it.
1784 2004-04-13 Werner Koch <wk@gnupg.org>
1786 * scdaemon.c: Convert to a Pth application.
1787 (handle_signal, ticker_thread, handle_tick): New.
1788 (main): Fire up the ticker thread in server mode.
1790 2004-03-23 Werner Koch <wk@gnupg.org>
1792 * scdaemon.c (main) <gpgconf_list>: Fixed output for pcsc_driver.
1794 2004-03-17 Werner Koch <wk@gnupg.org>
1796 * tlv.c (parse_ber_header): Do not check for tag overflow - it
1797 does not make sense. Simplified the check for length overflow.
1799 * scdaemon.c (main) <gpgconf>: Fixed default value quoting.
1801 2004-03-16 Werner Koch <wk@gnupg.org>
1803 * app-dinsig.c: Implemented. Based on app-nks.c and card-dinsig.c
1804 * app-nks.c (get_length_of_cert): Removed.
1806 (app_help_read_length_of_cert): New. Code taken from above. New
1807 optional arg R_CERTOFF.
1809 * card-dinsig.c: Removed.
1810 * card.c (card_get_serial_and_stamp): Do not bind to the old and
1811 never finsiged card-dinsig.c.
1813 * iso7816.c (iso7816_read_binary): Allow for an NMAX > 254.
1815 2004-03-11 Werner Koch <wk@gnupg.org>
1817 * scdaemon.h (out_of_core): Removed. Replaced callers by standard
1820 * apdu.c, iso7816.c, ccid-driver.c [GNUPG_SCD_MAIN_HEADER]: Allow
1821 to include a header defined by the compiler. This helps us to
1822 reuse the source in other software.
1824 2004-03-10 Werner Koch <wk@gnupg.org>
1826 * iso7816.c (iso7816_read_record): New arg SHORT_EF. Changed all
1829 2004-02-18 Werner Koch <wk@gnupg.org>
1831 * sc-investigate.c (main): Setup the used character set.
1832 * scdaemon.c (main): Ditto.
1834 * scdaemon.c (set_debug): New. Add option --debug-level.
1835 (main): Add option --gpgconf-list.
1837 2004-02-12 Werner Koch <wk@gnupg.org>
1839 * Makefile.am: Include cmacros.am for common flags.
1841 2004-01-29 Werner Koch <wk@gnupg.org>
1843 * command.c (reset_notify): Release the application context and
1846 2004-01-28 Werner Koch <wk@gnupg.org>
1848 * iso7816.c (iso7816_manage_security_env): New.
1849 (iso7816_decipher): Add PADIND argument.
1851 2004-01-27 Werner Koch <wk@gnupg.org>
1853 * command.c (cmd_readcert, cmd_readkey): Work on a copy of LINE.
1855 * app-common.h (app_ctx_s): Added readcert field.
1856 * app.c (app_readcert): New.
1857 * tlv.c (parse_ber_header): Added; taken from libksba.
1859 2004-01-26 Werner Koch <wk@gnupg.org>
1861 * card.c (map_sc_err): Use SCD as the error source.
1863 * command.c (open_card): ADD arg NAME to allow requesting a
1864 specific application. Changed all callers.
1865 (cmd_serialno): Allow optional argument to select the desired
1870 * scdaemon.h (opt): Add READER_PORT.
1871 * scdaemon.c (main): Set it here.
1872 * app.c (app_set_default_reader_port): Removed.
1873 (select_application): Add NAME arg and figure out a
1874 default serial number from the GDO. Add SLOT arg and remove all
1876 (release_application): New.
1877 (app_write_learn_status): Output an APPTYPE status line.
1878 * command.c (open_card): Adapt for select_application change.
1879 * app-openpgp.c (app_select_openpgp): Removed SN and SNLEN args
1880 and set it directly. Changed all callers.
1882 2004-01-25 Werner Koch <wk@gnupg.org>
1884 * iso7816.c (iso7816_select_application): P1 kludge for OpenPGP
1886 * app-openpgp.c (find_tlv): Factor out this function to ..
1887 * tlv.c, tlv.h: .. new.
1889 * scdaemon.h: Introduced app_t and ctrl_t as the new types for APP
1892 2004-01-21 Werner Koch <wk@gnupg.org>
1894 * apdu.c (apdu_send_le): Treat SW_EOF_REACHED as a warning.
1896 2004-01-20 Werner Koch <wk@gnupg.org>
1898 * iso7816.c (iso7816_read_binary): New.
1899 (iso7816_select_file): New.
1900 (iso7816_list_directory): New.
1902 * sc-investigate.c: Add option -i.
1903 (select_app, read_line, interactive_shell): New.
1905 2004-01-16 Werner Koch <wk@gnupg.org>
1907 * apdu.h: Add SW_FILE_NOT_FOUND.
1908 * iso7816.c (map_sw): Map it to GPG_ERR_ENOENT.
1909 * iso7816.c (iso7816_select_file): New.
1911 * app-dinsig.c: New file w/o any real code yet.
1912 * Makefile.am (scdaemon_SOURCES,sc_investigate_SOURCES): Add file.
1914 * sc-investigate.c: Add option --disable-ccid.
1916 2003-12-19 Werner Koch <wk@gnupg.org>
1918 * apdu.c (apdu_send_le): Send a get_response with the indicated
1919 length and not the 64 bytes we used for testing.
1921 * app-openpgp.c (verify_chv2, verify_chv3, do_sign): Check the
1922 minimum length of the passphrase, so that we don't need to
1923 decrement the retry counter.
1925 2003-12-17 Werner Koch <wk@gnupg.org>
1927 * card-p15.c (p15_enum_keypairs): Replaced KRC by RC.
1928 * card-dinsig.c (dinsig_enum_keypairs): Ditto.
1930 2003-12-16 Werner Koch <wk@gnupg.org>
1932 * scdaemon.c (main): Set the prefixes for assuan logging.
1934 2003-11-17 Werner Koch <wk@gnupg.org>
1936 * scdaemon.c, scdaemon.h: New options --allow-admin and --deny-admin.
1937 * app-openpgp.c (verify_chv3): Check it here.
1939 2003-11-12 Werner Koch <wk@gnupg.org>
1941 Adjusted for API changes in Libksba.
1943 2003-10-30 Werner Koch <wk@gnupg.org>
1945 * apdu.c (close_ct_reader, close_pcsc_reader): Implemented.
1946 (get_ccid_error_string): New. Not very useful messages, though.
1948 2003-10-25 Werner Koch <wk@gnupg.org>
1950 * ccid-driver.c (ccid_open_reader): Return an error if no USB
1953 * command.c (cmd_genkey, cmd_passwd): Fixed faulty use of
1956 * apdu.c (apdu_open_reader): Hacks for PC/SC under Windows.
1958 2003-10-20 Werner Koch <wk@gnupg.org>
1960 * command.c (cmd_checkpin): New.
1961 (register_commands): Add command CHECKPIN.
1962 * app.c (app_check_pin): New.
1963 * app-openpgp.c (check_against_given_fingerprint): New. Factored
1964 out that code elsewhere.
1965 (do_check_pin): New.
1967 2003-10-10 Werner Koch <wk@gnupg.org>
1969 * ccid-driver.c (ccid_close_reader): New.
1971 * apdu.c (close_ccid_reader, close_ct_reader, close_csc_reader)
1972 (close_osc_reader, apdu_close_reader): New. Not all are properly
1975 2003-10-09 Werner Koch <wk@gnupg.org>
1977 * ccid-driver.c (ccid_transceive): Add T=1 chaining for sending.
1979 2003-10-08 Werner Koch <wk@gnupg.org>
1981 * app-openpgp.c (do_getattr): Support SERIALNO and AID.
1983 2003-10-01 Werner Koch <wk@gnupg.org>
1985 * ccid-driver.c: Detect GnuPG 1.3 and include appropriate files.
1987 * app-openpgp.c: Ditto.
1989 (generate_keypair): Renamed to ..
1990 (do_generate_keypair): .. this.
1991 * app-common.h [GNUPG_MAJOR_VERSION]: New.
1992 * iso7816.h [GNUPG_MAJOR_VERSION]: Include cardglue.h
1994 2003-09-30 Werner Koch <wk@gnupg.org>
1996 * command.c (cmd_getattr): New command GETATTR.
1997 * app.c (app_setattr): New.
1999 (do_learn_status): Reimplemented in terms of do_getattr.
2001 * app-openpgp.c (do_change_pin): Make sure CVH1 and CHV2 are
2003 (verify_chv2, verify_chv3): New. Factored out common code.
2004 (do_setattr, do_sign, do_auth, do_decipher): Change the names of
2005 the prompts to match that we have only 2 different PINs.
2006 (app_select_openpgp): Check whether the card enforced CHV1.
2007 (convert_sig_counter_value): New. Factor out code from
2010 2003-09-28 Werner Koch <wk@gnupg.org>
2012 * app-openpgp.c (dump_all_do): Use gpg_err_code and not gpg_error.
2014 2003-09-19 Werner Koch <wk@gnupg.org>
2016 * ccid-driver.c (parse_ccid_descriptor): New.
2017 (read_device_info): New.
2018 (ccid_open_reader): Check that the device has all required features.
2020 2003-09-06 Werner Koch <wk@gnupg.org>
2022 * scdaemon.c (main): --pcsc-driver again defaults to pcsclite.
2023 David Corcoran was so kind to remove the GPL incompatible
2024 advertisng clause from pcsclite.
2025 * apdu.c (apdu_open_reader): Actually make pcsc-driver option work.
2027 2003-09-05 Werner Koch <wk@gnupg.org>
2029 * ccid-driver.c: More work, data can now actually be retrieved.
2030 * ccid-driver.c, ccid-driver.h: Alternativley allow use under BSD
2033 2003-09-02 Werner Koch <wk@gnupg.org>
2035 * scdaemon.c, scdaemon.h: New option --pcsc-ccid.
2036 * ccid-driver.c, ccid-driver.h: New but far from being useful.
2037 * Makefile.am: Add above.
2038 * apdu.c: Add support for that ccid driver.
2040 2003-08-26 Timo Schulz <twoaday@freakmail.de>
2042 * apdu.c (new_reader_slot): Only set 'is_osc' when OpenSC
2045 2003-08-25 Werner Koch <wk@gnupg.org>
2047 * command.c (cmd_setattr): Use a copy of LINE.
2048 (cmd_genkey): Use a copy of KEYNO.
2049 (cmd_passwd): Use a copy of CHVNOSTR.
2050 (cmd_pksign, cmd_pkauth, cmd_pkdecrypt): s/strdup/xtrystrdup/.
2052 2003-08-19 Werner Koch <wk@gnupg.org>
2054 * scdaemon.c, scdaemon.h: New option --pcsc-driver.
2055 * apdu.c (apdu_open_reader): Use that option here instead of a
2058 2003-08-18 Werner Koch <wk@gnupg.org>
2060 * Makefile.am: Add OPENSC_LIBS to all programs.
2062 * scdaemon.c, scdaemon.h: New option --disable-opensc.
2063 * card.c (card_open): Implement it.
2064 * apdu.c (open_osc_reader, osc_send_apdu): New.
2065 (apdu_open_reader) [HAVE_OPENSC]: Use the opensc driver if not
2067 (error_string) [HAVE_OPENSC]: Use sc_strerror.
2068 (send_apdu) [HAVE_OPENSC]: Call osc_apdu_send.
2070 * card-p15.c (p15_enum_keypairs, p15_prepare_key): Adjusted for
2073 2003-08-14 Timo Schulz <twoaday@freakmail.de>
2075 * apdu.c (ct_activate_card): Change the code a little to avoid
2076 problems with other readers.
2077 * Always use 'dynload.h' instead of 'dlfcn.h'.
2079 2003-08-05 Werner Koch <wk@gnupg.org>
2081 * app-openpgp.c (dump_all_do): Don't analyze constructed DOs after
2084 2003-08-04 Werner Koch <wk@gnupg.org>
2086 * app.c (app_set_default_reader_port): New.
2087 (select_application): Use it here.
2088 * scdaemon.c (main): and here.
2089 * sc-copykeys.c: --reader-port does now take a string.
2090 * sc-investigate.c, scdaemon.c: Ditto.
2091 * apdu.c (apdu_open_reader): Ditto. Load pcsclite if no ctapi
2092 driver is configured. Always include code for ctapi.
2093 (new_reader_slot): Don't test for already used ports and remove
2095 (open_pcsc_reader, pcsc_send_apdu, pcsc_error_string): New.
2096 (apdu_send_le): Changed RC to long to cope with PC/SC.
2098 * scdaemon.c, scdaemon.h: New option --ctapi-driver.
2099 * sc-investigate.c, sc-copykeys.c: Ditto.
2101 2003-07-31 Werner Koch <wk@gnupg.org>
2103 * Makefile.am (scdaemon_LDADD): Added INTLLIBS.
2105 2003-07-28 Werner Koch <wk@gnupg.org>
2107 * app-openpgp.c (do_setattr): Change implementation. Allow all
2110 2003-07-27 Werner Koch <wk@gnupg.org>
2112 Adjusted for gcry_mpi_print and gcry_mpi_scan API change.
2114 2003-07-24 Werner Koch <wk@gnupg.org>
2116 * app-openpgp.c (do_learn_status): Print more status information.
2117 (app_select_openpgp): Store the card version.
2118 (store_fpr): Add argument card_version and fix DOs for old cards.
2119 (app_openpgp_storekey): Likewise.
2121 2003-07-23 Werner Koch <wk@gnupg.org>
2123 * command.c (cmd_pkauth): New.
2124 (cmd_setdata): Check whether data was given at all to avoid
2125 passing 0 to malloc.
2127 * app.c (app_auth): New.
2128 * app-openpgp.c (do_auth): New.
2130 2003-07-22 Werner Koch <wk@gnupg.org>
2132 * command.c (cmd_passwd): New.
2133 * app.c (app_change_pin): New.
2134 * app-openpgp.c (do_change_pin): New.
2135 * iso7816.c (iso7816_reset_retry_counter): Implemented.
2137 * sc-investigate.c (main): New option --gen-random.
2138 * iso7816.c (iso7816_get_challenge): Don't create APDUs with a
2139 length larger than 255.
2141 2003-07-17 Werner Koch <wk@gnupg.org>
2143 * command.c (cmd_random): New command RANDOM.
2145 * iso7816.c (map_sw): New. Use it in this file to return
2146 meaningful error messages. Changed all public fucntions to return
2148 (iso7816_change_reference_data): New.
2149 * apdu.c (apdu_open_reader): Use faked status words for soem
2152 2003-07-16 Werner Koch <wk@gnupg.org>
2154 * apdu.c (apdu_send_simple): Use apdu_send_le so that we can
2155 specify not to send Le as it should be.
2157 2003-07-15 Werner Koch <wk@gnupg.org>
2159 * Makefile.am: Add sc-copykeys program.
2160 * sc-copykeys.c: New.
2161 * app-openpgp.c (app_openpgp_storekey): New.
2162 (app_openpgp_cardinfo): New.
2164 (store_fpr): And use it here to get the actual length in bit.
2166 2003-07-03 Werner Koch <wk@gnupg.org>
2168 * app-openpgp.c (do_setattr): Add setting of the URL.
2169 (app_select_openpgp): Dump card data only in very verbose mode.
2172 2003-07-02 Werner Koch <wk@gnupg.org>
2174 * app-openpgp.c (get_sig_counter): New.
2175 (do_sign): Print the signature counter and enable the PIN callback.
2176 (do_genkey): Implement the PIN callback.
2178 2003-07-01 Werner Koch <wk@gnupg.org>
2180 * app-openpgp.c (store_fpr): Fixed fingerprint calculation.
2182 2003-06-26 Werner Koch <wk@gnupg.org>
2184 * app-openpgp.c (find_tlv): Fixed length header parsing.
2186 * app.c (app_genkey): New.
2187 * command.c (cmd_genkey): New.
2189 2003-06-25 Werner Koch <wk@gnupg.org>
2191 * command.c (percent_plus_unescape): New.
2194 2003-06-24 Werner Koch <wk@gnupg.org>
2196 * command.c (send_status_info): New.
2198 * app-openpgp.c (app_select_openpgp): Replace SLOT arg by APP arg
2199 and setup the function pointers in APP on success. Changed callers.
2201 * app-common.h: New.
2202 * scdaemon.h (APP): New type to handle applications.
2203 (server_control_s): Add an APP context field.
2205 * command.c (cmd_serialno): Handle applications.
2206 (cmd_pksign): Ditto.
2207 (cmd_pkdecrypt): Ditto.
2208 (reset_notify): Ditto.
2209 (cmd_learn): For now return error for application contexts.
2210 (cmd_readcert): Ditto.
2211 (cmd_readkey): Ditto.
2213 2003-06-04 Werner Koch <wk@gnupg.org>
2215 * card.c (map_sc_err): Renamed gpg_make_err to gpg_err_make.
2217 Renamed error codes from INVALID to INV and removed _ERROR suffixes.
2219 2003-06-03 Werner Koch <wk@gnupg.org>
2221 Changed all error codes in all files to the new libgpg-error scheme.
2223 * scdaemon.h: Include gpg-error.h and errno.h
2224 * card.c (map_sc_err): Use unknown for the error source.
2225 * Makefile.am: Link with libgpg-error
2227 2003-05-14 Werner Koch <wk@gnupg.org>
2229 * atr.c, atr.h: New.
2230 * sc-investigate.c: Dump the ATR in a human readable format.
2232 2003-05-08 Werner Koch <wk@gnupg.org>
2234 * scdaemon.h (DBG_CARD_IO_VALUE): New.
2236 * sc-investigate.c: New.
2237 * scdaemon.c (main): Removed --print-atr option.
2239 * iso7816.c, iso7816.h, app-openpgp.c: New.
2241 2003-04-29 Werner Koch <wk@gnupg.org>
2243 * scdaemon.c: New options --print-atr and --reader-port
2244 * apdu.c, apdu.h: New
2246 * card.c, card-p15.c, card-dinsig.c: Allow build without OpenSC.
2248 * Makefile.am (LDFLAGS): Removed.
2250 * command.c (register_commands): Adjusted for new Assuan semantics.
2252 2002-08-21 Werner Koch <wk@gnupg.org>
2254 * scdaemon.c (main): New option --daemon so that the program is
2255 not accidently started in the background.
2257 2002-08-16 Werner Koch <wk@gnupg.org>
2259 * scdaemon.c: Include i18n.h.
2261 * card-common.h (struct p15_private_s): Forward declaration. Add
2263 * card.c (card_close): Make sure private data is released.
2264 (card_enum_certs): New.
2265 * card-p15.c (p15_release_private_data): New.
2266 (init_private_data): New to work around an OpenSC weirdness.
2267 (p15_enum_keypairs): Do an OpenSC get_objects only once.
2268 (p15_enum_certs): New.
2269 (card_p15_bind): Bind new function.
2270 * command.c (cmd_learn): Return information about the certificates.
2272 2002-08-09 Werner Koch <wk@gnupg.org>
2274 * card.c (card_get_serial_and_stamp): Use the tokeinfo serial
2275 number as a fallback. Add a special prefix for serial numbers.
2277 2002-07-30 Werner Koch <wk@gnupg.org>
2279 Changes to cope with OpenSC 0.7.0:
2281 * card.c: Removed the check for the packed opensc version.
2282 Changed include file names of opensc.
2283 (map_sc_err): Adjusted error codes for new opensc version.
2284 * card-p15.c: Changed include filename of opensc.
2285 * card-dinsig.c: Ditto.
2287 * card-p15.c (p15_decipher): Add flags argument to OpenSC call.
2289 2002-07-24 Werner Koch <wk@gnupg.org>
2291 * card.c (find_simple_tlv, find_iccsn): New.
2292 (card_get_serial_and_stamp): Improved serial number parser.
2294 2002-06-27 Werner Koch <wk@gnupg.org>
2296 * scdaemon.c (main): Use GNUPG_DEFAULT_HOMEDIR constant.
2298 2002-06-15 Werner Koch <wk@gnupg.org>
2300 * card-dinsig.c: Documented some stuff from the DIN norm.
2302 2002-04-15 Werner Koch <wk@gnupg.org>
2304 * command.c (cmd_pksign, cmd_pkdecrypt): Use a copy of the key ID.
2306 2002-04-12 Werner Koch <wk@gnupg.org>
2308 * scdaemon.c: New option --debug-sc N.
2309 * card.c (card_open): set it here.
2311 * card-p15.c (p15_prepare_key): Factored out common code from ...
2312 (p15_sign, p15_decipher): here and made the decryption work the
2315 2002-04-10 Werner Koch <wk@gnupg.org>
2317 * card.c (card_open): Return immediately when no reader is available.
2319 2002-03-27 Werner Koch <wk@gnupg.org>
2321 * card.c (card_open, card_close): Adjusted for changes in OpenSC.
2323 2002-03-10 Werner Koch <wk@gnupg.org>
2325 * card-p15.c, card-dinsig.c, card-common.h: New.
2326 * card.c: Factored most code out to the new modules, so that we
2327 can better support different types of card applications.
2329 2002-01-26 Werner Koch <wk@gnupg.org>
2331 * scdaemon.c scdaemon.h, command.c: New. Based on the code from
2335 Copyright 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
2337 This file is free software; as a special exception the author gives
2338 unlimited permission to copy and/or distribute it, with or without
2339 modifications, as long as this notice is preserved.
2341 This file is distributed in the hope that it will be useful, but
2342 WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
2343 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.