1 2009-10-16 Marcus Brinkmann <marcus@g10code.com>
3 * AM_CFLAGS, scdaemon_LDADD: Use libassuan instead of libassuan-pth.
4 * scdaemon.c: Invoke ASSUAN_SYSTEM_PTH_IMPL.
5 (main): Call assuan_set_system_hooks and assuan_sock_init.
7 2009-09-23 Marcus Brinkmann <marcus@g10code.de>
9 * command.c: Include "scdaemon.h" before <assuan.h> because of
10 GPG_ERR_SOURCE_DEFAULT check.
11 (option_handler, open_card, cmd_serialno, cmd_lean, cmd_readcert)
12 (cmd_readkey, cmd_setdata, cmd_pksign, cmd_pkauth, cmd_pkdecrypt)
13 (cmd_getattr, cmd_setattr, cmd_writecert, cmd_writekey)
14 (cmd_genkey, cmd_random, cmd_passwd, cmd_checkpin, cmd_lock)
15 (cmd_unlock, cmd_getinfo, cmd_restart, cmd_disconnect, cmd_apdu)
16 (cmd_killscd): Return gpg_error_t instead of int.
17 (scd_command_handler): Allocate assuan context before starting server.
18 * scdaemon.c (main): Update to new Assuan API.
20 2009-09-03 Werner Koch <wk@g10code.com>
22 * app-openpgp.c (do_decipher): Compute required Le.
23 * iso7816.c (iso7816_decipher): Add new arg LE.
24 * app-nks.c (do_decipher): Adjust for change.
26 * iso7816.c (iso7816_put_data, iso7816_put_data_odd): Turn DATA
29 2009-08-05 Werner Koch <wk@g10code.com>
31 * app-openpgp.c (change_keyattr_from_string): New.
32 (do_setattr): Support KEY-ATTR.
34 2009-07-29 Marcus Brinkmann <marcus@g10code.com>
36 * ccid-driver.c (print_pr_data): Fix 64 bit compat problem.
38 2009-07-24 Werner Koch <wk@g10code.com>
40 * ccid-driver.c (parse_ccid_descriptor): Enable hack for SCR 3320.
42 2009-07-21 Werner Koch <wk@g10code.com>
44 * ccid-driver.c [HAVE_PTH]: Include pth.h.
46 (bulk_in): s/gnupg_sleep/my_sleep/.
48 2009-07-20 Werner Koch <wk@g10code.com>
50 * apdu.c [GNUPG_MAJOR_VERSION==1]: Include dynload.h.
52 2009-07-16 Werner Koch <wk@g10code.com>
54 * command.c (update_reader_status_file): Test for unplugged reader.
55 (TEST_CARD_REMOVAL): Ditto.
56 * app.c (select_application): Ditto.
57 * ccid-driver.c (bulk_out): Return CCID_DRIVER_ERR_NO_READER if a
59 (struct ccid_driver_s): Turn nonnull_nad into an unsigned char.
60 Turn apdu_level, auto_ifsd, powered_off, has_pinpad into
61 bitfields. Add enodev_seen.
62 * apdu.c (apdu_prepare_exit): New.
63 (get_status_ccid): Return the status word and nut just -1.
64 * scdaemon.c (scd_exit): Call it.
66 2009-07-13 Werner Koch <wk@g10code.com>
68 * ccid-driver.c (struct ccid_driver_s): Add fields last_progress,
69 progress_cb and progress_cb_arg.
70 (ccid_set_progress_cb): New.
71 (print_progress): New.
72 (ccid_transceive): Call print_progress for wait time extensions.
73 * apdu.c (struct reader_table_s): Add field set_progress_cb.
74 (new_reader_slot): Clear that field.
75 (open_ccid_reader): Set it to ..
76 (set_progress_cb_ccid_reader): ... new fucntion.
77 * app.c (print_progress_line): New.
78 (lock_reader): Add arg CTRL to set a progress callback and
79 change all callers to provide it.
80 (unlock_reader): Remove the progress callback.
82 2009-07-10 Werner Koch <wk@g10code.com>
84 * iso7816.c (iso7816_compute_ds): Add args EXTENDED_MODE and LE.
85 Change all callers to use 0.
86 (iso7816_internal_authenticate): Add args EXTENDED_MODE and LE.
87 * app-openpgp.c (do_sign): Take exmode and Le from card
88 capabilities and pass them to iso7816_compute_ds.
89 (do_auth): Ditto for iso7816_internal_authenticate.
90 (change_keyattr): Reset CHV verification status.
92 2009-07-09 Werner Koch <wk@g10code.com>
94 * app-openpgp.c (change_keyattr): New.
95 (do_writekey): Call it.
97 * app-openpgp.c (does_key_exist): Add arg GENERATING. Change
100 2009-06-30 Werner Koch <wk@g10code.com>
102 * ccid-driver.c (ccid_transceive): Set RESYNCING flag.
104 2009-06-29 Werner Koch <wk@g10code.com>
106 * ccid-driver.c (ccid_transceive): Add a hack to support extended
107 length for Omnikey readers.
108 (is_exlen_apdu): New.
109 (parse_ccid_descriptor): Track short+extended apdu exchange level.
111 2009-06-18 Werner Koch <wk@g10code.com>
113 * app-openpgp.c (verify_chv2): Remove special case for v2 cards.
114 (get_public_key): Use extended mode.
116 2009-06-17 Werner Koch <wk@g10code.com>
118 * iso7816.c (iso7816_get_data): Add arg EXTENDED_MODE. Change all
120 * app-openpgp.c (data_objects): Use bit flags. Add flag
122 (get_cached_data): Add arg TRY_EXTLEN and use it for iso7816_get_data.
123 (get_one_do): Use extended length APDU if necessary.
125 2009-06-10 Werner Koch <wk@g10code.com>
127 * app-openpgp.c (store_fpr): Change first arg to app_t; adjust
128 callers. Flush the cache.
130 2009-06-09 Werner Koch <wk@g10code.com>
132 * app-openpgp.c (do_readcert): Return NOT_FOUND if the retrieved
133 data has a length of zero.
134 (do_getattr): Add EXTCAP subkey "sm".
136 2009-05-20 Werner Koch <wk@g10code.com>
138 * app-openpgp.c (verify_chv2): Add case for v2 cards.
139 (verify_chv3): Factor some code out to ..
140 (build_enter_admin_pin_prompt): .. new.
141 (do_change_pin): Properly handle v2 cards.
143 2009-05-19 Werner Koch <wk@g10code.com>
145 * scdaemon.c (create_server_socket): Use SUN_LEN.
146 (JNLIB_NEED_AFLOCAL): Define.
148 2009-05-13 Werner Koch <wk@g10code.com>
150 * ccid-driver.c (abort_cmd): Add arg SEQNO and change callers.
151 (bulk_in): Retry on seqno mismatch.
153 * apdu.c (send_le): Release result_buffer.
154 (apdu_send_direct): Implemend extended length.
155 * command.c (cmd_apdu): Add option "--exlen".
157 2009-05-11 Werner Koch <wk@g10code.com>
159 * apdu.c (send_le): Replace log_error by log_info.
161 2009-05-08 Werner Koch <wk@g10code.com>
163 * app-openpgp.c (do_genkey): Allow larger key sizes.
164 (do_decipher): Ditto.
165 * iso7816.c (do_generate_keypair): Add arg EXTENDED_MODE an LE.
166 (iso7816_generate_keypair, iso7816_read_public_key): Ditto.
168 * apdu.c (send_le): Implement extended length return values.
170 * ccid-driver.c (bulk_in): Retry on EAGAIN.
171 (abort_cmd): Change seqno handling.
173 2009-04-28 Werner Koch <wk@g10code.com>
175 * app-help.c (app_help_count_bits): New.
177 * app-nks.c (switch_application): Detect mass signature cards.
178 Take care of new NEED_APP_SELECT flag.
179 (do_sign): Don't allow mass signature cards.
182 (app_select_nks): Register do_readkey.
184 2009-04-01 Werner Koch <wk@g10code.com>
186 * app-openpgp.c (do_setattr, do_writekey): Prepare for extended
189 2009-03-31 Werner Koch <wk@g10code.com>
191 * command.c (percent_plus_unescape): Remove.
192 (cmd_setattr): Use percent_plus_unescape_inplace.
194 2009-03-30 Werner Koch <wk@g10code.com>
196 * app-nks.c (do_decipher): Make it work for TCOS 3.
197 * iso7816.c (iso7816_decipher): Add arg EXTENDED_MODE.
198 * apdu.c (apdu_send): Add arg EXTENDED_MODE and change all callers.
199 (apdu_send_le): Ditto.
200 (apdu_send_direct): Ditto, but not yet functional.
201 (send_le): Fix command chaining. Implement extended length option.
202 * ccid-driver.c (ccid_transceive): Remove restriction on apdu length.
203 (struct ccid_driver_s): Add field IFSC.
204 (ccid_get_atr): Set IFSC.
205 (ccid_transceive): Use negotiated IFSC and support S(IFS) command.
207 2009-03-26 Werner Koch <wk@g10code.com>
209 * command.c (cmd_pksign): Allow more hash algorithms.
211 * scdaemon.h (MAX_DIGEST_LEN): Change to 64.
213 * apdu.c (open_ccid_reader): Clear the is_to flag.
215 * app-nks.c (filelist): Add field KID.
216 (do_getattr): Change standard authentication key.
217 (do_sign): Setup a security environment for TCOS 3 cards and support
218 all SHA-2 algorithms.
220 2009-03-24 Werner Koch <wk@g10code.com>
222 * command.c (struct server_local_s): Add flag
223 APP_CTX_MARKED_FOR_RELEASE.
224 (do_reset): Set the flag.
225 (open_card): Act on this flag.
226 * app-common.h (struct app_ctx_s): Add flag NO_REUSE.
227 (application_notify_card_reset): Set the flag.
228 * app.c (select_application, release_application): Take care of
231 2009-03-20 Werner Koch <wk@g10code.com>
233 * app-nks.c (keygripstr_from_pk_file): Fix for TCOS 3 cards.
235 2009-03-18 Werner Koch <wk@g10code.com>
237 * apdu.c (open_pcsc_reader_wrapped): Use close_all_fds.
239 * command.c (cmd_learn): Add option --keypairinfo.
240 * app.c (app_write_learn_status): Add arg FLAGS.
241 * app-common.h (struct app_ctx_s): Add arg FLAGS to LEARN_STATUS.
242 Change all implementors.
243 * app-p15.c (do_learn_status): Take care of flag bit 0.
244 * app-nks.c (do_learn_status, do_learn_status_core): Ditto.
246 2009-03-10 Werner Koch <wk@g10code.com>
248 * app-openpgp.c (send_key_attr): New.
249 (do_getattr): New attribute KEY_ATTR.
250 * command.c (send_status_direct): New.
252 2009-03-06 Werner Koch <wk@g10code.com>
254 * app-nks.c (do_learn_status): Factor code out to..
255 (do_learn_status_core): .. new.
256 (do_readcert, do_sign, do_decipher): Switch to SigG if needed.
257 (verify_pin): Use DESC also for keypad based verify.
259 2009-03-05 Werner Koch <wk@g10code.com>
261 * app-openpgp.c (verify_a_chv): Remove special case for keypads.
262 (verify_chv3): Ditto.
264 * app-nks.c (get_chv_status): New.
265 (parse_pwidstr): New.
266 (verify_pin): Add args PWID and DESC and use them. Remove the
268 (do_change_pin): Allow PIN selection and add reset mode.
269 (do_learn_status): Use NKS-NKS3 tag for TCOS 3 cards.
270 (do_readcert, do_sign): Allow NKS-NKS3 tag.
272 2009-03-04 Werner Koch <wk@g10code.com>
274 * app-nks.c (do_getattr): New.
275 (app_select_nks): Register it.
276 (verify_pin): Factor some code out to...
277 (basic_pin_checks): New.
278 (do_change_pin): Call the basic check.
279 (app_select_nks): Move AID to ..
282 (switch_application): New.
283 (do_getattr, do_learn_status, do_readcert, do_sign, do_decipher)
284 (do_change_pin, do_check_pin): Make sure we are in NKS mode.
286 2009-03-03 Werner Koch <wk@g10code.com>
288 * command.c (scd_command_handler): Remove dereference of STOPME
291 2009-02-27 Werner Koch <wk@g10code.com>
293 * app.c (get_supported_applications): New.
294 * command.c (cmd_getinfo): New subcommand "app_list"
296 (register_commands): Register command KILLSCD.
297 (struct server_local_s): Add field STOPME.
298 (scd_command_handler): Act upon this.
300 2009-02-25 Werner Koch <wk@g10code.com>
302 * apdu.c (apdu_get_status): Factor all code out to ...
303 (apdu_private_get_status): .. new. Add arg NO_ATR_RESET.
304 (apdu_connect): Call new function.
306 * scdaemon.c: New option --debug-log-tid.
307 (tid_log_callback): New.
308 (main): Move debug-wait code after debug stream init.
310 2009-02-24 Werner Koch <wk@g10code.com>
312 * ccid-driver.c (ccid_get_atr): Move debug output to ..
313 (print_r2p_parameters): .. new.
314 (print_r2p_header, print_pr_data, print_r2p_unknown)
315 (print_r2p_datablock, print_r2p_slotstatus, print_r2p_escape)
316 (print_r2p_datarate): New.
317 (bulk_in): Call parameter printing.
318 (ccid_set_debug_level): Add debug level 3.
319 (convert_le_u16): New.
320 (print_p2r_header, print_p2r_iccpoweron, print_p2r_iccpoweroff)
321 (print_p2r_getslotstatus, print_p2r_xfrblock)
322 (print_p2r_getparameters, print_p2r_resetparameters)
323 (print_p2r_setparameters, print_p2r_escape, print_p2r_iccclock)
324 (print_p2r_to0apdu, print_p2r_secure, print_p2r_mechanical)
325 (print_p2r_abort, print_p2r_setdatarate, print_r2p_unknown): New.
326 (bulk_out): Add arg NO_DEBUG and change all callers to pass 0.
327 Call parameter printing.
328 (ccid_slot_status): Call with NO_DEBUG set.
329 (abort_cmd, send_escape_cmd, ccid_get_atr, ccid_get_atr)
330 (ccid_transceive_apdu_level, ccid_transceive)
331 (ccid_transceive_secure): Remove old debug print code.
333 2009-02-12 Werner Koch <wk@g10code.com>
335 * command.c (cmd_getinfo): Add new subcommand "deny_admin".
337 2009-01-28 Werner Koch <wk@g10code.com>
339 * scdaemon.c (main): Make --allow-admin the default and make the
342 2009-01-27 Werner Koch <wk@g10code.com>
344 * app-geldkarte.c: Changed to use an AID.
346 * app.c (app_munge_serialno): Add case for no serialno.
347 (app_get_serial_and_stamp): Ditto.
349 2009-01-26 Werner Koch <wk@g10code.com>
351 * app-geldkarte.c: New.
352 * Makefile.am (card_apps): Add new file.
353 * app.c (select_application): Test for geldkarte.
355 2009-01-12 Werner Koch <wk@g10code.com>
357 * command.c (send_client_notifications) [HAVE_W32_SYSTEM]: Fix
360 2009-01-08 Werner Koch <wk@g10code.com>
362 * iso7816.c (iso7816_read_record, iso7816_read_binary): Pass 0 for
363 L_e because the problem with the CCID driver has gone.
364 (iso7816_apdu_direct): New.
366 * app-nks.c (filelist): Add NKS_VER field. Add NKS 3 specific
368 (app_local_s, do_deinit): New.
369 (get_nks_version): New.
370 (app_select_nks): Setup local data.
371 (keygripstr_from_pk_file): Replace SLOT by APP and take care of
373 (do_learn_status): Take care of NKS version.
375 2009-01-05 Werner Koch <wk@g10code.com>
377 * apdu.c (apdu_get_status): Save the last status.
379 2008-12-18 Werner Koch <wk@g10code.com>
381 * ccid-driver.c (abort_cmd): New.
382 (bulk_in): Call abort_cmd after severe errors.
384 * apdu.c (reader_table_s): Add field ANY_STATUS.
385 (new_reader_slot): Clear it.
386 (apdu_get_status): Use ANY_STATUS to update the change counter.
387 Remove the use of the flag bit from LAST_STATUS everywhere.
388 * command.c (update_reader_status_file): Factor code out to ...
389 (send_client_notifications): New. Track signals already sent.
390 (update_reader_status_file): Shutdown the reader after a failed
393 2008-12-09 Werner Koch <wk@g10code.com>
395 * scdaemon.c (main): Call i18n_init before init_common_subsystems.
397 2008-12-08 Werner Koch <wk@g10code.com>
399 * scdaemon.c (handle_connections): Sync ticker to the next full
401 (TIMERTICK_INTERVAL_USEC): Change to 500ms.
403 2008-12-05 Werner Koch <wk@g10code.com>
405 * app-openpgp.c (app_local_s): Add field ALGO_ATTR_CHANGE.
406 (app_select_openpgp): Parse new capability.
407 (show_caps): Show new capability.
409 2008-12-03 Werner Koch <wk@g10code.com>
411 * scdaemon.c (opts): Use ARGPARSE_ macros. Add option
413 * command.c (update_reader_status_file): Implement it.
415 2008-11-18 Werner Koch <wk@g10code.com>
417 * scdaemon.c (make_libversion): New.
418 (my_strusage): Print libgcrypt and libksba version.
420 2008-11-03 Werner Koch <wk@g10code.com>
422 * command.c (server_local_s): Add field DISCONNECT_ALLOWED.
423 (cmd_disconnect): Implement command.
424 (open_card): Reset disconnect flag.
425 (update_reader_status_file): Disconnect if allowed.
427 * app-common.h (app_ctx_s): Remove INITIALIZED. Make REF_COUNT
429 * app.c (select_application): Remove INITIALIZED.
430 (app_write_learn_status, app_readcert, app_readkey, app_getattr)
431 (app_setattr, app_sign, app_decipher, app_writecert)
432 (app_writekey, app_get_challenge, app_change_pin, app_check_pin):
433 Replace INITIALIZED by REF_COUNT check.
434 (application_notify_card_removed): Rename to ..
435 (application_notify_card_reset): .. this. Change all callers.
436 * command.c (do_reset): Call application_notify_card_reset after
438 (update_reader_status_file): Add arg SET_CARD_REMOVED.
439 (scd_update_reader_status_file): Pass true for new flag.
440 (do_reset): Pass false for new flag.
442 * app.c (app_get_serial_and_stamp): Use bin2hex.
443 * app-help.c (app_help_get_keygrip_string): Ditto.
444 * app-p15.c (send_certinfo, send_keypairinfo, do_getattr): Ditto.
445 * app-openpgp.c (send_fpr_if_not_null, send_key_data)
446 (retrieve_fpr_from_card, send_keypair_info): Ditto.
447 * app-nks.c (keygripstr_from_pk_file): Ditto.
448 * command.c (cmd_apdu): Ditto.
450 2008-10-21 Marcus Brinkmann <marcus@g10code.com>
452 * command.c (open_card): If connect error is SW_HOST_NO_CARD,
453 return a more descriptive error.
455 2008-10-20 Werner Koch <wk@g10code.com>
457 * pcsc-wrapper.c (read_32): Use provided arg and not stdin. Is
458 called with stdin, though.
459 (handle_close): Mark unused arg.
460 (handle_status, handle_reset): Ditto.
462 * ccid-driver.c (ccid_check_card_presence): Mark not yet used arg.
464 * scdaemon.c (scd_deinit_default_ctrl): Mark unused arg.
465 * command.c (cmd_unlock, cmd_restart, cmd_disconnect): Ditto.
466 * apdu.c (ct_get_status): Ditto.
467 (ct_send_apdu, pcsc_send_apdu_wrapped)
468 (apdu_open_remote_reader): Ditto.
469 * app.c (select_application): Ditto.
470 * app-openpgp.c (do_writecert, do_change_pin, do_writekey): Ditto.
471 * app-nks.c (do_change_pin, do_check_pin): Ditto.
473 2008-10-16 Werner Koch <wk@g10code.com>
475 * command.c (cmd_disconnect): New dummy command.
476 (register_commands): Register command.
478 2008-10-15 Werner Koch <wk@g10code.com>
480 * command.c (scd_command_handler): Return true if there is no more
482 * scdaemon.c (start_connection_thread): Set shutdown flag if
483 requested by command handler.
484 (main): Make PIPE_SERVER module global.
485 (handle_connections): Disable listen_fd if a shutdown is pending.
487 2008-10-14 Werner Koch <wk@g10code.com>
489 * apdu.c (reader_table_s): Add fields connect_card and
491 (new_reader_slot): Set them to NULL.
492 (apdu_connect, apdu_disconnect): New.
493 (apdu_close_reader, apdu_shutdown_reader): Call apdu_disconnect.
494 (connect_pcsc_card, disconnect_pcsc_card): new.
495 (reset_pcsc_reader_direct): Implement in terms of
496 disconnect_pcsc_card and connect_pcsc_card.
497 (apdu_get_atr): Return NULL if there is no ATR.
498 * sc-copykeys.c (main): Add call to apdu_connect.
499 * command.c (open_card): Ditto.
501 * apdu.h (SW_HOST_ALREADY_CONNECTED): New.
502 (APDU_CARD_USABLE, APDU_CARD_PRESENT, APDU_CARD_ACTIVE): New.
503 * apdu.c: Replace constants by the new macros.
504 (open_pcsc_reader): Factor code out to ...
505 (open_pcsc_reader_direct, open_pcsc_reader_wrapped): New.
506 (reset_pcsc_reader): Factor code out to ...
507 (reset_pcsc_reader_direct, reset_pcsc_reader_wrapped): New.
508 (pcsc_get_status): Factor code out to ...
509 (pcsc_get_status_direct, pcsc_get_status_wrapped): New.
510 (pcsc_send_apdu): Factor code out to ...
511 (pcsc_send_apdu_direct, pcsc_send_apdu_wrapped): New.
512 (close_pcsc_reader): Factor code out to ...
513 (close_pcsc_reader_direct, close_pcsc_reader_wrapped): New.
515 * command.c (update_reader_status_file): Open the reader if not
518 * scdaemon.c (TIMERTICK_INTERVAL_SEC, TIMERTICK_INTERVAL_USEC):
519 New to replace TIMERTICK_INTERVAL. Chnage from 2s (4 under W32)
522 2008-10-13 Werner Koch <wk@g10code.com>
524 * command.c (option_handler) [W32]: Use strtoul with base 16.
525 (update_reader_status_file) [W32]: Set Event.
526 (scd_command_handler): Use INT2FD to silent warning.
528 2008-09-29 Werner Koch <wk@g10code.com>
530 * scdaemon.h (GCRY_MD_USER): Rename to GCRY_MODULE_ID_USER.
531 (GCRY_MD_USER_TLS_MD5SHA1): Rename to MD_USER_TLS_MD5SHA1 and
534 2008-09-28 Marcus Brinkmann <marcus@g10code.com>
536 * apdu.c (pcsc_get_status): Fix last change.
538 2008-09-25 Werner Koch <wk@g10code.com>
540 * app-openpgp.c (do_setattr): Do not allow setting of the reset
542 (do_change_pin): Allow setting of the reset code.
544 2008-09-24 Werner Koch <wk@g10code.com>
546 * app-openpgp.c (verify_chv3): Set the did_chv3 flag which was
547 accidently removed on 2008-03-26.
548 (verify_chv2): Revert last change.
549 (do_change_pin): Do not change CHV2. Add reset code logic for v2
551 * iso7816.c (iso7816_reset_retry_counter_with_rc): New.
553 * app-openpgp.c (add_tlv, build_privkey_template): New.
554 (do_writekey): Support v2 keys and other key lengths than 1024.
555 * iso7816.c (iso7816_put_data_odd): New.
557 2008-09-23 Werner Koch <wk@g10code.com>
559 * app-openpgp.c (do_sign): Support SHA-2 digests.
560 (verify_chv2): No CHV auto-sync for v2 cards.
561 (do_auth): Allow 2048 bit keys.
562 (parse_algorithm_attribute): New.
563 (rsa_key_format_t): New.
564 (struct app_local_s): Add struct KEYATTR.
566 2008-09-23 Marcus Brinkmann <marcus@g10code.com>
568 * apdu.c (pcsc_get_status): Be more relaxed with the usable flag
571 2008-09-23 Werner Koch <wk@g10code.com>
573 * app-openpgp.c (do_setattr): Use command chaining for long
575 * iso7816.c (iso7816_put_data): Add arg EXTENDED_MODE. Change all
577 * apdu.c (apdu_send_simple): Add arg EXTENDED_MODE. Change all
579 (send_le): Implement command chaining.
580 * ccid-driver.c (ccid_transceive_apdu_level): Increase allowed
582 (ccid_transceive): Alow for APDUS of up to 259 bytes.
583 * apdu.h: Add new SW_ codes.
585 2008-09-16 Werner Koch <wk@g10code.com>
587 * command.c (cmd_writecert): New.
588 (register_commands): Register it.
589 * app-common.h (app_ctx_s): Add member WRITECERT.
590 * app.c (app_writecert): New.
591 * app-openpgp.c (do_writecert): New.
592 (parse_historical): New.
594 (dump_all_do): Print only the length of longs DOs.
595 * command.c (cmd_writekey, cmd_apdu, cmd_pksign)
596 (cmd_passwd): Replace open coding by skip_options.
598 2008-08-30 Moritz <moritz@gnu.org>
600 * scdaemon.c (main): Use estream_asprintf instead of asprintf.
601 * command.c (update_reader_status_file): Likewise.
602 (cmd_serialno): Use estream_asprintf instead of asprintf
603 and xfree instead of free to release memory allocated
604 through (estream_)asprintf.
605 (cmd_learn): Likewise.
607 * app-openpgp.c (get_public_key): Likewise.
609 2008-08-18 Werner Koch <wk@g10code.com>
611 * app-openpgp.c (do_setattr): Fix test for v2 cards.
613 2008-08-11 Werner Koch <wk@g10code.com>
615 * apdu.c (reset_pcsc_reader, open_pcsc_reader)
616 (reset_rapdu_reader, open_rapdu_reader): Allow ATRs of up to 33
617 bytes. Provide maximum size of ATR buffer using DIM. Such long
618 ATR are never seen in reality but the PC/SC library of MAC OS X is
619 just too buggy. Reported by Ludovic Rousseau. Fixes bug #948.
621 2008-07-30 Werner Koch <wk@g10code.com>
623 * app-openpgp.c (verify_a_chv): Use xtrymalloc and make the prompt
624 for CHV2 more user friendly.
626 2008-07-03 Werner Koch <wk@g10code.com>
628 * app-openpgp.c (do_readcert): New.
629 (app_local_s): Add fields IS_V2 and MAX_CERTLEN_3.
630 (app_select_openpgp): Set them and register do_readcert.
631 (do_setattr): Allow storing of the certificate.
633 2008-06-25 Werner Koch <wk@g10code.com>
635 * app-dinsig.c (do_sign): Allow for SHA256.
637 2008-06-24 Werner Koch <wk@g10code.com>
639 * app-common.h (app_ctx_s): Renamed reset_mode parameter of
640 change_pin to mode_Flags and make it an unsigned int.
641 (APP_CHANGE_FLAG_RESET, APP_CHANGE_FLAG_NULLPIN): New.
642 * app-openpgp.c (do_change_pin): Adjust for that.
644 * command.c (cmd_passwd): Add option --nullpin.
645 * app-nks.c (do_check_pin, do_change_pin): New.
646 (app_select_nks): Register new functions.
648 2008-04-21 Moritz Schulte <mo@g10code.com> (wk)
650 * app-openpgp.c (verify_a_chv): Make use of the default CHV flag.
652 2008-03-26 Werner Koch <wk@g10code.com>
654 * app-openpgp.c (verify_chv3): Support the keypad.
656 2008-02-09 Marcus Brinkmann <marcus@g10code.de>
658 * scdaemon.c (main): Use CONFIG_FILENAME as filename if it is set
659 in gpgconf-list output.
661 2007-12-10 Werner Koch <wk@g10code.com>
663 * app-openpgp.c (do_decipher): Take care of cryptograms shorter
664 that 128 bytes. Fixes bug#851.
666 2007-11-14 Werner Koch <wk@g10code.com>
668 * scdaemon.c (main): Pass STANDARD_SOCKET flag to
669 create_server_socket.
671 2007-11-13 Werner Koch <wk@g10code.com>
673 * scdaemon.c (start_connection_thread): Do not call
674 assuan_sock_check_nonce if we are running in --server mode.
676 2007-11-07 Werner Koch <wk@g10code.com>
678 * scdaemon.h: Remove errors.h.
680 2007-10-02 Werner Koch <wk@g10code.com>
682 * command.c (cmd_getinfo): Add "pid" subcommand.
684 2007-10-01 Werner Koch <wk@g10code.com>
686 * scdaemon.c (create_server_socket): Use Assuan socket wrappers
687 and remove Windows specific code.
689 (start_connection_thread): Check nonce.
691 2007-09-14 Marcus Brinkmann <marcus@g10code.de>
693 * scdaemon.c (main): New variable STANDARD_SOCKET, which is 1 for
694 W32 targets. Use it for create_socket_name.
696 2007-08-07 Werner Koch <wk@g10code.com>
698 * tlv.c, tlv.h: Move to ../common/.
700 2007-08-02 Werner Koch <wk@g10code.com>
702 * scdaemon.c: Include gc-opt-flags.h and remove their definition
705 2007-08-01 Werner Koch <wk@g10code.com>
707 * apdu.c (send_le): Implement exact length hack. Suggested by
710 2007-07-05 Werner Koch <wk@g10code.com>
712 * command.c (has_option_name, skip_options): New.
713 (cmd_genkey): Add option --timestamp.
714 (cmd_writekey): Enter confidential mode while inquiring the key data.
716 * app.c (app_genkey): Add arg CREATETIME.
717 * app-common.h (app_ctx_s): Likewise
718 * app-openpgp.c (do_genkey): Ditto. Use it.
721 2007-07-04 Werner Koch <wk@g10code.com>
723 * command.c (cmd_getinfo): New subcommand "version".
725 * scdaemon.c (TIMERTICK_INTERVAL): New.
726 (handle_connections) [W32]: Enable a dummy sigs event.
727 (handle_connections): Use a proper count for select and not
729 (fixed_gcry_pth_init, main): Kludge to fix pth initialization.
731 2007-06-21 Werner Koch <wk@g10code.com>
733 * scdaemon.h (ctrl_t): Remove. It is now declared in ../common/util.h.
735 2007-06-18 Marcus Brinkmann <marcus@g10code.de>
737 * scdaemon.c (main): Percent escape output of --gpgconf-list.
739 2007-06-12 Werner Koch <wk@g10code.com>
741 * scdaemon.c (main): Replace some calls by init_common_subsystems.
743 2007-06-11 Werner Koch <wk@g10code.com>
745 * Makefile.am (scdaemon_LDADD): Use libcommonpth macro.
747 * command.c (initialize_module_command): New.
748 * scdaemon.c (main) [W32]: Do not use sigpipe code.
749 (main): Call initialize_module_command.
751 2007-06-06 Werner Koch <wk@g10code.com>
753 * app-openpgp.c (do_sign): Fix arithmetic on void*.
755 * app.c (dump_mutex_state) [W32]: Handle the W32Pth case.
757 * apdu.c: Remove dynload.h.
759 * scdaemon.c (i18n_init): Remove.
761 2007-04-20 Werner Koch <wk@g10code.com>
763 * sc-copykeys.c (my_gcry_logger): Removed.
764 (main): Call setup_libgcrypt_logging helper.
765 * scdaemon.c (my_gcry_logger): Removed.
766 (main): Call setup_libgcrypt_logging helper.
768 2007-04-03 Werner Koch <wk@g10code.com>
770 * command.c (cmd_getinfo): New subcommand "reader_list".
771 * ccid-driver.c (scan_or_find_devices): Ignore EBUSY in scan mode
772 for special transports.
774 2007-03-07 Werner Koch <wk@g10code.com>
776 * app-dinsig.c: Include i18n.h.
777 (verify_pin): Support PIN pads.
778 * app-nks.c (verify_pin): Ditto.
780 * ccid-driver.c (bulk_in): Handle time extension before checking
782 (ccid_transceive_secure): Support the Cherry XX44 keyboard.
783 Kudos to the nice folks at Cherry for helping with that.
785 2007-02-18 Werner Koch <wk@g10code.com>
787 * scdaemon.c (DEFAULT_PCSC_DRIVER): Add a default for OS X.
789 2007-01-25 Werner Koch <wk@g10code.com>
791 * Makefile.am (scdaemon_LDADD): Added LIBICONV. Noted by Billy
794 2006-12-21 Werner Koch <wk@g10code.com>
796 * app-openpgp.c (verify_chv2): Factored most code out into...
797 (verify_a_chv): ... new.
798 (do_sign): Factored verification code out to new function and
799 take care of a keypad entered PIN.
800 (compare_fingerprint): Print an additional diagnostic.
802 2006-11-28 Werner Koch <wk@g10code.com>
804 * apdu.c (send_le, apdu_send_direct): Increase RESULTLEN to 258 to
805 allow for full 256 byte and the status word. This might break
806 some old PC/SC drivers or cards, but we will see. Suggested by
809 2006-11-23 Werner Koch <wk@g10code.com>
811 * command.c (scd_command_handler): Fixed use of CTRL.
813 2006-11-21 Werner Koch <wk@g10code.com>
815 * Makefile.am (libexec_PROGRAMS): Put pscs-wrapper into libexec.
816 Renamed to gnupg-pcsc-wrapper.
817 * apdu.c (open_pcsc_reader): Use GNUPG_LIBEXECDIR to accces the
818 wrapper. Suggested by Eric Dorland.
820 2006-11-20 Werner Koch <wk@g10code.com>
822 * app-openpgp.c (verify_chv2): Support for keypads (only CHV2).
824 * ccid-driver.c (ccid_transceive_secure): Made it work for Kaan
827 2006-11-17 Werner Koch <wk@g10code.com>
829 * ccid-driver.c (scan_or_find_devices): Use DEBUGOUT_2 instead of
830 log_debug. Removed few other log_debug.
832 * iso7816.c (iso7816_check_keypad): Allow for a SW of 0.
834 * command.c (pin_cb): New mode to prompt for a keypad entry.
836 * scdaemon.c (main) <gpgconf-list>: Add disable-keypad.
838 2006-11-15 Werner Koch <wk@g10code.com>
840 * app-p15.c (read_ef_odf): Cast one printf arg.
842 * scdaemon.h (struct server_control_s): Add field THREAD_STARTUP.
843 * command.c (scd_command_handler): Add new arg CTRL.
844 * scdaemon.c (scd_init_default_ctrl): Made static.
845 (scd_deinit_default_ctrl): New.
846 (start_connection_thread): Call init/deinit of ctrl.
847 (handle_connections): Allocate CTRL.
849 * apdu.c (PCSC_ERR_MASK): New.
850 (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu)
851 (close_pcsc_reader, open_pcsc_reader): Use it after shifting error
852 values. Reported by Henrik Nordstrom. Fixes bug #724.
854 2006-10-24 Werner Koch <wk@g10code.com>
856 * scdaemon.h (GCRY_MD_USER_TLS_MD5SHA1): New.
857 (MAX_DIGEST_LEN): Increased to 36.
858 * app-p15.c (do_sign): Support for TLS_MD5SHA1.
859 (do_auth): Detect TLS_MD5SHA1.
860 (do_sign): Tweaks for that digest.
862 2006-10-23 Werner Koch <wk@g10code.com>
864 * scdaemon.c (main): New command --gpgconf-test.
866 2006-10-17 Werner Koch <wk@g10code.com>
868 * Makefile.am (scdaemon_LDADD): Link against libcommonpth.
870 2006-10-12 Werner Koch <wk@g10code.com>
872 * apdu.c: Include pth.h after unistd.h for the sake of newer Pth
875 2006-10-11 Werner Koch <wk@g10code.com>
877 * app-openpgp.c (do_sign): Redirect to do_auth for OpenPGP.3.
879 2006-10-06 Werner Koch <wk@g10code.com>
881 * Makefile.am (AM_CFLAGS): Use PTH version of libassuan.
882 (scdaemon_LDADD): Ditto.
884 * scdaemon.h (send_status_info): Mark with sentinel attribute.
886 2006-10-02 Marcus Brinkmann <marcus@g10code.de>
888 * command.c (update_reader_status_file): Increase buffer of
889 NUMBUF2 (fixing typo).
891 2006-09-24 Marcus Brinkmann <marcus@g10code.de>
893 * app-openpgp.c (do_sign): Advance INDATA by the SHA1 resp. RMD160
896 2006-09-14 Werner Koch <wk@g10code.com>
898 Replaced all call gpg_error_from_errno(errno) by
899 gpg_error_from_syserror().
901 * command.c (scd_command_handler): Replaced
902 init_connected_socket_server by init_socket_server_ext.
904 2006-09-07 Werner Koch <wk@g10code.com>
906 * command.c (update_reader_status_file): Execute an event handler
909 2006-09-06 Werner Koch <wk@g10code.com>
911 * apdu.c (pcsc_end_transaction):
912 * pcsc-wrapper.c (pcsc_end_transaction: Fixed dclaration.
913 Reported by Bob Dunlop.
915 * scdaemon.h (CTRL,APP): Removed and changed everywhere to
918 Replaced all Assuan error codes by libgpg-error codes. Removed
919 all map_to_assuan_status and map_assuan_err.
921 * scdaemon.c (main): Call assuan_set_assuan_err_source to have Assuan
922 switch to gpg-error codes.
923 * command.c (set_error): Adjusted.
925 2006-09-02 Marcus Brinkmann <marcus@g10code.de>
927 * command.c (get_reader_slot): Return the slot_table index, not
928 the APDU slot number.
929 (update_reader_status_file): Use the slot_table index in the
930 update_card_removed invocation.
932 2006-09-01 Marcus Brinkmann <marcus@g10code.de>
934 * command.c (cmd_getinfo): Handle status command.
936 2006-08-30 Marcus Brinkmann <marcus@g10code.de>
938 * command.c (do_reset): Delay resetting CTRL->reader_slot until
939 after update_card_removed invocation.
941 2006-08-28 Marcus Brinkmann <marcus@g10code.de>
943 * app-openpgp.c (do_decipher, do_sign): Allow "OPENPGP.2"
944 resp. "OPENPGP.1" for KEYIDSTR.
946 2006-08-21 Werner Koch <wk@g10code.com>
948 * pcsc-wrapper.c (handle_open, handle_close): Reset card and
949 protocol on error/close.
950 (handle_status): Don't set the state if the state is unknown.
951 (handle_reset): Ignore an error if already disconnected. May
952 happen due to system wake-up after hibernation. Suggested by Bob
955 2006-06-28 Werner Koch <wk@g10code.com>
957 * app-openpgp.c (do_writekey): Fixed computation of memmove
958 length. This led to garbled keys if E was larger than one byte.
959 Thanks to Achim Pietig for hinting at the garbled E.
961 2006-06-09 Marcus Brinkmann <marcus@g10code.de>
963 * Makefile.am (scdaemon_LDADD): Add $(NETLIBS).
965 2006-04-14 Marcus Brinkmann <marcus@g10code.de>
967 * app.c (select_application): Cover up a slot mismatch error in
968 case it happens (it shouldn't happen).
969 (release_application): Use APP->slot. Lock the reader.
970 (application_notify_card_removed): Lock the reader.
972 2006-04-11 Werner Koch <wk@g10code.com>
974 * command.c (hex_to_buffer): New.
977 2006-04-03 Werner Koch <wk@g10code.com>
979 * scdaemon.c [__GLIBC__]: Default to libpcsclite.so.1.
981 2006-03-21 Werner Koch <wk@g10code.com>
983 * command.c (cmd_pksign): Add --hash option.
985 2006-03-01 Werner Koch <wk@g10code.com>
987 * command.c (status_file_update_lock): New.
988 (scd_update_reader_status_file): Use lock and factor existing code
990 (update_reader_status_file): .. this.
991 (do_reset): Use the lock and call update_reader_status_file.
993 2006-02-20 Werner Koch <wk@g10code.com>
995 * apdu.c (open_pcsc_reader): Fixed double free. Thanks to Moritz.
997 2006-02-09 Werner Koch <wk@g10code.com>
999 * command.c (get_reader_slot, do_reset)
1000 (scd_update_reader_status_file): Rewrote.
1002 * app.c (release_application): Factored code out to ..
1003 (deallocate_app): new function.
1004 (select_application): Introduce new saved application stuff.
1005 (application_notify_card_removed): New.
1006 * command.c (update_card_removed): Call it here.
1007 (do_reset): And here.
1009 * app.c (check_application_conflict): New.
1010 * command.c (open_card): Use it here.
1011 (cmd_restart): New command.
1013 * command.c (cmd_lock): Fixed --wait option to actually terminate.
1015 2006-02-08 Werner Koch <wk@g10code.com>
1017 * ccid-driver.c (ccid_get_atr): Read Parameter and select T=1
1018 using these parameters.
1019 (scan_or_find_devices): Check for NULL r_fd.
1021 2006-02-02 Werner Koch <wk@g10code.com>
1023 * ccid-driver.c (special_transport): New
1024 (ccid_open_reader, do_close_reader, ccid_shutdown_reader)
1025 (bulk_out, bulk_in): Add support for CardMan 4040 reader.
1027 * ccid-driver.c (scan_or_find_devices): Factored most code out to
1028 (scan_or_find_usb_device): .. new.
1029 (make_reader_id): Fixed vendor mask.
1031 2006-01-01 Werner Koch <wk@g10code.com>
1033 * app-openpgp.c (do_sign): Give user error if hash algorithm is
1034 not supported by the card.
1036 2005-12-06 Werner Koch <wk@g10code.com>
1038 * apdu.c (open_pcsc_reader): Check that pcsc-wrapper is actually
1041 2005-11-23 Werner Koch <wk@g10code.com>
1043 * app-nks.c (verify_pin): Give a special error message for a Nullpin.
1045 2005-10-29 Werner Koch <wk@g10code.com>
1047 * ccid-driver.c (send_escape_cmd): New args RESULT, RESULTLEN and
1048 RESULTMAX. Changed all callers.
1049 (ccid_transceive_escape): New.
1051 2005-10-27 Werner Koch <wk@g10code.com>
1053 * apdu.c [__CYGWIN__]: Make cygwin environment similar to _WIN32.
1054 Suggested by John P. Clizbe.
1055 * scdaemon.c [__CYGWIN__]: Set default PC/SC driver to winscard.dll.
1057 2005-10-19 Werner Koch <wk@g10code.com>
1059 * ccid-driver.h (CCID_DRIVER_ERR_NO_KEYPAD): New.
1060 * apdu.h (SW_HOST_NO_KEYPAD): New.
1061 * iso7816.h (struct iso7816_pininfo_s): New.
1062 * iso7816.c (map_sw): Support new code.
1063 (iso7816_check_keypad): New.
1064 (iso7816_verify_kp, iso7816_change_reference_data_kp)
1065 (iso7816_reset_retry_counter_kp): New. Extended versions of the
1067 * apdu.c (host_sw_string): Support new code.
1068 (reader_table_s): New field CHECK_KEYPAD.
1069 (new_reader_slot, open_ct_reader, open_pcsc_reader)
1070 (open_ccid_reader, open_rapdu_reader): Initialize it.
1071 (check_ccid_keypad): New.
1072 (apdu_check_keypad): New.
1073 (apdu_send_le): Factored all code out to ...
1074 (send_le): .. new. Takes an additional arg; changed all callers
1075 of the orginal function to use this one with a NULL for the new
1077 (apdu_send_simple_kp): New.
1078 (ct_send_apdu, pcsc_send_apdu, my_rapdu_send_apdu)
1079 (send_apdu_ccid): New arg PININFO.
1080 (send_apdu_ccid): Use the new arg.
1082 * scdaemon.c: New option --disable-keypad.
1084 2005-10-08 Marcus Brinkmann <marcus@g10code.de>
1086 * Makefile.am (scdaemon_LDADD): Add ../gl/libgnu.a after
1087 ../common/libcommon.a.
1089 2005-09-20 Werner Koch <wk@g10code.com>
1091 * app-dinsig.c (verify_pin): Try ISO 9564 BCD encoding.
1093 * iso7816.c (iso7816_select_application): Add arg FLAGS. Changed
1094 all callers to pass 0.
1095 * app-openpgp.c (app_select_openpgp): But this one requires a
1098 * app-p15.c (app_select_p15): Don't use select application for the
1101 2005-09-09 Werner Koch <wk@g10code.com>
1103 * pcsc-wrapper.c (main): Removed bogus free.
1105 * app-p15.c (do_auth): New.
1106 (do_getattr): New attribs $AUTHKEYID and $DISPSERIALNO.
1107 * app-openpgp.c (do_getattr): Ditto.
1109 2005-09-08 Werner Koch <wk@g10code.com>
1111 * app-openpgp.c (do_getattr): New key $AUTHKEYID.
1113 2005-09-06 Werner Koch <wk@g10code.com>
1115 * app-p15.c (do_sign): Tweaked for BELPIC cards.
1116 (read_home_df): New arg R_BELPIC.
1117 (app_select_p15): Set card type for BELPIC.
1119 2005-09-05 Werner Koch <wk@g10code.com>
1121 * iso7816.c (iso7816_select_path): New.
1122 * app-p15.c (select_ef_by_path): Allow for direct path selection.
1123 (app_select_p15): Try using the Belgian variant of pkcs#15.
1124 (read_home_df): New.
1125 (read_ef_odf): Generalized.
1126 (read_ef_tokeninfo): New.
1127 (read_p15_info): Set serialnumber from TokenInfo.
1128 (app_select_p15): Don't munge serialNumber - that must be done
1131 * iso7816.c (iso7816_read_binary): Use Le=0 when reading all
1132 data. Handle 6C00 error and take 6B00 as indication for EOF.
1133 * apdu.h (SW_EXACT_LENGTH_P): New.
1134 * apdu.c (new_reader_slot, reset_pcsc_reader, pcsc_get_status)
1135 (open_pcsc_reader): Set new reader state IS_T0.
1136 (apdu_send_le): When doing T=0 make sure not to send Lc and Le.
1137 Problem reported by Carl Meijer.
1138 (apdu_send_direct): Initialize RESULTLEN.
1139 * pcsc-wrapper.c (handle_status): Return the current protocol as
1142 2005-08-05 Werner Koch <wk@g10code.com>
1144 * apdu.c (open_rapdu_reader): Set the reader number.
1146 2005-07-05 Werner Koch <wk@g10code.com>
1148 * app-openpgp.c (do_readkey): Return a mallcoed copy of the key as
1149 required by the description. Thanks to Moritz for tracking this
1152 2005-06-21 Werner Koch <wk@g10code.com>
1154 * scdaemon.c (main): ifdef call to ccid_set_debug_level.
1156 * apdu.c (reset_pcsc_reader, open_pcsc_reader): Cast size_t to
1159 2005-06-06 Werner Koch <wk@g10code.com>
1161 * scdaemon.c (main): New option --debug-allow-core-dump.
1163 2005-06-03 Werner Koch <wk@g10code.com>
1165 * scdaemon.c (handle_connections): Make sure that the signals we
1166 are handling are not blocked.Block signals while creating new
1168 (handle_connections): Include the file descriptor into the name of
1171 2005-06-02 Werner Koch <wk@g10code.com>
1173 * app.c (app_dump_state, dump_mutex_state): New.
1174 * scdaemon.c (handle_signal): Print it on SIGUSR1.
1176 * app-openpgp.c (do_writekey): Typo fix.
1178 * command.c (open_card): Check for locked state even if an
1179 application context is available.
1181 * app-common.h: Add REF_COUNT field.
1182 * app.c (release_application, select_application): Implement
1183 reference counting to share the context beween connections.
1185 * app.c (lock_reader, unlock_reader): Take SLOT instead of APP as
1186 argument. Changed all callers.
1187 (select_application): Unlock the reader on error. This should fix
1188 the hangs I noticed last week.
1190 * scdaemon.h: Removed card_ctx_t cruft.
1192 2005-06-01 Werner Koch <wk@g10code.com>
1194 * scdaemon.c: Include mkdtemp.h.
1196 2005-05-31 Werner Koch <wk@g10code.com>
1198 * tlv.c [GNUPG_MAJOR_VERSION==1]: Define constants instead of
1199 including a gnupg 1.4 header.
1201 2005-05-30 Werner Koch <wk@g10code.com>
1203 * tlv.c: Add hack to compile without gpg-error.h when used with
1206 2005-05-23 Werner Koch <wk@g10code.com>
1208 * Makefile.am: Do not build sc-copykeys anymore.
1210 * app-openpgp.c (app_openpgp_storekey, app_openpgp_readkey)
1211 (app_openpgp_cardinfo): Removed.
1213 * ccid-driver.c (parse_ccid_descriptor): SCR335 FW version 5.14 is
1215 (do_close_reader): Never do a reset. The caller should instead
1216 make sure that the reader has been closed properly. The new retry
1217 code in ccid_slot_status will make sure that the readersatrts up
1218 fine even if the last process didn't closed the USB connection
1220 (ccid_get_atr): For certain readers try switching to ISO mode.
1221 Thanks to Ludovic Rousseau for this hint and the magic numbers.
1222 (print_command_failed): New.
1223 (bulk_in): Use it here. Add new arg NO_DEBUG.
1224 (ccid_slot_status): Disabled debugging.
1226 2005-05-21 Werner Koch <wk@g10code.com>
1228 * scdaemon.c (handle_signal): Print thread info on SIGUSR1.
1230 2005-05-20 Werner Koch <wk@g10code.com>
1232 * ccid-driver.c: Replaced macro DEBUG_T1 by a new debug level.
1233 (parse_ccid_descriptor): Mark SCR335 firmware version 5.18 good.
1234 (ccid_transceive): Arghhh. The seqno is another bit in the
1235 R-block than in the I block, this was wrong at one place.
1237 * scdaemon.c: New options --debug-ccid-driver and
1238 --debug-disable-ticker.
1240 * app-openpgp.c (do_genkey, do_writekey): Factored code to check
1241 for existing key out into ..
1242 (does_key_exist): .. New function.
1244 2005-05-19 Werner Koch <wk@g10code.com>
1246 * tlv.c (parse_sexp): New.
1248 * command.c (cmd_writekey): New.
1249 * app.c (app_writekey): New.
1250 * app-common.c (app_t): Add function ptr WRITEKEY.
1251 * app-openpgp.c (do_writekey): New.
1253 * app-openpgp.c (do_readkey) [GNUPG_MAJOR_VERSION==1]: Return error.
1254 * app-common.h (app_t) [GNUPG_MAJOR_VERSION==1]: Add a field to
1255 store the Assuan context.
1257 2005-05-17 Werner Koch <wk@g10code.com>
1259 * scdaemon.c: Removed non-pth code paths.
1260 (create_socket_name, create_server_socket): New. Taken from
1262 (cleanup): Changed to adjust for SOCKET_NAME now being malloced.
1263 (ticker_thread): Always use pth_event_occurred; it is again
1264 defined for all decent PTH versions.
1265 (handle_connections): New. Based on the gpg-agent code.
1266 (start_connection_thread): Ditto.
1267 (ticker_thread): Removed.
1268 (cleanup_sh): Removed.
1269 (main): Run the handler for the pipe server in a separate
1270 thread. This replaces the old ticker thread.
1271 (scd_get_socket_name): New.
1272 * command.c (cmd_getinfo): New command GETINFO.
1273 (scd_command_handler): Renamed argument and changed code to use an
1274 already connected FD.
1276 2005-05-15 Werner Koch <wk@g10code.com>
1278 * app.c, app-common.h, app-nks.c, app-p15.c, app-dinsig.c
1279 * app-openpgp.c: Change most function return types from int to
1281 * command.c (pin_cb): Ditto.
1282 * sc-copykeys.c (pincb): Ditto.
1284 * app.c (lock_reader, unlock_reader): New. Changed call handler
1285 wrappers to make use of these functions.
1287 2005-05-07 Werner Koch <wk@g10code.com>
1289 * ccid-driver.c (do_close_reader): Don't do a reset before close.
1290 Some folks reported that it makes the SCR335 hang less often.
1291 Look at the source on how to re-enable it.
1293 2005-04-27 Werner Koch <wk@g10code.com>
1295 * app-p15.c (micardo_mse): New.
1297 * iso7816.c (iso7816_manage_security_env): Allow passing DATA as
1298 NULL to indicate an empty Lc.
1299 * tlv.c (find_tlv): Check that a found object fits into the
1301 (find_tlv_unchecked): New as replacement for the old non-checking
1303 * app.c (select_application): Keep on using the non-checking
1305 * app-openpgp.c (get_one_do, dump_all_do): Ditto.
1308 Removal of the old OpenSC based code.
1310 * app-p15.c: New. Basic support for pkcs15 cards without OpenSC.
1311 There are quite a couple of things missing but at least I can use
1312 my old TCOS cards from the Aegypten-1 development for signing.
1313 * app.c (select_application): Detect pkcs15 applications.
1314 * Makefile.am (scdaemon_SOURCES): Removed card.c, card-common.h
1315 and card-p15.c because they are now obsolete. Added app-p15.c.
1316 Removed all OpenSC stuff.
1317 * command.c (do_reset, open_card, cmd_serialno, cmd_learn)
1318 (cmd_readcert, cmd_readkey, cmd_pksign, cmd_pkdecrypt): Removed
1319 all special cases for the old card.c based mechanisms.
1320 * scdaemon.c, apdu.c: Removed all special cases for OpenSC.
1322 2005-04-20 Werner Koch <wk@g10code.com>
1324 * command.c: Use GPG_ERR_LOCKED instead of EBUSY.
1326 2005-04-14 Werner Koch <wk@g10code.com>
1328 * app-openpgp.c (retrieve_key_material): Rewritten. Return a
1330 (retrieve_next_token): Removed.
1331 (retrieve_fpr_from_card): Rewritten to make use of DO caching and
1332 to take the KEYNO as arg.
1333 (get_public_key): Renamed variable for clarity.
1335 2005-04-12 Werner Koch <wk@g10code.com>
1337 Basic support for several sessions.
1339 * command.c (scd_command_handler): Replace the primary_connection
1340 stuff by a real connection list. Release the local context on
1342 (scd_update_reader_status_file): Update accordingly. Send signal
1343 to all connections who registered an event signal.
1344 (cmd_lock, cmd_unlock, register_commands): New commands LOCK and
1346 (cmd_setdata, cmd_pksign, cmd_pkauth, cmd_pkdecrypt, cmd_setattr)
1347 (cmd_genkey, cmd_passwd, cmd_checkpin): Return an error if reader
1349 (do_reset): Handle locking.
1350 (open_card): Ditto. Share the reader slot with other sessions.
1351 (get_reader_slot): New.
1352 (update_card_removed): New. Use it in the TEST_CARD_REMOVAL macro.
1354 2005-04-07 Werner Koch <wk@g10code.com>
1356 * app-openpgp.c (do_check_pin): Add hack to allow verification of
1358 (get_public_key): Don't use gcry functions to create S-expressions.
1359 (do_deinit, do_readkey, do_genkey, send_keypair_info): Adjust for
1362 2005-03-29 Moritz Schulte <moritz@g10code.com>
1364 * app-openpgp.c (retrieve_fpr_from_card): New function.
1365 (retrieve_next_token): New function.
1366 (retrieve_key_material): New function.
1367 (get_public_key): Implement retrival of key through expernal
1368 helper (gpg) in case the openpgp card is not cooperative enough.
1370 2005-03-16 Werner Koch <wk@g10code.com>
1372 * ccid-driver.c (parse_ccid_descriptor): Make SCM workaround
1373 reader type specific.
1374 (scan_or_find_devices): Do not check the interface subclass in the
1375 SPR532 kludge, as this depends on the firmware version.
1376 (ccid_get_atr): Get the Slot status first. This solves the
1377 problem with readers hanging on recent Linux 2.6.x.
1378 (bulk_in): Add argument TIMEOUT and changed all callers to pass an
1379 appropriate one. Change the standard timeout from 10 to 5 seconds.
1380 (ccid_slot_status): Add a retry code with an initial short timeout.
1381 (do_close_reader): Do an usb_reset before closing the reader.
1383 2005-02-25 Werner Koch <wk@g10code.com>
1385 * app-openpgp.c (get_public_key): Make sure not to return negative
1387 (do_sign): Allow passing of indata with algorithm prefix.
1388 (do_auth): Allow OPENPGP.3 as an alternative ID.
1390 * app.c (app_getattr): Return just the S/N but not the timestamp.
1392 2005-02-24 Werner Koch <wk@g10code.com>
1394 * app.c (app_getattr): Return APPTYPE or SERIALNO type even if the
1395 application does dot support the getattr call.
1397 * app-openpgp.c (get_one_do): Never try to get a non cacheable
1398 object from the cache.
1399 (get_one_do): Add new arg to return an error code. Changed all
1401 (do_getattr): Let it return a proper error code.
1403 * app.c (select_application): Return an error code and the
1404 application context in an new arg.
1405 * command.c (open_card): Adjusted for that. Don't use the
1406 fallback if no card is present. Return an error if the card has
1407 been removed without a reset.
1408 (do_reset, cmd_serialno): Clear that error flag.
1409 (TEST_CARD_REMOVAL): New. Use it with all command handlers.
1410 (scd_update_reader_status_file): Set the error flag on all changes.
1412 * scdaemon.c (ticker_thread): Termintate if a shutdown is pending.
1414 * apdu.c: Added some PCSC error codes.
1415 (pcsc_error_to_sw): New.
1416 (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu)
1417 (open_pcsc_reader): Do proper error code mapping.
1419 2005-03-16 Werner Koch <wk@g10code.com>
1421 * ccid-driver.c (parse_ccid_descriptor): Make SCM workaround
1422 reader type specific.
1423 (scan_or_find_devices): Do not check the interface subclass in the
1424 SPR532 kludge, as this depends on the firmware version.
1425 (ccid_get_atr): Get the Slot status first. This solves the
1426 problem with readers hanging on recent Linux 2.6.x.
1428 2005-02-22 Werner Koch <wk@g10code.com>
1430 * app-openpgp.c (app_local_s): New field PK.
1431 (do_deinit, do_genkey, app_openpgp_storekey): Clear it.
1432 (get_public_key, send_keypair_info): New.
1433 (do_learn_status): Send KEYPAIR info
1435 * app-common.h (app_ctx_t): Add function pointer READKEY.
1436 * app.c (app_readkey): New.
1437 * command.c (cmd_readkey): Use READKEY function if possible.
1439 2005-01-26 Werner Koch <wk@g10code.com>
1441 * ccid-driver.c (parse_ccid_descriptor): Need the CSM workaround
1442 also for newer firmware versions. Need to get a list of fixed
1443 firmware versions and use that.
1445 2005-01-25 Werner Koch <wk@g10code.com>
1447 * apdu.c (apdu_send_le, apdu_send_direct): Fix some compiler
1450 * app-openpgp.c (get_cached_data): New arg GET_IMMEDIATE to bypass
1451 the cache. Changed all callers.
1452 (get_one_do): Bypass the cache if the value would have been read
1453 directly for v1.1 cards.It makes things a bit slower but obnly for
1454 1.0 cards and there are not that many cards out in the wild. This
1455 is required to fix a caching bug when generating new keys; as a
1456 side effect of the retrieval of the the C4 DO from the 6E DO the
1457 cached fingerprint will get updated to the old value and later
1458 when signing the generated key the checking of the fingerprint
1459 fails because it won't match the new one. Thanks to Moritz for
1460 analyzing this problem.
1461 (verify_chv3): Removed the CHV status reread logic because we
1462 won't cache the C4 DO anymore.
1464 2004-12-28 Werner Koch <wk@g10code.com>
1466 * ccid-driver.c (find_endpoint): New.
1467 (scan_or_find_devices): Add new args to return endpoint info and
1469 (ccid_open_reader, ccid_shutdown_reader): Take care of these new
1471 (bulk_in, bulk_out): Use the correct endpoints.
1472 (ccid_transceive_apdu_level): New.
1473 (ccid_transceive): Divert to above.
1474 (parse_ccid_descriptor): Allow APDU level exchange mode.
1475 (do_close_reader): Pass the interface number to usb_release_interface.
1477 2004-12-21 Werner Koch <wk@g10code.com>
1479 * scdaemon.c (main): Use default_homedir().
1481 2004-12-18 Werner Koch <wk@g10code.com>
1483 * scdaemon.c (main) [W32]: Remove special Pth initialize..
1485 * scdaemon.h (map_assuan_err): Define in terms of
1486 map_assuan_err_with_source.
1488 2004-12-15 Werner Koch <wk@g10code.com>
1490 * scdaemon.c [W32]: Various hacks to make it run under W32.
1492 * command.c (scd_update_reader_status_file) [W32]: Don't use kill.
1494 * apdu.c [W32]: Disable use of pcsc_wrapper.
1496 * Makefile.am (scdaemon_LDADD): Reorder libs.
1497 (sc_copykeys_LDADD): Add libassuan because it is needed for W32.
1499 2004-12-06 Werner Koch <wk@g10code.com>
1501 * Makefile.am (pkglib_PROGRAMS): Build only for W32.
1503 2004-10-22 Werner Koch <wk@g10code.com>
1505 * app-openpgp.c (verify_chv3): The minium length for CHV3 is
1506 8. Changed string to match the other ones.
1508 2004-10-21 Werner Koch <wk@g10code.com>
1510 * app-openpgp.c (do_sign): Replace asprintf by direct allocation.
1511 This avoids problems with missing vasprintf implementations in
1514 * app-common.h (app_openpgp_storekey: Add prototype.
1516 2004-10-20 Werner Koch <wk@g10code.com>
1518 * sc-investigate: Removed.
1519 * Makefile.am (sc_investigate): Removed.
1521 * pcsc-wrapper.c (load_pcsc_driver): Load get_status_change func.
1522 (handle_open): Succeed even without a present card.
1523 (handle_status, handle_reset): New.
1525 * apdu.c (apdu_open_reader): Load pcsc_get_status_change fucntion.
1526 (pcsc_get_status): Implemented.
1527 (reset_pcsc_reader): Implemented.
1528 (open_pcsc_reader): Succeed even with no card inserted.
1529 (open_ccid_reader): Set LAST_STATUS.
1531 * iso7816.c (iso7816_select_application): Always use 0 for P1.
1533 2004-10-18 Werner Koch <wk@g10code.com>
1535 * ccid-driver.c (ccid_get_atr): Reset T=1 state info.
1537 2004-10-14 Werner Koch <wk@g10code.com>
1539 * app-openpgp.c (parse_login_data): New.
1540 (app_select_openpgp): Call it.
1541 (do_setattr): Reparse it after change.
1543 2004-10-06 Werner Koch <wk@g10code.de>
1545 * ccid-driver.c (ccid_open_reader): Store the vendor ID.
1546 (ccid_transceive_secure): New.
1547 (parse_ccid_descriptor): Workaround for an SCM reader problem.
1549 2004-10-04 Werner Koch <wk@g10code.de>
1551 * ccid-driver.c (send_escape_cmd): New.
1553 2004-09-30 Werner Koch <wk@g10code.com>
1555 * Makefile.am: Adjusted for gettext 0.14.
1557 * app-openpgp.c (do_sign): Add the error string to the verify
1560 2004-09-27 Werner Koch <wk@g10code.com>
1564 * app-openpgp.c: Made all strings translatable.
1565 (verify_chv3) [GNUPG_MAJOR_VERSION]: Make opt.allow_admin
1566 available for use in gnupg 2.
1567 (verify_chv3): Reimplemented countdown showing to use only
1568 functions from this module. Flush the CVH status cache on a
1570 (get_one_do): Hack to bypass the cache for cards versions > 1.0.
1571 (store_fpr): Store the creation date for card version > 1.0.
1573 * app-openpgp.c (app_openpgp_storekey): Call flush_cache.
1574 (get_cached_data): Move local data initialization to ..
1575 (app_select_openpgp): .. here. Read some flags for later use.
1576 (do_getattr): New read-only attribute EXTCAP.
1578 * apdu.c (open_pcsc_reader): Do not print empty reader string.
1580 * ccid-driver.c (do_close_reader): Factored some code out from ...
1581 (ccid_close_reader): ..here.
1582 (ccid_shutdown_reader): New.
1584 * apdu.c (apdu_shutdown_reader): New.
1585 (shutdown_ccid_reader): New.
1587 * apdu.c (open_ccid_reader): New arg PORTSTR. Pass it to
1589 (apdu_open_reader): Pass portstr to open_ccid_reader.
1590 (apdu_open_reader): No fallback if a full CCID reader id has been
1593 * ccid-driver.c (ccid_get_reader_list): New.
1594 (ccid_open_reader): Changed API to take a string for the reader.
1595 Removed al the cruft for the libusb development vesion which seems
1596 not to be maintained anymore and there are no packages anyway.
1597 The stable library works just fine.
1598 (struct ccid_reader_id_s): Deleted and replaced everywhere by a
1600 (usb_get_string_simple): Removed.
1601 (bulk_in): Do valgrind hack here and not just everywhere.
1603 * ccid-driver.c (read_device_info): Removed.
1604 (make_reader_id, scan_or_find_devices): New.
1605 (ccid_open_reader): Simplified by make use of the new functions.
1606 (ccid_set_debug_level): New. Changed the macros to make use of
1607 it. It has turned out that it is often useful to enable debugging
1608 at runtime so I added this option.
1610 From gnupg 1.3 - David Shaw <dshaw@jabberwocky.com>
1612 * app-openpgp.c (verify_chv3): Show a countdown of how many wrong
1613 admin PINs can be entered before the card is locked.
1615 * app-openpgp.c (get_cached_data): Avoid mallocing zero since it
1616 breaks us when using --enable-m-guard.
1618 * ccid-driver.c (usb_get_string_simple): Replacement function to
1619 work with older libusb.
1621 * ccid-driver.c (read_device_info): Fix segfault when usb device
1623 (ccid_open_reader): Allow working with an even older version of
1624 libusb (usb_busses global instead of usb_get_busses()).
1626 2004-09-11 Werner Koch <wk@g10code.com>
1628 * app-openpgp.c (app_select_openpgp): Its app_munge_serialno and
1629 not app_number_serialno.
1631 2004-08-20 Werner Koch <wk@g10code.de>
1633 * app.c (select_application): Fixed serial number extraction and
1634 added the BMI card workaround.
1635 (app_munge_serialno): New.
1636 * app-openpgp.c (app_select_openpgp): Try munging serialno.
1638 2004-08-05 Werner Koch <wk@g10code.de>
1640 * scdaemon.c (main): New option --disable-application.
1641 * app.c (is_app_allowed): New.
1642 (select_application): Use it to check for disabled applications.
1644 * ccid-driver.h (CCID_DRIVER_ERR_ABORTED): New.
1645 * ccid-driver.c (ccid_open_reader): Support the stable 0.1 version
1647 (ccid_get_atr): Handle short messages.
1649 * apdu.c (my_rapdu_get_status): Implemented.
1651 2004-07-27 Moritz Schulte <moritz@g10code.com>
1653 * apdu.c: Include <signal.h>.
1655 * Makefile.am: Use @DL_LIBS@ instead of -ldl.
1657 2004-07-22 Werner Koch <wk@g10code.de>
1659 * Makefile.am: Make OpenSC lib link after libgcrypt. Do not link
1661 * apdu.c: Don't use Pth if we use OpenSC.
1662 * sc-investigate.c, scdaemon.c: Disable use of pth if OpenSC is used.
1664 * scdaemon.c (main): Bumbed thread stack size up to 512k.
1666 2004-07-16 Werner Koch <wk@gnupg.org>
1668 * apdu.c (reader_table_s): Add function pointers for the backends.
1669 (apdu_close_reader, apdu_get_status, apdu_activate)
1670 (send_apdu): Make use of them.
1671 (new_reader_slot): Intialize them to NULL.
1672 (dump_ccid_reader_status, ct_dump_reader_status): New.
1673 (dump_pcsc_reader_status): New.
1674 (open_ct_reader, open_pcsc_reader, open_ccid_reader)
1675 (open_osc_reader, open_rapdu_reader): Intialize function pointers.
1676 (ct_activate_card, ct_send_apdu, pcsc_send_apdu, osc_send_apdu)
1677 (error_string): Removed. Replaced by apdu_strerror.
1678 (get_ccid_error_string): Removed.
1679 (ct_activate_card): Remove the unused loop.
1680 (reset_ct_reader): Implemented.
1681 (ct_send_apdu): Activate the card if not yet done.
1682 (pcsc_send_apdu): Ditto.
1684 2004-07-15 Werner Koch <wk@gnupg.org>
1686 * ccid-driver.h: Add error codes.
1687 * ccid-driver.c: Implement more or less proper error codes all
1690 * apdu.c (apdu_send_direct): New.
1691 (get_ccid_error_string): Add some error code mappings.
1692 (send_apdu): Pass error codes along for drivers already supporting
1694 (host_sw_string): New.
1695 (get_ccid_error_string): Use above.
1696 (send_apdu_ccid): Reset the reader if it has not yet been done.
1697 (open_ccid_reader): Don't care if the ATR can't be read.
1698 (apdu_activate_card): New.
1699 (apdu_strerror): New.
1700 (dump_reader_status): Only enable it with opt.VERBOSE.
1701 * iso7816.c (map_sw): Add mappings for the new error codes.
1703 2004-07-02 Werner Koch <wk@gnupg.org>
1705 * apdu.c (open_ct_reader, open_pcsc_reader, open_ccid_reader)
1706 (reset_ccid_reader, open_osc_reader): Call dump_reader_status only
1709 2004-07-01 Werner Koch <wk@gnupg.org>
1711 * sc-investigate.c: Initialize Pth which is now required.
1712 (interactive_shell): New command "readpk".
1714 * app-openpgp.c (do_getattr): Fix for sending CA-FPR.
1716 2004-06-30 Werner Koch <wk@gnupg.org>
1718 * app-openpgp.c (app_openpgp_readkey): Fixed check for valid
1721 2004-06-18 Werner Koch <wk@g10code.com>
1723 * sc-investigate.c (my_read_line): Renamed from read_line.
1725 2004-06-16 Werner Koch <wk@gnupg.org>
1727 * apdu.c (osc_get_status): Fixed type in function name. Noted by
1728 Axel Thimm. Yes, I didn't tested it with OpenSC :-(.
1730 2004-04-28 Werner Koch <wk@gnupg.org>
1732 * app-openpgp.c (do_setattr): Sync FORCE_CHV1.
1734 2004-04-27 Werner Koch <wk@gnupg.org>
1736 * app-common.h: Do not include ksba.h for gnupg 1.
1738 2004-04-26 Werner Koch <wk@gnupg.org>
1740 * app-common.h: New members FNC.DEINIT and APP_LOCAL.
1741 * app.c (release_application): Call new deconstructor.
1742 * app-openpgp.c (do_deinit): New.
1743 (get_cached_data, flush_cache_item, flush_cache_after_error)
1745 (get_one_do): Replaced arg SLOT by APP. Make used of cached data.
1746 (verify_chv2, verify_chv3): Flush some cache item after error.
1747 (do_change_pin): Ditto.
1749 (do_setattr): Flush cache item.
1750 (do_genkey): Flush the entire cache.
1751 (compare_fingerprint): Use cached data.
1753 * scdaemon.c (main): Do the last change the usual way. This is so
1754 that we can easily test for versioned config files above.
1756 2004-04-26 Marcus Brinkmann <marcus@g10code.de>
1758 * scdaemon.c (main): For now, always print default filename for
1759 --gpgconf-list, and never /dev/null.
1761 2004-04-21 Werner Koch <wk@gnupg.org>
1763 * command.c (scd_update_reader_status_file): Send a signal back to
1765 (option_handler): Parse the new event-signal option.
1767 * scdaemon.c (handle_signal): Do not use SIGUSR{1,2} anymore for
1768 changing the verbosity.
1770 2004-04-20 Werner Koch <wk@gnupg.org>
1772 * command.c (scd_update_reader_status_file): Write status files.
1774 * app-help.c (app_help_read_length_of_cert): Fixed calculation of
1777 * pcsc-wrapper.c: New.
1778 * Makefile.am (pkglib_PROGRAMS): Install it here.
1779 * apdu.c (writen, readn): New.
1780 (open_pcsc_reader, pcsc_send_apdu, close_pcsc_reader): Use the
1781 pcsc-wrapper if we are using Pth.
1782 (apdu_send_le): Reinitialize RESULTLEN. Handle SW_EOF_REACHED
1785 2004-04-19 Werner Koch <wk@gnupg.org>
1787 * ccid-driver.c (parse_ccid_descriptor): Store some of the reader
1788 features away. New arg HANDLE
1789 (read_device_info): New arg HANDLE. Changed caller.
1790 (bulk_in): Handle time extension requests.
1791 (ccid_get_atr): Setup parameters and the IFSD.
1792 (compute_edc): New. Factored out code.
1793 (ccid_transceive): Use default NADs when required.
1795 2004-04-14 Werner Koch <wk@gnupg.org>
1797 * scdaemon.h (server_control_s): Add member READER_SLOT.
1798 * scdaemon.c (scd_init_default_ctrl): Initialize READER_SLOT to -1.
1799 * command.c (open_card): Reuse an open slot.
1800 (reset_notify): Just reset the slot if supported by the reader.
1801 (do_reset): Factored code from above out.
1802 (scd_command_handler): Use it for cleanup.
1804 * apdu.h: New pseudo stati SW_HOST_NOT_SUPPORTED,
1805 SW_HOST_LOCKING_FAILED and SW_HOST_BUSY.
1806 * iso7816.c (map_sw): Map it.
1808 * ccid-driver.c (ccid_slot_status): Add arg STATUSBITS.
1809 * apdu.c (apdu_get_status): New.
1810 (ct_get_status, pcsc_get_status, ocsc_get_status): New stubs.
1811 (get_status_ccid): New.
1813 (reset_ct_reader, reset_pcsc_reader, reset_osc_reader): New stubs.
1814 (reset_ccid_reader): New.
1815 (apdu_enum_reader): New.
1817 * apdu.c (lock_slot, trylock_slot, unlock_slot): New helpers.
1818 (new_reader_slot) [USE_GNU_PTH]: Init mutex.
1819 (apdu_reset, apdu_get_status, apdu_send_le): Run functions
1822 * command.c (scd_update_reader_status_file): New.
1823 * scdaemon.c (handle_tick): Call it.
1825 2004-04-13 Werner Koch <wk@gnupg.org>
1827 * scdaemon.c: Convert to a Pth application.
1828 (handle_signal, ticker_thread, handle_tick): New.
1829 (main): Fire up the ticker thread in server mode.
1831 2004-03-23 Werner Koch <wk@gnupg.org>
1833 * scdaemon.c (main) <gpgconf_list>: Fixed output for pcsc_driver.
1835 2004-03-17 Werner Koch <wk@gnupg.org>
1837 * tlv.c (parse_ber_header): Do not check for tag overflow - it
1838 does not make sense. Simplified the check for length overflow.
1840 * scdaemon.c (main) <gpgconf>: Fixed default value quoting.
1842 2004-03-16 Werner Koch <wk@gnupg.org>
1844 * app-dinsig.c: Implemented. Based on app-nks.c and card-dinsig.c
1845 * app-nks.c (get_length_of_cert): Removed.
1847 (app_help_read_length_of_cert): New. Code taken from above. New
1848 optional arg R_CERTOFF.
1850 * card-dinsig.c: Removed.
1851 * card.c (card_get_serial_and_stamp): Do not bind to the old and
1852 never finsiged card-dinsig.c.
1854 * iso7816.c (iso7816_read_binary): Allow for an NMAX > 254.
1856 2004-03-11 Werner Koch <wk@gnupg.org>
1858 * scdaemon.h (out_of_core): Removed. Replaced callers by standard
1861 * apdu.c, iso7816.c, ccid-driver.c [GNUPG_SCD_MAIN_HEADER]: Allow
1862 to include a header defined by the compiler. This helps us to
1863 reuse the source in other software.
1865 2004-03-10 Werner Koch <wk@gnupg.org>
1867 * iso7816.c (iso7816_read_record): New arg SHORT_EF. Changed all
1870 2004-02-18 Werner Koch <wk@gnupg.org>
1872 * sc-investigate.c (main): Setup the used character set.
1873 * scdaemon.c (main): Ditto.
1875 * scdaemon.c (set_debug): New. Add option --debug-level.
1876 (main): Add option --gpgconf-list.
1878 2004-02-12 Werner Koch <wk@gnupg.org>
1880 * Makefile.am: Include cmacros.am for common flags.
1882 2004-01-29 Werner Koch <wk@gnupg.org>
1884 * command.c (reset_notify): Release the application context and
1887 2004-01-28 Werner Koch <wk@gnupg.org>
1889 * iso7816.c (iso7816_manage_security_env): New.
1890 (iso7816_decipher): Add PADIND argument.
1892 2004-01-27 Werner Koch <wk@gnupg.org>
1894 * command.c (cmd_readcert, cmd_readkey): Work on a copy of LINE.
1896 * app-common.h (app_ctx_s): Added readcert field.
1897 * app.c (app_readcert): New.
1898 * tlv.c (parse_ber_header): Added; taken from libksba.
1900 2004-01-26 Werner Koch <wk@gnupg.org>
1902 * card.c (map_sc_err): Use SCD as the error source.
1904 * command.c (open_card): ADD arg NAME to allow requesting a
1905 specific application. Changed all callers.
1906 (cmd_serialno): Allow optional argument to select the desired
1911 * scdaemon.h (opt): Add READER_PORT.
1912 * scdaemon.c (main): Set it here.
1913 * app.c (app_set_default_reader_port): Removed.
1914 (select_application): Add NAME arg and figure out a
1915 default serial number from the GDO. Add SLOT arg and remove all
1917 (release_application): New.
1918 (app_write_learn_status): Output an APPTYPE status line.
1919 * command.c (open_card): Adapt for select_application change.
1920 * app-openpgp.c (app_select_openpgp): Removed SN and SNLEN args
1921 and set it directly. Changed all callers.
1923 2004-01-25 Werner Koch <wk@gnupg.org>
1925 * iso7816.c (iso7816_select_application): P1 kludge for OpenPGP
1927 * app-openpgp.c (find_tlv): Factor out this function to ..
1928 * tlv.c, tlv.h: .. new.
1930 * scdaemon.h: Introduced app_t and ctrl_t as the new types for APP
1933 2004-01-21 Werner Koch <wk@gnupg.org>
1935 * apdu.c (apdu_send_le): Treat SW_EOF_REACHED as a warning.
1937 2004-01-20 Werner Koch <wk@gnupg.org>
1939 * iso7816.c (iso7816_read_binary): New.
1940 (iso7816_select_file): New.
1941 (iso7816_list_directory): New.
1943 * sc-investigate.c: Add option -i.
1944 (select_app, read_line, interactive_shell): New.
1946 2004-01-16 Werner Koch <wk@gnupg.org>
1948 * apdu.h: Add SW_FILE_NOT_FOUND.
1949 * iso7816.c (map_sw): Map it to GPG_ERR_ENOENT.
1950 * iso7816.c (iso7816_select_file): New.
1952 * app-dinsig.c: New file w/o any real code yet.
1953 * Makefile.am (scdaemon_SOURCES,sc_investigate_SOURCES): Add file.
1955 * sc-investigate.c: Add option --disable-ccid.
1957 2003-12-19 Werner Koch <wk@gnupg.org>
1959 * apdu.c (apdu_send_le): Send a get_response with the indicated
1960 length and not the 64 bytes we used for testing.
1962 * app-openpgp.c (verify_chv2, verify_chv3, do_sign): Check the
1963 minimum length of the passphrase, so that we don't need to
1964 decrement the retry counter.
1966 2003-12-17 Werner Koch <wk@gnupg.org>
1968 * card-p15.c (p15_enum_keypairs): Replaced KRC by RC.
1969 * card-dinsig.c (dinsig_enum_keypairs): Ditto.
1971 2003-12-16 Werner Koch <wk@gnupg.org>
1973 * scdaemon.c (main): Set the prefixes for assuan logging.
1975 2003-11-17 Werner Koch <wk@gnupg.org>
1977 * scdaemon.c, scdaemon.h: New options --allow-admin and --deny-admin.
1978 * app-openpgp.c (verify_chv3): Check it here.
1980 2003-11-12 Werner Koch <wk@gnupg.org>
1982 Adjusted for API changes in Libksba.
1984 2003-10-30 Werner Koch <wk@gnupg.org>
1986 * apdu.c (close_ct_reader, close_pcsc_reader): Implemented.
1987 (get_ccid_error_string): New. Not very useful messages, though.
1989 2003-10-25 Werner Koch <wk@gnupg.org>
1991 * ccid-driver.c (ccid_open_reader): Return an error if no USB
1994 * command.c (cmd_genkey, cmd_passwd): Fixed faulty use of
1997 * apdu.c (apdu_open_reader): Hacks for PC/SC under Windows.
1999 2003-10-20 Werner Koch <wk@gnupg.org>
2001 * command.c (cmd_checkpin): New.
2002 (register_commands): Add command CHECKPIN.
2003 * app.c (app_check_pin): New.
2004 * app-openpgp.c (check_against_given_fingerprint): New. Factored
2005 out that code elsewhere.
2006 (do_check_pin): New.
2008 2003-10-10 Werner Koch <wk@gnupg.org>
2010 * ccid-driver.c (ccid_close_reader): New.
2012 * apdu.c (close_ccid_reader, close_ct_reader, close_csc_reader)
2013 (close_osc_reader, apdu_close_reader): New. Not all are properly
2016 2003-10-09 Werner Koch <wk@gnupg.org>
2018 * ccid-driver.c (ccid_transceive): Add T=1 chaining for sending.
2020 2003-10-08 Werner Koch <wk@gnupg.org>
2022 * app-openpgp.c (do_getattr): Support SERIALNO and AID.
2024 2003-10-01 Werner Koch <wk@gnupg.org>
2026 * ccid-driver.c: Detect GnuPG 1.3 and include appropriate files.
2028 * app-openpgp.c: Ditto.
2030 (generate_keypair): Renamed to ..
2031 (do_generate_keypair): .. this.
2032 * app-common.h [GNUPG_MAJOR_VERSION]: New.
2033 * iso7816.h [GNUPG_MAJOR_VERSION]: Include cardglue.h
2035 2003-09-30 Werner Koch <wk@gnupg.org>
2037 * command.c (cmd_getattr): New command GETATTR.
2038 * app.c (app_setattr): New.
2040 (do_learn_status): Reimplemented in terms of do_getattr.
2042 * app-openpgp.c (do_change_pin): Make sure CVH1 and CHV2 are
2044 (verify_chv2, verify_chv3): New. Factored out common code.
2045 (do_setattr, do_sign, do_auth, do_decipher): Change the names of
2046 the prompts to match that we have only 2 different PINs.
2047 (app_select_openpgp): Check whether the card enforced CHV1.
2048 (convert_sig_counter_value): New. Factor out code from
2051 2003-09-28 Werner Koch <wk@gnupg.org>
2053 * app-openpgp.c (dump_all_do): Use gpg_err_code and not gpg_error.
2055 2003-09-19 Werner Koch <wk@gnupg.org>
2057 * ccid-driver.c (parse_ccid_descriptor): New.
2058 (read_device_info): New.
2059 (ccid_open_reader): Check that the device has all required features.
2061 2003-09-06 Werner Koch <wk@gnupg.org>
2063 * scdaemon.c (main): --pcsc-driver again defaults to pcsclite.
2064 David Corcoran was so kind to remove the GPL incompatible
2065 advertisng clause from pcsclite.
2066 * apdu.c (apdu_open_reader): Actually make pcsc-driver option work.
2068 2003-09-05 Werner Koch <wk@gnupg.org>
2070 * ccid-driver.c: More work, data can now actually be retrieved.
2071 * ccid-driver.c, ccid-driver.h: Alternativley allow use under BSD
2074 2003-09-02 Werner Koch <wk@gnupg.org>
2076 * scdaemon.c, scdaemon.h: New option --pcsc-ccid.
2077 * ccid-driver.c, ccid-driver.h: New but far from being useful.
2078 * Makefile.am: Add above.
2079 * apdu.c: Add support for that ccid driver.
2081 2003-08-26 Timo Schulz <twoaday@freakmail.de>
2083 * apdu.c (new_reader_slot): Only set 'is_osc' when OpenSC
2086 2003-08-25 Werner Koch <wk@gnupg.org>
2088 * command.c (cmd_setattr): Use a copy of LINE.
2089 (cmd_genkey): Use a copy of KEYNO.
2090 (cmd_passwd): Use a copy of CHVNOSTR.
2091 (cmd_pksign, cmd_pkauth, cmd_pkdecrypt): s/strdup/xtrystrdup/.
2093 2003-08-19 Werner Koch <wk@gnupg.org>
2095 * scdaemon.c, scdaemon.h: New option --pcsc-driver.
2096 * apdu.c (apdu_open_reader): Use that option here instead of a
2099 2003-08-18 Werner Koch <wk@gnupg.org>
2101 * Makefile.am: Add OPENSC_LIBS to all programs.
2103 * scdaemon.c, scdaemon.h: New option --disable-opensc.
2104 * card.c (card_open): Implement it.
2105 * apdu.c (open_osc_reader, osc_send_apdu): New.
2106 (apdu_open_reader) [HAVE_OPENSC]: Use the opensc driver if not
2108 (error_string) [HAVE_OPENSC]: Use sc_strerror.
2109 (send_apdu) [HAVE_OPENSC]: Call osc_apdu_send.
2111 * card-p15.c (p15_enum_keypairs, p15_prepare_key): Adjusted for
2114 2003-08-14 Timo Schulz <twoaday@freakmail.de>
2116 * apdu.c (ct_activate_card): Change the code a little to avoid
2117 problems with other readers.
2118 * Always use 'dynload.h' instead of 'dlfcn.h'.
2120 2003-08-05 Werner Koch <wk@gnupg.org>
2122 * app-openpgp.c (dump_all_do): Don't analyze constructed DOs after
2125 2003-08-04 Werner Koch <wk@gnupg.org>
2127 * app.c (app_set_default_reader_port): New.
2128 (select_application): Use it here.
2129 * scdaemon.c (main): and here.
2130 * sc-copykeys.c: --reader-port does now take a string.
2131 * sc-investigate.c, scdaemon.c: Ditto.
2132 * apdu.c (apdu_open_reader): Ditto. Load pcsclite if no ctapi
2133 driver is configured. Always include code for ctapi.
2134 (new_reader_slot): Don't test for already used ports and remove
2136 (open_pcsc_reader, pcsc_send_apdu, pcsc_error_string): New.
2137 (apdu_send_le): Changed RC to long to cope with PC/SC.
2139 * scdaemon.c, scdaemon.h: New option --ctapi-driver.
2140 * sc-investigate.c, sc-copykeys.c: Ditto.
2142 2003-07-31 Werner Koch <wk@gnupg.org>
2144 * Makefile.am (scdaemon_LDADD): Added INTLLIBS.
2146 2003-07-28 Werner Koch <wk@gnupg.org>
2148 * app-openpgp.c (do_setattr): Change implementation. Allow all
2151 2003-07-27 Werner Koch <wk@gnupg.org>
2153 Adjusted for gcry_mpi_print and gcry_mpi_scan API change.
2155 2003-07-24 Werner Koch <wk@gnupg.org>
2157 * app-openpgp.c (do_learn_status): Print more status information.
2158 (app_select_openpgp): Store the card version.
2159 (store_fpr): Add argument card_version and fix DOs for old cards.
2160 (app_openpgp_storekey): Likewise.
2162 2003-07-23 Werner Koch <wk@gnupg.org>
2164 * command.c (cmd_pkauth): New.
2165 (cmd_setdata): Check whether data was given at all to avoid
2166 passing 0 to malloc.
2168 * app.c (app_auth): New.
2169 * app-openpgp.c (do_auth): New.
2171 2003-07-22 Werner Koch <wk@gnupg.org>
2173 * command.c (cmd_passwd): New.
2174 * app.c (app_change_pin): New.
2175 * app-openpgp.c (do_change_pin): New.
2176 * iso7816.c (iso7816_reset_retry_counter): Implemented.
2178 * sc-investigate.c (main): New option --gen-random.
2179 * iso7816.c (iso7816_get_challenge): Don't create APDUs with a
2180 length larger than 255.
2182 2003-07-17 Werner Koch <wk@gnupg.org>
2184 * command.c (cmd_random): New command RANDOM.
2186 * iso7816.c (map_sw): New. Use it in this file to return
2187 meaningful error messages. Changed all public fucntions to return
2189 (iso7816_change_reference_data): New.
2190 * apdu.c (apdu_open_reader): Use faked status words for soem
2193 2003-07-16 Werner Koch <wk@gnupg.org>
2195 * apdu.c (apdu_send_simple): Use apdu_send_le so that we can
2196 specify not to send Le as it should be.
2198 2003-07-15 Werner Koch <wk@gnupg.org>
2200 * Makefile.am: Add sc-copykeys program.
2201 * sc-copykeys.c: New.
2202 * app-openpgp.c (app_openpgp_storekey): New.
2203 (app_openpgp_cardinfo): New.
2205 (store_fpr): And use it here to get the actual length in bit.
2207 2003-07-03 Werner Koch <wk@gnupg.org>
2209 * app-openpgp.c (do_setattr): Add setting of the URL.
2210 (app_select_openpgp): Dump card data only in very verbose mode.
2213 2003-07-02 Werner Koch <wk@gnupg.org>
2215 * app-openpgp.c (get_sig_counter): New.
2216 (do_sign): Print the signature counter and enable the PIN callback.
2217 (do_genkey): Implement the PIN callback.
2219 2003-07-01 Werner Koch <wk@gnupg.org>
2221 * app-openpgp.c (store_fpr): Fixed fingerprint calculation.
2223 2003-06-26 Werner Koch <wk@gnupg.org>
2225 * app-openpgp.c (find_tlv): Fixed length header parsing.
2227 * app.c (app_genkey): New.
2228 * command.c (cmd_genkey): New.
2230 2003-06-25 Werner Koch <wk@gnupg.org>
2232 * command.c (percent_plus_unescape): New.
2235 2003-06-24 Werner Koch <wk@gnupg.org>
2237 * command.c (send_status_info): New.
2239 * app-openpgp.c (app_select_openpgp): Replace SLOT arg by APP arg
2240 and setup the function pointers in APP on success. Changed callers.
2242 * app-common.h: New.
2243 * scdaemon.h (APP): New type to handle applications.
2244 (server_control_s): Add an APP context field.
2246 * command.c (cmd_serialno): Handle applications.
2247 (cmd_pksign): Ditto.
2248 (cmd_pkdecrypt): Ditto.
2249 (reset_notify): Ditto.
2250 (cmd_learn): For now return error for application contexts.
2251 (cmd_readcert): Ditto.
2252 (cmd_readkey): Ditto.
2254 2003-06-04 Werner Koch <wk@gnupg.org>
2256 * card.c (map_sc_err): Renamed gpg_make_err to gpg_err_make.
2258 Renamed error codes from INVALID to INV and removed _ERROR suffixes.
2260 2003-06-03 Werner Koch <wk@gnupg.org>
2262 Changed all error codes in all files to the new libgpg-error scheme.
2264 * scdaemon.h: Include gpg-error.h and errno.h
2265 * card.c (map_sc_err): Use unknown for the error source.
2266 * Makefile.am: Link with libgpg-error
2268 2003-05-14 Werner Koch <wk@gnupg.org>
2270 * atr.c, atr.h: New.
2271 * sc-investigate.c: Dump the ATR in a human readable format.
2273 2003-05-08 Werner Koch <wk@gnupg.org>
2275 * scdaemon.h (DBG_CARD_IO_VALUE): New.
2277 * sc-investigate.c: New.
2278 * scdaemon.c (main): Removed --print-atr option.
2280 * iso7816.c, iso7816.h, app-openpgp.c: New.
2282 2003-04-29 Werner Koch <wk@gnupg.org>
2284 * scdaemon.c: New options --print-atr and --reader-port
2285 * apdu.c, apdu.h: New
2287 * card.c, card-p15.c, card-dinsig.c: Allow build without OpenSC.
2289 * Makefile.am (LDFLAGS): Removed.
2291 * command.c (register_commands): Adjusted for new Assuan semantics.
2293 2002-08-21 Werner Koch <wk@gnupg.org>
2295 * scdaemon.c (main): New option --daemon so that the program is
2296 not accidently started in the background.
2298 2002-08-16 Werner Koch <wk@gnupg.org>
2300 * scdaemon.c: Include i18n.h.
2302 * card-common.h (struct p15_private_s): Forward declaration. Add
2304 * card.c (card_close): Make sure private data is released.
2305 (card_enum_certs): New.
2306 * card-p15.c (p15_release_private_data): New.
2307 (init_private_data): New to work around an OpenSC weirdness.
2308 (p15_enum_keypairs): Do an OpenSC get_objects only once.
2309 (p15_enum_certs): New.
2310 (card_p15_bind): Bind new function.
2311 * command.c (cmd_learn): Return information about the certificates.
2313 2002-08-09 Werner Koch <wk@gnupg.org>
2315 * card.c (card_get_serial_and_stamp): Use the tokeinfo serial
2316 number as a fallback. Add a special prefix for serial numbers.
2318 2002-07-30 Werner Koch <wk@gnupg.org>
2320 Changes to cope with OpenSC 0.7.0:
2322 * card.c: Removed the check for the packed opensc version.
2323 Changed include file names of opensc.
2324 (map_sc_err): Adjusted error codes for new opensc version.
2325 * card-p15.c: Changed include filename of opensc.
2326 * card-dinsig.c: Ditto.
2328 * card-p15.c (p15_decipher): Add flags argument to OpenSC call.
2330 2002-07-24 Werner Koch <wk@gnupg.org>
2332 * card.c (find_simple_tlv, find_iccsn): New.
2333 (card_get_serial_and_stamp): Improved serial number parser.
2335 2002-06-27 Werner Koch <wk@gnupg.org>
2337 * scdaemon.c (main): Use GNUPG_DEFAULT_HOMEDIR constant.
2339 2002-06-15 Werner Koch <wk@gnupg.org>
2341 * card-dinsig.c: Documented some stuff from the DIN norm.
2343 2002-04-15 Werner Koch <wk@gnupg.org>
2345 * command.c (cmd_pksign, cmd_pkdecrypt): Use a copy of the key ID.
2347 2002-04-12 Werner Koch <wk@gnupg.org>
2349 * scdaemon.c: New option --debug-sc N.
2350 * card.c (card_open): set it here.
2352 * card-p15.c (p15_prepare_key): Factored out common code from ...
2353 (p15_sign, p15_decipher): here and made the decryption work the
2356 2002-04-10 Werner Koch <wk@gnupg.org>
2358 * card.c (card_open): Return immediately when no reader is available.
2360 2002-03-27 Werner Koch <wk@gnupg.org>
2362 * card.c (card_open, card_close): Adjusted for changes in OpenSC.
2364 2002-03-10 Werner Koch <wk@gnupg.org>
2366 * card-p15.c, card-dinsig.c, card-common.h: New.
2367 * card.c: Factored most code out to the new modules, so that we
2368 can better support different types of card applications.
2370 2002-01-26 Werner Koch <wk@gnupg.org>
2372 * scdaemon.c scdaemon.h, command.c: New. Based on the code from
2376 Copyright 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
2378 This file is free software; as a special exception the author gives
2379 unlimited permission to copy and/or distribute it, with or without
2380 modifications, as long as this notice is preserved.
2382 This file is distributed in the hope that it will be useful, but
2383 WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
2384 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.