1 2009-08-05 Werner Koch <wk@g10code.com>
3 * app-openpgp.c (change_keyattr_from_string): New.
4 (do_setattr): Support KEY-ATTR.
6 2009-07-29 Marcus Brinkmann <marcus@g10code.com>
8 * ccid-driver.c (print_pr_data): Fix 64 bit compat problem.
10 2009-07-24 Werner Koch <wk@g10code.com>
12 * ccid-driver.c (parse_ccid_descriptor): Enable hack for SCR 3320.
14 2009-07-21 Werner Koch <wk@g10code.com>
16 * ccid-driver.c [HAVE_PTH]: Include pth.h.
18 (bulk_in): s/gnupg_sleep/my_sleep/.
20 2009-07-20 Werner Koch <wk@g10code.com>
22 * apdu.c [GNUPG_MAJOR_VERSION==1]: Include dynload.h.
24 2009-07-16 Werner Koch <wk@g10code.com>
26 * command.c (update_reader_status_file): Test for unplugged reader.
27 (TEST_CARD_REMOVAL): Ditto.
28 * app.c (select_application): Ditto.
29 * ccid-driver.c (bulk_out): Return CCID_DRIVER_ERR_NO_READER if a
31 (struct ccid_driver_s): Turn nonnull_nad into an unsigned char.
32 Turn apdu_level, auto_ifsd, powered_off, has_pinpad into
33 bitfields. Add enodev_seen.
34 * apdu.c (apdu_prepare_exit): New.
35 (get_status_ccid): Return the status word and nut just -1.
36 * scdaemon.c (scd_exit): Call it.
38 2009-07-13 Werner Koch <wk@g10code.com>
40 * ccid-driver.c (struct ccid_driver_s): Add fields last_progress,
41 progress_cb and progress_cb_arg.
42 (ccid_set_progress_cb): New.
43 (print_progress): New.
44 (ccid_transceive): Call print_progress for wait time extensions.
45 * apdu.c (struct reader_table_s): Add field set_progress_cb.
46 (new_reader_slot): Clear that field.
47 (open_ccid_reader): Set it to ..
48 (set_progress_cb_ccid_reader): ... new fucntion.
49 * app.c (print_progress_line): New.
50 (lock_reader): Add arg CTRL to set a progress callback and
51 change all callers to provide it.
52 (unlock_reader): Remove the progress callback.
54 2009-07-10 Werner Koch <wk@g10code.com>
56 * iso7816.c (iso7816_compute_ds): Add args EXTENDED_MODE and LE.
57 Change all callers to use 0.
58 (iso7816_internal_authenticate): Add args EXTENDED_MODE and LE.
59 * app-openpgp.c (do_sign): Take exmode and Le from card
60 capabilities and pass them to iso7816_compute_ds.
61 (do_auth): Ditto for iso7816_internal_authenticate.
62 (change_keyattr): Reset CHV verification status.
64 2009-07-09 Werner Koch <wk@g10code.com>
66 * app-openpgp.c (change_keyattr): New.
67 (do_writekey): Call it.
69 * app-openpgp.c (does_key_exist): Add arg GENERATING. Change
72 2009-06-30 Werner Koch <wk@g10code.com>
74 * ccid-driver.c (ccid_transceive): Set RESYNCING flag.
76 2009-06-29 Werner Koch <wk@g10code.com>
78 * ccid-driver.c (ccid_transceive): Add a hack to support extended
79 length for Omnikey readers.
81 (parse_ccid_descriptor): Track short+extended apdu exchange level.
83 2009-06-18 Werner Koch <wk@g10code.com>
85 * app-openpgp.c (verify_chv2): Remove special case for v2 cards.
86 (get_public_key): Use extended mode.
88 2009-06-17 Werner Koch <wk@g10code.com>
90 * iso7816.c (iso7816_get_data): Add arg EXTENDED_MODE. Change all
92 * app-openpgp.c (data_objects): Use bit flags. Add flag
94 (get_cached_data): Add arg TRY_EXTLEN and use it for iso7816_get_data.
95 (get_one_do): Use extended length APDU if necessary.
97 2009-06-10 Werner Koch <wk@g10code.com>
99 * app-openpgp.c (store_fpr): Change first arg to app_t; adjust
100 callers. Flush the cache.
102 2009-06-09 Werner Koch <wk@g10code.com>
104 * app-openpgp.c (do_readcert): Return NOT_FOUND if the retrieved
105 data has a length of zero.
106 (do_getattr): Add EXTCAP subkey "sm".
108 2009-05-20 Werner Koch <wk@g10code.com>
110 * app-openpgp.c (verify_chv2): Add case for v2 cards.
111 (verify_chv3): Factor some code out to ..
112 (build_enter_admin_pin_prompt): .. new.
113 (do_change_pin): Properly handle v2 cards.
115 2009-05-19 Werner Koch <wk@g10code.com>
117 * scdaemon.c (create_server_socket): Use SUN_LEN.
118 (JNLIB_NEED_AFLOCAL): Define.
120 2009-05-13 Werner Koch <wk@g10code.com>
122 * ccid-driver.c (abort_cmd): Add arg SEQNO and change callers.
123 (bulk_in): Retry on seqno mismatch.
125 * apdu.c (send_le): Release result_buffer.
126 (apdu_send_direct): Implemend extended length.
127 * command.c (cmd_apdu): Add option "--exlen".
129 2009-05-11 Werner Koch <wk@g10code.com>
131 * apdu.c (send_le): Replace log_error by log_info.
133 2009-05-08 Werner Koch <wk@g10code.com>
135 * app-openpgp.c (do_genkey): Allow larger key sizes.
136 (do_decipher): Ditto.
137 * iso7816.c (do_generate_keypair): Add arg EXTENDED_MODE an LE.
138 (iso7816_generate_keypair, iso7816_read_public_key): Ditto.
140 * apdu.c (send_le): Implement extended length return values.
142 * ccid-driver.c (bulk_in): Retry on EAGAIN.
143 (abort_cmd): Change seqno handling.
145 2009-04-28 Werner Koch <wk@g10code.com>
147 * app-help.c (app_help_count_bits): New.
149 * app-nks.c (switch_application): Detect mass signature cards.
150 Take care of new NEED_APP_SELECT flag.
151 (do_sign): Don't allow mass signature cards.
154 (app_select_nks): Register do_readkey.
156 2009-04-01 Werner Koch <wk@g10code.com>
158 * app-openpgp.c (do_setattr, do_writekey): Prepare for extended
161 2009-03-31 Werner Koch <wk@g10code.com>
163 * command.c (percent_plus_unescape): Remove.
164 (cmd_setattr): Use percent_plus_unescape_inplace.
166 2009-03-30 Werner Koch <wk@g10code.com>
168 * app-nks.c (do_decipher): Make it work for TCOS 3.
169 * iso7816.c (iso7816_decipher): Add arg EXTENDED_MODE.
170 * apdu.c (apdu_send): Add arg EXTENDED_MODE and change all callers.
171 (apdu_send_le): Ditto.
172 (apdu_send_direct): Ditto, but not yet functional.
173 (send_le): Fix command chaining. Implement extended length option.
174 * ccid-driver.c (ccid_transceive): Remove restriction on apdu length.
175 (struct ccid_driver_s): Add field IFSC.
176 (ccid_get_atr): Set IFSC.
177 (ccid_transceive): Use negotiated IFSC and support S(IFS) command.
179 2009-03-26 Werner Koch <wk@g10code.com>
181 * command.c (cmd_pksign): Allow more hash algorithms.
183 * scdaemon.h (MAX_DIGEST_LEN): Change to 64.
185 * apdu.c (open_ccid_reader): Clear the is_to flag.
187 * app-nks.c (filelist): Add field KID.
188 (do_getattr): Change standard authentication key.
189 (do_sign): Setup a security environment for TCOS 3 cards and support
190 all SHA-2 algorithms.
192 2009-03-24 Werner Koch <wk@g10code.com>
194 * command.c (struct server_local_s): Add flag
195 APP_CTX_MARKED_FOR_RELEASE.
196 (do_reset): Set the flag.
197 (open_card): Act on this flag.
198 * app-common.h (struct app_ctx_s): Add flag NO_REUSE.
199 (application_notify_card_reset): Set the flag.
200 * app.c (select_application, release_application): Take care of
203 2009-03-20 Werner Koch <wk@g10code.com>
205 * app-nks.c (keygripstr_from_pk_file): Fix for TCOS 3 cards.
207 2009-03-18 Werner Koch <wk@g10code.com>
209 * apdu.c (open_pcsc_reader_wrapped): Use close_all_fds.
211 * command.c (cmd_learn): Add option --keypairinfo.
212 * app.c (app_write_learn_status): Add arg FLAGS.
213 * app-common.h (struct app_ctx_s): Add arg FLAGS to LEARN_STATUS.
214 Change all implementors.
215 * app-p15.c (do_learn_status): Take care of flag bit 0.
216 * app-nks.c (do_learn_status, do_learn_status_core): Ditto.
218 2009-03-10 Werner Koch <wk@g10code.com>
220 * app-openpgp.c (send_key_attr): New.
221 (do_getattr): New attribute KEY_ATTR.
222 * command.c (send_status_direct): New.
224 2009-03-06 Werner Koch <wk@g10code.com>
226 * app-nks.c (do_learn_status): Factor code out to..
227 (do_learn_status_core): .. new.
228 (do_readcert, do_sign, do_decipher): Switch to SigG if needed.
229 (verify_pin): Use DESC also for keypad based verify.
231 2009-03-05 Werner Koch <wk@g10code.com>
233 * app-openpgp.c (verify_a_chv): Remove special case for keypads.
234 (verify_chv3): Ditto.
236 * app-nks.c (get_chv_status): New.
237 (parse_pwidstr): New.
238 (verify_pin): Add args PWID and DESC and use them. Remove the
240 (do_change_pin): Allow PIN selection and add reset mode.
241 (do_learn_status): Use NKS-NKS3 tag for TCOS 3 cards.
242 (do_readcert, do_sign): Allow NKS-NKS3 tag.
244 2009-03-04 Werner Koch <wk@g10code.com>
246 * app-nks.c (do_getattr): New.
247 (app_select_nks): Register it.
248 (verify_pin): Factor some code out to...
249 (basic_pin_checks): New.
250 (do_change_pin): Call the basic check.
251 (app_select_nks): Move AID to ..
254 (switch_application): New.
255 (do_getattr, do_learn_status, do_readcert, do_sign, do_decipher)
256 (do_change_pin, do_check_pin): Make sure we are in NKS mode.
258 2009-03-03 Werner Koch <wk@g10code.com>
260 * command.c (scd_command_handler): Remove dereference of STOPME
263 2009-02-27 Werner Koch <wk@g10code.com>
265 * app.c (get_supported_applications): New.
266 * command.c (cmd_getinfo): New subcommand "app_list"
268 (register_commands): Register command KILLSCD.
269 (struct server_local_s): Add field STOPME.
270 (scd_command_handler): Act upon this.
272 2009-02-25 Werner Koch <wk@g10code.com>
274 * apdu.c (apdu_get_status): Factor all code out to ...
275 (apdu_private_get_status): .. new. Add arg NO_ATR_RESET.
276 (apdu_connect): Call new function.
278 * scdaemon.c: New option --debug-log-tid.
279 (tid_log_callback): New.
280 (main): Move debug-wait code after debug stream init.
282 2009-02-24 Werner Koch <wk@g10code.com>
284 * ccid-driver.c (ccid_get_atr): Move debug output to ..
285 (print_r2p_parameters): .. new.
286 (print_r2p_header, print_pr_data, print_r2p_unknown)
287 (print_r2p_datablock, print_r2p_slotstatus, print_r2p_escape)
288 (print_r2p_datarate): New.
289 (bulk_in): Call parameter printing.
290 (ccid_set_debug_level): Add debug level 3.
291 (convert_le_u16): New.
292 (print_p2r_header, print_p2r_iccpoweron, print_p2r_iccpoweroff)
293 (print_p2r_getslotstatus, print_p2r_xfrblock)
294 (print_p2r_getparameters, print_p2r_resetparameters)
295 (print_p2r_setparameters, print_p2r_escape, print_p2r_iccclock)
296 (print_p2r_to0apdu, print_p2r_secure, print_p2r_mechanical)
297 (print_p2r_abort, print_p2r_setdatarate, print_r2p_unknown): New.
298 (bulk_out): Add arg NO_DEBUG and change all callers to pass 0.
299 Call parameter printing.
300 (ccid_slot_status): Call with NO_DEBUG set.
301 (abort_cmd, send_escape_cmd, ccid_get_atr, ccid_get_atr)
302 (ccid_transceive_apdu_level, ccid_transceive)
303 (ccid_transceive_secure): Remove old debug print code.
305 2009-02-12 Werner Koch <wk@g10code.com>
307 * command.c (cmd_getinfo): Add new subcommand "deny_admin".
309 2009-01-28 Werner Koch <wk@g10code.com>
311 * scdaemon.c (main): Make --allow-admin the default and make the
314 2009-01-27 Werner Koch <wk@g10code.com>
316 * app-geldkarte.c: Changed to use an AID.
318 * app.c (app_munge_serialno): Add case for no serialno.
319 (app_get_serial_and_stamp): Ditto.
321 2009-01-26 Werner Koch <wk@g10code.com>
323 * app-geldkarte.c: New.
324 * Makefile.am (card_apps): Add new file.
325 * app.c (select_application): Test for geldkarte.
327 2009-01-12 Werner Koch <wk@g10code.com>
329 * command.c (send_client_notifications) [HAVE_W32_SYSTEM]: Fix
332 2009-01-08 Werner Koch <wk@g10code.com>
334 * iso7816.c (iso7816_read_record, iso7816_read_binary): Pass 0 for
335 L_e because the problem with the CCID driver has gone.
336 (iso7816_apdu_direct): New.
338 * app-nks.c (filelist): Add NKS_VER field. Add NKS 3 specific
340 (app_local_s, do_deinit): New.
341 (get_nks_version): New.
342 (app_select_nks): Setup local data.
343 (keygripstr_from_pk_file): Replace SLOT by APP and take care of
345 (do_learn_status): Take care of NKS version.
347 2009-01-05 Werner Koch <wk@g10code.com>
349 * apdu.c (apdu_get_status): Save the last status.
351 2008-12-18 Werner Koch <wk@g10code.com>
353 * ccid-driver.c (abort_cmd): New.
354 (bulk_in): Call abort_cmd after severe errors.
356 * apdu.c (reader_table_s): Add field ANY_STATUS.
357 (new_reader_slot): Clear it.
358 (apdu_get_status): Use ANY_STATUS to update the change counter.
359 Remove the use of the flag bit from LAST_STATUS everywhere.
360 * command.c (update_reader_status_file): Factor code out to ...
361 (send_client_notifications): New. Track signals already sent.
362 (update_reader_status_file): Shutdown the reader after a failed
365 2008-12-09 Werner Koch <wk@g10code.com>
367 * scdaemon.c (main): Call i18n_init before init_common_subsystems.
369 2008-12-08 Werner Koch <wk@g10code.com>
371 * scdaemon.c (handle_connections): Sync ticker to the next full
373 (TIMERTICK_INTERVAL_USEC): Change to 500ms.
375 2008-12-05 Werner Koch <wk@g10code.com>
377 * app-openpgp.c (app_local_s): Add field ALGO_ATTR_CHANGE.
378 (app_select_openpgp): Parse new capability.
379 (show_caps): Show new capability.
381 2008-12-03 Werner Koch <wk@g10code.com>
383 * scdaemon.c (opts): Use ARGPARSE_ macros. Add option
385 * command.c (update_reader_status_file): Implement it.
387 2008-11-18 Werner Koch <wk@g10code.com>
389 * scdaemon.c (make_libversion): New.
390 (my_strusage): Print libgcrypt and libksba version.
392 2008-11-03 Werner Koch <wk@g10code.com>
394 * command.c (server_local_s): Add field DISCONNECT_ALLOWED.
395 (cmd_disconnect): Implement command.
396 (open_card): Reset disconnect flag.
397 (update_reader_status_file): Disconnect if allowed.
399 * app-common.h (app_ctx_s): Remove INITIALIZED. Make REF_COUNT
401 * app.c (select_application): Remove INITIALIZED.
402 (app_write_learn_status, app_readcert, app_readkey, app_getattr)
403 (app_setattr, app_sign, app_decipher, app_writecert)
404 (app_writekey, app_get_challenge, app_change_pin, app_check_pin):
405 Replace INITIALIZED by REF_COUNT check.
406 (application_notify_card_removed): Rename to ..
407 (application_notify_card_reset): .. this. Change all callers.
408 * command.c (do_reset): Call application_notify_card_reset after
410 (update_reader_status_file): Add arg SET_CARD_REMOVED.
411 (scd_update_reader_status_file): Pass true for new flag.
412 (do_reset): Pass false for new flag.
414 * app.c (app_get_serial_and_stamp): Use bin2hex.
415 * app-help.c (app_help_get_keygrip_string): Ditto.
416 * app-p15.c (send_certinfo, send_keypairinfo, do_getattr): Ditto.
417 * app-openpgp.c (send_fpr_if_not_null, send_key_data)
418 (retrieve_fpr_from_card, send_keypair_info): Ditto.
419 * app-nks.c (keygripstr_from_pk_file): Ditto.
420 * command.c (cmd_apdu): Ditto.
422 2008-10-21 Marcus Brinkmann <marcus@g10code.com>
424 * command.c (open_card): If connect error is SW_HOST_NO_CARD,
425 return a more descriptive error.
427 2008-10-20 Werner Koch <wk@g10code.com>
429 * pcsc-wrapper.c (read_32): Use provided arg and not stdin. Is
430 called with stdin, though.
431 (handle_close): Mark unused arg.
432 (handle_status, handle_reset): Ditto.
434 * ccid-driver.c (ccid_check_card_presence): Mark not yet used arg.
436 * scdaemon.c (scd_deinit_default_ctrl): Mark unused arg.
437 * command.c (cmd_unlock, cmd_restart, cmd_disconnect): Ditto.
438 * apdu.c (ct_get_status): Ditto.
439 (ct_send_apdu, pcsc_send_apdu_wrapped)
440 (apdu_open_remote_reader): Ditto.
441 * app.c (select_application): Ditto.
442 * app-openpgp.c (do_writecert, do_change_pin, do_writekey): Ditto.
443 * app-nks.c (do_change_pin, do_check_pin): Ditto.
445 2008-10-16 Werner Koch <wk@g10code.com>
447 * command.c (cmd_disconnect): New dummy command.
448 (register_commands): Register command.
450 2008-10-15 Werner Koch <wk@g10code.com>
452 * command.c (scd_command_handler): Return true if there is no more
454 * scdaemon.c (start_connection_thread): Set shutdown flag if
455 requested by command handler.
456 (main): Make PIPE_SERVER module global.
457 (handle_connections): Disable listen_fd if a shutdown is pending.
459 2008-10-14 Werner Koch <wk@g10code.com>
461 * apdu.c (reader_table_s): Add fields connect_card and
463 (new_reader_slot): Set them to NULL.
464 (apdu_connect, apdu_disconnect): New.
465 (apdu_close_reader, apdu_shutdown_reader): Call apdu_disconnect.
466 (connect_pcsc_card, disconnect_pcsc_card): new.
467 (reset_pcsc_reader_direct): Implement in terms of
468 disconnect_pcsc_card and connect_pcsc_card.
469 (apdu_get_atr): Return NULL if there is no ATR.
470 * sc-copykeys.c (main): Add call to apdu_connect.
471 * command.c (open_card): Ditto.
473 * apdu.h (SW_HOST_ALREADY_CONNECTED): New.
474 (APDU_CARD_USABLE, APDU_CARD_PRESENT, APDU_CARD_ACTIVE): New.
475 * apdu.c: Replace constants by the new macros.
476 (open_pcsc_reader): Factor code out to ...
477 (open_pcsc_reader_direct, open_pcsc_reader_wrapped): New.
478 (reset_pcsc_reader): Factor code out to ...
479 (reset_pcsc_reader_direct, reset_pcsc_reader_wrapped): New.
480 (pcsc_get_status): Factor code out to ...
481 (pcsc_get_status_direct, pcsc_get_status_wrapped): New.
482 (pcsc_send_apdu): Factor code out to ...
483 (pcsc_send_apdu_direct, pcsc_send_apdu_wrapped): New.
484 (close_pcsc_reader): Factor code out to ...
485 (close_pcsc_reader_direct, close_pcsc_reader_wrapped): New.
487 * command.c (update_reader_status_file): Open the reader if not
490 * scdaemon.c (TIMERTICK_INTERVAL_SEC, TIMERTICK_INTERVAL_USEC):
491 New to replace TIMERTICK_INTERVAL. Chnage from 2s (4 under W32)
494 2008-10-13 Werner Koch <wk@g10code.com>
496 * command.c (option_handler) [W32]: Use strtoul with base 16.
497 (update_reader_status_file) [W32]: Set Event.
498 (scd_command_handler): Use INT2FD to silent warning.
500 2008-09-29 Werner Koch <wk@g10code.com>
502 * scdaemon.h (GCRY_MD_USER): Rename to GCRY_MODULE_ID_USER.
503 (GCRY_MD_USER_TLS_MD5SHA1): Rename to MD_USER_TLS_MD5SHA1 and
506 2008-09-28 Marcus Brinkmann <marcus@g10code.com>
508 * apdu.c (pcsc_get_status): Fix last change.
510 2008-09-25 Werner Koch <wk@g10code.com>
512 * app-openpgp.c (do_setattr): Do not allow setting of the reset
514 (do_change_pin): Allow setting of the reset code.
516 2008-09-24 Werner Koch <wk@g10code.com>
518 * app-openpgp.c (verify_chv3): Set the did_chv3 flag which was
519 accidently removed on 2008-03-26.
520 (verify_chv2): Revert last change.
521 (do_change_pin): Do not change CHV2. Add reset code logic for v2
523 * iso7816.c (iso7816_reset_retry_counter_with_rc): New.
525 * app-openpgp.c (add_tlv, build_privkey_template): New.
526 (do_writekey): Support v2 keys and other key lengths than 1024.
527 * iso7816.c (iso7816_put_data_odd): New.
529 2008-09-23 Werner Koch <wk@g10code.com>
531 * app-openpgp.c (do_sign): Support SHA-2 digests.
532 (verify_chv2): No CHV auto-sync for v2 cards.
533 (do_auth): Allow 2048 bit keys.
534 (parse_algorithm_attribute): New.
535 (rsa_key_format_t): New.
536 (struct app_local_s): Add struct KEYATTR.
538 2008-09-23 Marcus Brinkmann <marcus@g10code.com>
540 * apdu.c (pcsc_get_status): Be more relaxed with the usable flag
543 2008-09-23 Werner Koch <wk@g10code.com>
545 * app-openpgp.c (do_setattr): Use command chaining for long
547 * iso7816.c (iso7816_put_data): Add arg EXTENDED_MODE. Change all
549 * apdu.c (apdu_send_simple): Add arg EXTENDED_MODE. Change all
551 (send_le): Implement command chaining.
552 * ccid-driver.c (ccid_transceive_apdu_level): Increase allowed
554 (ccid_transceive): Alow for APDUS of up to 259 bytes.
555 * apdu.h: Add new SW_ codes.
557 2008-09-16 Werner Koch <wk@g10code.com>
559 * command.c (cmd_writecert): New.
560 (register_commands): Register it.
561 * app-common.h (app_ctx_s): Add member WRITECERT.
562 * app.c (app_writecert): New.
563 * app-openpgp.c (do_writecert): New.
564 (parse_historical): New.
566 (dump_all_do): Print only the length of longs DOs.
567 * command.c (cmd_writekey, cmd_apdu, cmd_pksign)
568 (cmd_passwd): Replace open coding by skip_options.
570 2008-08-30 Moritz <moritz@gnu.org>
572 * scdaemon.c (main): Use estream_asprintf instead of asprintf.
573 * command.c (update_reader_status_file): Likewise.
574 (cmd_serialno): Use estream_asprintf instead of asprintf
575 and xfree instead of free to release memory allocated
576 through (estream_)asprintf.
577 (cmd_learn): Likewise.
579 * app-openpgp.c (get_public_key): Likewise.
581 2008-08-18 Werner Koch <wk@g10code.com>
583 * app-openpgp.c (do_setattr): Fix test for v2 cards.
585 2008-08-11 Werner Koch <wk@g10code.com>
587 * apdu.c (reset_pcsc_reader, open_pcsc_reader)
588 (reset_rapdu_reader, open_rapdu_reader): Allow ATRs of up to 33
589 bytes. Provide maximum size of ATR buffer using DIM. Such long
590 ATR are never seen in reality but the PC/SC library of MAC OS X is
591 just too buggy. Reported by Ludovic Rousseau. Fixes bug #948.
593 2008-07-30 Werner Koch <wk@g10code.com>
595 * app-openpgp.c (verify_a_chv): Use xtrymalloc and make the prompt
596 for CHV2 more user friendly.
598 2008-07-03 Werner Koch <wk@g10code.com>
600 * app-openpgp.c (do_readcert): New.
601 (app_local_s): Add fields IS_V2 and MAX_CERTLEN_3.
602 (app_select_openpgp): Set them and register do_readcert.
603 (do_setattr): Allow storing of the certificate.
605 2008-06-25 Werner Koch <wk@g10code.com>
607 * app-dinsig.c (do_sign): Allow for SHA256.
609 2008-06-24 Werner Koch <wk@g10code.com>
611 * app-common.h (app_ctx_s): Renamed reset_mode parameter of
612 change_pin to mode_Flags and make it an unsigned int.
613 (APP_CHANGE_FLAG_RESET, APP_CHANGE_FLAG_NULLPIN): New.
614 * app-openpgp.c (do_change_pin): Adjust for that.
616 * command.c (cmd_passwd): Add option --nullpin.
617 * app-nks.c (do_check_pin, do_change_pin): New.
618 (app_select_nks): Register new functions.
620 2008-04-21 Moritz Schulte <mo@g10code.com> (wk)
622 * app-openpgp.c (verify_a_chv): Make use of the default CHV flag.
624 2008-03-26 Werner Koch <wk@g10code.com>
626 * app-openpgp.c (verify_chv3): Support the keypad.
628 2008-02-09 Marcus Brinkmann <marcus@g10code.de>
630 * scdaemon.c (main): Use CONFIG_FILENAME as filename if it is set
631 in gpgconf-list output.
633 2007-12-10 Werner Koch <wk@g10code.com>
635 * app-openpgp.c (do_decipher): Take care of cryptograms shorter
636 that 128 bytes. Fixes bug#851.
638 2007-11-14 Werner Koch <wk@g10code.com>
640 * scdaemon.c (main): Pass STANDARD_SOCKET flag to
641 create_server_socket.
643 2007-11-13 Werner Koch <wk@g10code.com>
645 * scdaemon.c (start_connection_thread): Do not call
646 assuan_sock_check_nonce if we are running in --server mode.
648 2007-11-07 Werner Koch <wk@g10code.com>
650 * scdaemon.h: Remove errors.h.
652 2007-10-02 Werner Koch <wk@g10code.com>
654 * command.c (cmd_getinfo): Add "pid" subcommand.
656 2007-10-01 Werner Koch <wk@g10code.com>
658 * scdaemon.c (create_server_socket): Use Assuan socket wrappers
659 and remove Windows specific code.
661 (start_connection_thread): Check nonce.
663 2007-09-14 Marcus Brinkmann <marcus@g10code.de>
665 * scdaemon.c (main): New variable STANDARD_SOCKET, which is 1 for
666 W32 targets. Use it for create_socket_name.
668 2007-08-07 Werner Koch <wk@g10code.com>
670 * tlv.c, tlv.h: Move to ../common/.
672 2007-08-02 Werner Koch <wk@g10code.com>
674 * scdaemon.c: Include gc-opt-flags.h and remove their definition
677 2007-08-01 Werner Koch <wk@g10code.com>
679 * apdu.c (send_le): Implement exact length hack. Suggested by
682 2007-07-05 Werner Koch <wk@g10code.com>
684 * command.c (has_option_name, skip_options): New.
685 (cmd_genkey): Add option --timestamp.
686 (cmd_writekey): Enter confidential mode while inquiring the key data.
688 * app.c (app_genkey): Add arg CREATETIME.
689 * app-common.h (app_ctx_s): Likewise
690 * app-openpgp.c (do_genkey): Ditto. Use it.
693 2007-07-04 Werner Koch <wk@g10code.com>
695 * command.c (cmd_getinfo): New subcommand "version".
697 * scdaemon.c (TIMERTICK_INTERVAL): New.
698 (handle_connections) [W32]: Enable a dummy sigs event.
699 (handle_connections): Use a proper count for select and not
701 (fixed_gcry_pth_init, main): Kludge to fix pth initialization.
703 2007-06-21 Werner Koch <wk@g10code.com>
705 * scdaemon.h (ctrl_t): Remove. It is now declared in ../common/util.h.
707 2007-06-18 Marcus Brinkmann <marcus@g10code.de>
709 * scdaemon.c (main): Percent escape output of --gpgconf-list.
711 2007-06-12 Werner Koch <wk@g10code.com>
713 * scdaemon.c (main): Replace some calls by init_common_subsystems.
715 2007-06-11 Werner Koch <wk@g10code.com>
717 * Makefile.am (scdaemon_LDADD): Use libcommonpth macro.
719 * command.c (initialize_module_command): New.
720 * scdaemon.c (main) [W32]: Do not use sigpipe code.
721 (main): Call initialize_module_command.
723 2007-06-06 Werner Koch <wk@g10code.com>
725 * app-openpgp.c (do_sign): Fix arithmetic on void*.
727 * app.c (dump_mutex_state) [W32]: Handle the W32Pth case.
729 * apdu.c: Remove dynload.h.
731 * scdaemon.c (i18n_init): Remove.
733 2007-04-20 Werner Koch <wk@g10code.com>
735 * sc-copykeys.c (my_gcry_logger): Removed.
736 (main): Call setup_libgcrypt_logging helper.
737 * scdaemon.c (my_gcry_logger): Removed.
738 (main): Call setup_libgcrypt_logging helper.
740 2007-04-03 Werner Koch <wk@g10code.com>
742 * command.c (cmd_getinfo): New subcommand "reader_list".
743 * ccid-driver.c (scan_or_find_devices): Ignore EBUSY in scan mode
744 for special transports.
746 2007-03-07 Werner Koch <wk@g10code.com>
748 * app-dinsig.c: Include i18n.h.
749 (verify_pin): Support PIN pads.
750 * app-nks.c (verify_pin): Ditto.
752 * ccid-driver.c (bulk_in): Handle time extension before checking
754 (ccid_transceive_secure): Support the Cherry XX44 keyboard.
755 Kudos to the nice folks at Cherry for helping with that.
757 2007-02-18 Werner Koch <wk@g10code.com>
759 * scdaemon.c (DEFAULT_PCSC_DRIVER): Add a default for OS X.
761 2007-01-25 Werner Koch <wk@g10code.com>
763 * Makefile.am (scdaemon_LDADD): Added LIBICONV. Noted by Billy
766 2006-12-21 Werner Koch <wk@g10code.com>
768 * app-openpgp.c (verify_chv2): Factored most code out into...
769 (verify_a_chv): ... new.
770 (do_sign): Factored verification code out to new function and
771 take care of a keypad entered PIN.
772 (compare_fingerprint): Print an additional diagnostic.
774 2006-11-28 Werner Koch <wk@g10code.com>
776 * apdu.c (send_le, apdu_send_direct): Increase RESULTLEN to 258 to
777 allow for full 256 byte and the status word. This might break
778 some old PC/SC drivers or cards, but we will see. Suggested by
781 2006-11-23 Werner Koch <wk@g10code.com>
783 * command.c (scd_command_handler): Fixed use of CTRL.
785 2006-11-21 Werner Koch <wk@g10code.com>
787 * Makefile.am (libexec_PROGRAMS): Put pscs-wrapper into libexec.
788 Renamed to gnupg-pcsc-wrapper.
789 * apdu.c (open_pcsc_reader): Use GNUPG_LIBEXECDIR to accces the
790 wrapper. Suggested by Eric Dorland.
792 2006-11-20 Werner Koch <wk@g10code.com>
794 * app-openpgp.c (verify_chv2): Support for keypads (only CHV2).
796 * ccid-driver.c (ccid_transceive_secure): Made it work for Kaan
799 2006-11-17 Werner Koch <wk@g10code.com>
801 * ccid-driver.c (scan_or_find_devices): Use DEBUGOUT_2 instead of
802 log_debug. Removed few other log_debug.
804 * iso7816.c (iso7816_check_keypad): Allow for a SW of 0.
806 * command.c (pin_cb): New mode to prompt for a keypad entry.
808 * scdaemon.c (main) <gpgconf-list>: Add disable-keypad.
810 2006-11-15 Werner Koch <wk@g10code.com>
812 * app-p15.c (read_ef_odf): Cast one printf arg.
814 * scdaemon.h (struct server_control_s): Add field THREAD_STARTUP.
815 * command.c (scd_command_handler): Add new arg CTRL.
816 * scdaemon.c (scd_init_default_ctrl): Made static.
817 (scd_deinit_default_ctrl): New.
818 (start_connection_thread): Call init/deinit of ctrl.
819 (handle_connections): Allocate CTRL.
821 * apdu.c (PCSC_ERR_MASK): New.
822 (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu)
823 (close_pcsc_reader, open_pcsc_reader): Use it after shifting error
824 values. Reported by Henrik Nordstrom. Fixes bug #724.
826 2006-10-24 Werner Koch <wk@g10code.com>
828 * scdaemon.h (GCRY_MD_USER_TLS_MD5SHA1): New.
829 (MAX_DIGEST_LEN): Increased to 36.
830 * app-p15.c (do_sign): Support for TLS_MD5SHA1.
831 (do_auth): Detect TLS_MD5SHA1.
832 (do_sign): Tweaks for that digest.
834 2006-10-23 Werner Koch <wk@g10code.com>
836 * scdaemon.c (main): New command --gpgconf-test.
838 2006-10-17 Werner Koch <wk@g10code.com>
840 * Makefile.am (scdaemon_LDADD): Link against libcommonpth.
842 2006-10-12 Werner Koch <wk@g10code.com>
844 * apdu.c: Include pth.h after unistd.h for the sake of newer Pth
847 2006-10-11 Werner Koch <wk@g10code.com>
849 * app-openpgp.c (do_sign): Redirect to do_auth for OpenPGP.3.
851 2006-10-06 Werner Koch <wk@g10code.com>
853 * Makefile.am (AM_CFLAGS): Use PTH version of libassuan.
854 (scdaemon_LDADD): Ditto.
856 * scdaemon.h (send_status_info): Mark with sentinel attribute.
858 2006-10-02 Marcus Brinkmann <marcus@g10code.de>
860 * command.c (update_reader_status_file): Increase buffer of
861 NUMBUF2 (fixing typo).
863 2006-09-24 Marcus Brinkmann <marcus@g10code.de>
865 * app-openpgp.c (do_sign): Advance INDATA by the SHA1 resp. RMD160
868 2006-09-14 Werner Koch <wk@g10code.com>
870 Replaced all call gpg_error_from_errno(errno) by
871 gpg_error_from_syserror().
873 * command.c (scd_command_handler): Replaced
874 init_connected_socket_server by init_socket_server_ext.
876 2006-09-07 Werner Koch <wk@g10code.com>
878 * command.c (update_reader_status_file): Execute an event handler
881 2006-09-06 Werner Koch <wk@g10code.com>
883 * apdu.c (pcsc_end_transaction):
884 * pcsc-wrapper.c (pcsc_end_transaction: Fixed dclaration.
885 Reported by Bob Dunlop.
887 * scdaemon.h (CTRL,APP): Removed and changed everywhere to
890 Replaced all Assuan error codes by libgpg-error codes. Removed
891 all map_to_assuan_status and map_assuan_err.
893 * scdaemon.c (main): Call assuan_set_assuan_err_source to have Assuan
894 switch to gpg-error codes.
895 * command.c (set_error): Adjusted.
897 2006-09-02 Marcus Brinkmann <marcus@g10code.de>
899 * command.c (get_reader_slot): Return the slot_table index, not
900 the APDU slot number.
901 (update_reader_status_file): Use the slot_table index in the
902 update_card_removed invocation.
904 2006-09-01 Marcus Brinkmann <marcus@g10code.de>
906 * command.c (cmd_getinfo): Handle status command.
908 2006-08-30 Marcus Brinkmann <marcus@g10code.de>
910 * command.c (do_reset): Delay resetting CTRL->reader_slot until
911 after update_card_removed invocation.
913 2006-08-28 Marcus Brinkmann <marcus@g10code.de>
915 * app-openpgp.c (do_decipher, do_sign): Allow "OPENPGP.2"
916 resp. "OPENPGP.1" for KEYIDSTR.
918 2006-08-21 Werner Koch <wk@g10code.com>
920 * pcsc-wrapper.c (handle_open, handle_close): Reset card and
921 protocol on error/close.
922 (handle_status): Don't set the state if the state is unknown.
923 (handle_reset): Ignore an error if already disconnected. May
924 happen due to system wake-up after hibernation. Suggested by Bob
927 2006-06-28 Werner Koch <wk@g10code.com>
929 * app-openpgp.c (do_writekey): Fixed computation of memmove
930 length. This led to garbled keys if E was larger than one byte.
931 Thanks to Achim Pietig for hinting at the garbled E.
933 2006-06-09 Marcus Brinkmann <marcus@g10code.de>
935 * Makefile.am (scdaemon_LDADD): Add $(NETLIBS).
937 2006-04-14 Marcus Brinkmann <marcus@g10code.de>
939 * app.c (select_application): Cover up a slot mismatch error in
940 case it happens (it shouldn't happen).
941 (release_application): Use APP->slot. Lock the reader.
942 (application_notify_card_removed): Lock the reader.
944 2006-04-11 Werner Koch <wk@g10code.com>
946 * command.c (hex_to_buffer): New.
949 2006-04-03 Werner Koch <wk@g10code.com>
951 * scdaemon.c [__GLIBC__]: Default to libpcsclite.so.1.
953 2006-03-21 Werner Koch <wk@g10code.com>
955 * command.c (cmd_pksign): Add --hash option.
957 2006-03-01 Werner Koch <wk@g10code.com>
959 * command.c (status_file_update_lock): New.
960 (scd_update_reader_status_file): Use lock and factor existing code
962 (update_reader_status_file): .. this.
963 (do_reset): Use the lock and call update_reader_status_file.
965 2006-02-20 Werner Koch <wk@g10code.com>
967 * apdu.c (open_pcsc_reader): Fixed double free. Thanks to Moritz.
969 2006-02-09 Werner Koch <wk@g10code.com>
971 * command.c (get_reader_slot, do_reset)
972 (scd_update_reader_status_file): Rewrote.
974 * app.c (release_application): Factored code out to ..
975 (deallocate_app): new function.
976 (select_application): Introduce new saved application stuff.
977 (application_notify_card_removed): New.
978 * command.c (update_card_removed): Call it here.
979 (do_reset): And here.
981 * app.c (check_application_conflict): New.
982 * command.c (open_card): Use it here.
983 (cmd_restart): New command.
985 * command.c (cmd_lock): Fixed --wait option to actually terminate.
987 2006-02-08 Werner Koch <wk@g10code.com>
989 * ccid-driver.c (ccid_get_atr): Read Parameter and select T=1
990 using these parameters.
991 (scan_or_find_devices): Check for NULL r_fd.
993 2006-02-02 Werner Koch <wk@g10code.com>
995 * ccid-driver.c (special_transport): New
996 (ccid_open_reader, do_close_reader, ccid_shutdown_reader)
997 (bulk_out, bulk_in): Add support for CardMan 4040 reader.
999 * ccid-driver.c (scan_or_find_devices): Factored most code out to
1000 (scan_or_find_usb_device): .. new.
1001 (make_reader_id): Fixed vendor mask.
1003 2006-01-01 Werner Koch <wk@g10code.com>
1005 * app-openpgp.c (do_sign): Give user error if hash algorithm is
1006 not supported by the card.
1008 2005-12-06 Werner Koch <wk@g10code.com>
1010 * apdu.c (open_pcsc_reader): Check that pcsc-wrapper is actually
1013 2005-11-23 Werner Koch <wk@g10code.com>
1015 * app-nks.c (verify_pin): Give a special error message for a Nullpin.
1017 2005-10-29 Werner Koch <wk@g10code.com>
1019 * ccid-driver.c (send_escape_cmd): New args RESULT, RESULTLEN and
1020 RESULTMAX. Changed all callers.
1021 (ccid_transceive_escape): New.
1023 2005-10-27 Werner Koch <wk@g10code.com>
1025 * apdu.c [__CYGWIN__]: Make cygwin environment similar to _WIN32.
1026 Suggested by John P. Clizbe.
1027 * scdaemon.c [__CYGWIN__]: Set default PC/SC driver to winscard.dll.
1029 2005-10-19 Werner Koch <wk@g10code.com>
1031 * ccid-driver.h (CCID_DRIVER_ERR_NO_KEYPAD): New.
1032 * apdu.h (SW_HOST_NO_KEYPAD): New.
1033 * iso7816.h (struct iso7816_pininfo_s): New.
1034 * iso7816.c (map_sw): Support new code.
1035 (iso7816_check_keypad): New.
1036 (iso7816_verify_kp, iso7816_change_reference_data_kp)
1037 (iso7816_reset_retry_counter_kp): New. Extended versions of the
1039 * apdu.c (host_sw_string): Support new code.
1040 (reader_table_s): New field CHECK_KEYPAD.
1041 (new_reader_slot, open_ct_reader, open_pcsc_reader)
1042 (open_ccid_reader, open_rapdu_reader): Initialize it.
1043 (check_ccid_keypad): New.
1044 (apdu_check_keypad): New.
1045 (apdu_send_le): Factored all code out to ...
1046 (send_le): .. new. Takes an additional arg; changed all callers
1047 of the orginal function to use this one with a NULL for the new
1049 (apdu_send_simple_kp): New.
1050 (ct_send_apdu, pcsc_send_apdu, my_rapdu_send_apdu)
1051 (send_apdu_ccid): New arg PININFO.
1052 (send_apdu_ccid): Use the new arg.
1054 * scdaemon.c: New option --disable-keypad.
1056 2005-10-08 Marcus Brinkmann <marcus@g10code.de>
1058 * Makefile.am (scdaemon_LDADD): Add ../gl/libgnu.a after
1059 ../common/libcommon.a.
1061 2005-09-20 Werner Koch <wk@g10code.com>
1063 * app-dinsig.c (verify_pin): Try ISO 9564 BCD encoding.
1065 * iso7816.c (iso7816_select_application): Add arg FLAGS. Changed
1066 all callers to pass 0.
1067 * app-openpgp.c (app_select_openpgp): But this one requires a
1070 * app-p15.c (app_select_p15): Don't use select application for the
1073 2005-09-09 Werner Koch <wk@g10code.com>
1075 * pcsc-wrapper.c (main): Removed bogus free.
1077 * app-p15.c (do_auth): New.
1078 (do_getattr): New attribs $AUTHKEYID and $DISPSERIALNO.
1079 * app-openpgp.c (do_getattr): Ditto.
1081 2005-09-08 Werner Koch <wk@g10code.com>
1083 * app-openpgp.c (do_getattr): New key $AUTHKEYID.
1085 2005-09-06 Werner Koch <wk@g10code.com>
1087 * app-p15.c (do_sign): Tweaked for BELPIC cards.
1088 (read_home_df): New arg R_BELPIC.
1089 (app_select_p15): Set card type for BELPIC.
1091 2005-09-05 Werner Koch <wk@g10code.com>
1093 * iso7816.c (iso7816_select_path): New.
1094 * app-p15.c (select_ef_by_path): Allow for direct path selection.
1095 (app_select_p15): Try using the Belgian variant of pkcs#15.
1096 (read_home_df): New.
1097 (read_ef_odf): Generalized.
1098 (read_ef_tokeninfo): New.
1099 (read_p15_info): Set serialnumber from TokenInfo.
1100 (app_select_p15): Don't munge serialNumber - that must be done
1103 * iso7816.c (iso7816_read_binary): Use Le=0 when reading all
1104 data. Handle 6C00 error and take 6B00 as indication for EOF.
1105 * apdu.h (SW_EXACT_LENGTH_P): New.
1106 * apdu.c (new_reader_slot, reset_pcsc_reader, pcsc_get_status)
1107 (open_pcsc_reader): Set new reader state IS_T0.
1108 (apdu_send_le): When doing T=0 make sure not to send Lc and Le.
1109 Problem reported by Carl Meijer.
1110 (apdu_send_direct): Initialize RESULTLEN.
1111 * pcsc-wrapper.c (handle_status): Return the current protocol as
1114 2005-08-05 Werner Koch <wk@g10code.com>
1116 * apdu.c (open_rapdu_reader): Set the reader number.
1118 2005-07-05 Werner Koch <wk@g10code.com>
1120 * app-openpgp.c (do_readkey): Return a mallcoed copy of the key as
1121 required by the description. Thanks to Moritz for tracking this
1124 2005-06-21 Werner Koch <wk@g10code.com>
1126 * scdaemon.c (main): ifdef call to ccid_set_debug_level.
1128 * apdu.c (reset_pcsc_reader, open_pcsc_reader): Cast size_t to
1131 2005-06-06 Werner Koch <wk@g10code.com>
1133 * scdaemon.c (main): New option --debug-allow-core-dump.
1135 2005-06-03 Werner Koch <wk@g10code.com>
1137 * scdaemon.c (handle_connections): Make sure that the signals we
1138 are handling are not blocked.Block signals while creating new
1140 (handle_connections): Include the file descriptor into the name of
1143 2005-06-02 Werner Koch <wk@g10code.com>
1145 * app.c (app_dump_state, dump_mutex_state): New.
1146 * scdaemon.c (handle_signal): Print it on SIGUSR1.
1148 * app-openpgp.c (do_writekey): Typo fix.
1150 * command.c (open_card): Check for locked state even if an
1151 application context is available.
1153 * app-common.h: Add REF_COUNT field.
1154 * app.c (release_application, select_application): Implement
1155 reference counting to share the context beween connections.
1157 * app.c (lock_reader, unlock_reader): Take SLOT instead of APP as
1158 argument. Changed all callers.
1159 (select_application): Unlock the reader on error. This should fix
1160 the hangs I noticed last week.
1162 * scdaemon.h: Removed card_ctx_t cruft.
1164 2005-06-01 Werner Koch <wk@g10code.com>
1166 * scdaemon.c: Include mkdtemp.h.
1168 2005-05-31 Werner Koch <wk@g10code.com>
1170 * tlv.c [GNUPG_MAJOR_VERSION==1]: Define constants instead of
1171 including a gnupg 1.4 header.
1173 2005-05-30 Werner Koch <wk@g10code.com>
1175 * tlv.c: Add hack to compile without gpg-error.h when used with
1178 2005-05-23 Werner Koch <wk@g10code.com>
1180 * Makefile.am: Do not build sc-copykeys anymore.
1182 * app-openpgp.c (app_openpgp_storekey, app_openpgp_readkey)
1183 (app_openpgp_cardinfo): Removed.
1185 * ccid-driver.c (parse_ccid_descriptor): SCR335 FW version 5.14 is
1187 (do_close_reader): Never do a reset. The caller should instead
1188 make sure that the reader has been closed properly. The new retry
1189 code in ccid_slot_status will make sure that the readersatrts up
1190 fine even if the last process didn't closed the USB connection
1192 (ccid_get_atr): For certain readers try switching to ISO mode.
1193 Thanks to Ludovic Rousseau for this hint and the magic numbers.
1194 (print_command_failed): New.
1195 (bulk_in): Use it here. Add new arg NO_DEBUG.
1196 (ccid_slot_status): Disabled debugging.
1198 2005-05-21 Werner Koch <wk@g10code.com>
1200 * scdaemon.c (handle_signal): Print thread info on SIGUSR1.
1202 2005-05-20 Werner Koch <wk@g10code.com>
1204 * ccid-driver.c: Replaced macro DEBUG_T1 by a new debug level.
1205 (parse_ccid_descriptor): Mark SCR335 firmware version 5.18 good.
1206 (ccid_transceive): Arghhh. The seqno is another bit in the
1207 R-block than in the I block, this was wrong at one place.
1209 * scdaemon.c: New options --debug-ccid-driver and
1210 --debug-disable-ticker.
1212 * app-openpgp.c (do_genkey, do_writekey): Factored code to check
1213 for existing key out into ..
1214 (does_key_exist): .. New function.
1216 2005-05-19 Werner Koch <wk@g10code.com>
1218 * tlv.c (parse_sexp): New.
1220 * command.c (cmd_writekey): New.
1221 * app.c (app_writekey): New.
1222 * app-common.c (app_t): Add function ptr WRITEKEY.
1223 * app-openpgp.c (do_writekey): New.
1225 * app-openpgp.c (do_readkey) [GNUPG_MAJOR_VERSION==1]: Return error.
1226 * app-common.h (app_t) [GNUPG_MAJOR_VERSION==1]: Add a field to
1227 store the Assuan context.
1229 2005-05-17 Werner Koch <wk@g10code.com>
1231 * scdaemon.c: Removed non-pth code paths.
1232 (create_socket_name, create_server_socket): New. Taken from
1234 (cleanup): Changed to adjust for SOCKET_NAME now being malloced.
1235 (ticker_thread): Always use pth_event_occurred; it is again
1236 defined for all decent PTH versions.
1237 (handle_connections): New. Based on the gpg-agent code.
1238 (start_connection_thread): Ditto.
1239 (ticker_thread): Removed.
1240 (cleanup_sh): Removed.
1241 (main): Run the handler for the pipe server in a separate
1242 thread. This replaces the old ticker thread.
1243 (scd_get_socket_name): New.
1244 * command.c (cmd_getinfo): New command GETINFO.
1245 (scd_command_handler): Renamed argument and changed code to use an
1246 already connected FD.
1248 2005-05-15 Werner Koch <wk@g10code.com>
1250 * app.c, app-common.h, app-nks.c, app-p15.c, app-dinsig.c
1251 * app-openpgp.c: Change most function return types from int to
1253 * command.c (pin_cb): Ditto.
1254 * sc-copykeys.c (pincb): Ditto.
1256 * app.c (lock_reader, unlock_reader): New. Changed call handler
1257 wrappers to make use of these functions.
1259 2005-05-07 Werner Koch <wk@g10code.com>
1261 * ccid-driver.c (do_close_reader): Don't do a reset before close.
1262 Some folks reported that it makes the SCR335 hang less often.
1263 Look at the source on how to re-enable it.
1265 2005-04-27 Werner Koch <wk@g10code.com>
1267 * app-p15.c (micardo_mse): New.
1269 * iso7816.c (iso7816_manage_security_env): Allow passing DATA as
1270 NULL to indicate an empty Lc.
1271 * tlv.c (find_tlv): Check that a found object fits into the
1273 (find_tlv_unchecked): New as replacement for the old non-checking
1275 * app.c (select_application): Keep on using the non-checking
1277 * app-openpgp.c (get_one_do, dump_all_do): Ditto.
1280 Removal of the old OpenSC based code.
1282 * app-p15.c: New. Basic support for pkcs15 cards without OpenSC.
1283 There are quite a couple of things missing but at least I can use
1284 my old TCOS cards from the Aegypten-1 development for signing.
1285 * app.c (select_application): Detect pkcs15 applications.
1286 * Makefile.am (scdaemon_SOURCES): Removed card.c, card-common.h
1287 and card-p15.c because they are now obsolete. Added app-p15.c.
1288 Removed all OpenSC stuff.
1289 * command.c (do_reset, open_card, cmd_serialno, cmd_learn)
1290 (cmd_readcert, cmd_readkey, cmd_pksign, cmd_pkdecrypt): Removed
1291 all special cases for the old card.c based mechanisms.
1292 * scdaemon.c, apdu.c: Removed all special cases for OpenSC.
1294 2005-04-20 Werner Koch <wk@g10code.com>
1296 * command.c: Use GPG_ERR_LOCKED instead of EBUSY.
1298 2005-04-14 Werner Koch <wk@g10code.com>
1300 * app-openpgp.c (retrieve_key_material): Rewritten. Return a
1302 (retrieve_next_token): Removed.
1303 (retrieve_fpr_from_card): Rewritten to make use of DO caching and
1304 to take the KEYNO as arg.
1305 (get_public_key): Renamed variable for clarity.
1307 2005-04-12 Werner Koch <wk@g10code.com>
1309 Basic support for several sessions.
1311 * command.c (scd_command_handler): Replace the primary_connection
1312 stuff by a real connection list. Release the local context on
1314 (scd_update_reader_status_file): Update accordingly. Send signal
1315 to all connections who registered an event signal.
1316 (cmd_lock, cmd_unlock, register_commands): New commands LOCK and
1318 (cmd_setdata, cmd_pksign, cmd_pkauth, cmd_pkdecrypt, cmd_setattr)
1319 (cmd_genkey, cmd_passwd, cmd_checkpin): Return an error if reader
1321 (do_reset): Handle locking.
1322 (open_card): Ditto. Share the reader slot with other sessions.
1323 (get_reader_slot): New.
1324 (update_card_removed): New. Use it in the TEST_CARD_REMOVAL macro.
1326 2005-04-07 Werner Koch <wk@g10code.com>
1328 * app-openpgp.c (do_check_pin): Add hack to allow verification of
1330 (get_public_key): Don't use gcry functions to create S-expressions.
1331 (do_deinit, do_readkey, do_genkey, send_keypair_info): Adjust for
1334 2005-03-29 Moritz Schulte <moritz@g10code.com>
1336 * app-openpgp.c (retrieve_fpr_from_card): New function.
1337 (retrieve_next_token): New function.
1338 (retrieve_key_material): New function.
1339 (get_public_key): Implement retrival of key through expernal
1340 helper (gpg) in case the openpgp card is not cooperative enough.
1342 2005-03-16 Werner Koch <wk@g10code.com>
1344 * ccid-driver.c (parse_ccid_descriptor): Make SCM workaround
1345 reader type specific.
1346 (scan_or_find_devices): Do not check the interface subclass in the
1347 SPR532 kludge, as this depends on the firmware version.
1348 (ccid_get_atr): Get the Slot status first. This solves the
1349 problem with readers hanging on recent Linux 2.6.x.
1350 (bulk_in): Add argument TIMEOUT and changed all callers to pass an
1351 appropriate one. Change the standard timeout from 10 to 5 seconds.
1352 (ccid_slot_status): Add a retry code with an initial short timeout.
1353 (do_close_reader): Do an usb_reset before closing the reader.
1355 2005-02-25 Werner Koch <wk@g10code.com>
1357 * app-openpgp.c (get_public_key): Make sure not to return negative
1359 (do_sign): Allow passing of indata with algorithm prefix.
1360 (do_auth): Allow OPENPGP.3 as an alternative ID.
1362 * app.c (app_getattr): Return just the S/N but not the timestamp.
1364 2005-02-24 Werner Koch <wk@g10code.com>
1366 * app.c (app_getattr): Return APPTYPE or SERIALNO type even if the
1367 application does dot support the getattr call.
1369 * app-openpgp.c (get_one_do): Never try to get a non cacheable
1370 object from the cache.
1371 (get_one_do): Add new arg to return an error code. Changed all
1373 (do_getattr): Let it return a proper error code.
1375 * app.c (select_application): Return an error code and the
1376 application context in an new arg.
1377 * command.c (open_card): Adjusted for that. Don't use the
1378 fallback if no card is present. Return an error if the card has
1379 been removed without a reset.
1380 (do_reset, cmd_serialno): Clear that error flag.
1381 (TEST_CARD_REMOVAL): New. Use it with all command handlers.
1382 (scd_update_reader_status_file): Set the error flag on all changes.
1384 * scdaemon.c (ticker_thread): Termintate if a shutdown is pending.
1386 * apdu.c: Added some PCSC error codes.
1387 (pcsc_error_to_sw): New.
1388 (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu)
1389 (open_pcsc_reader): Do proper error code mapping.
1391 2005-03-16 Werner Koch <wk@g10code.com>
1393 * ccid-driver.c (parse_ccid_descriptor): Make SCM workaround
1394 reader type specific.
1395 (scan_or_find_devices): Do not check the interface subclass in the
1396 SPR532 kludge, as this depends on the firmware version.
1397 (ccid_get_atr): Get the Slot status first. This solves the
1398 problem with readers hanging on recent Linux 2.6.x.
1400 2005-02-22 Werner Koch <wk@g10code.com>
1402 * app-openpgp.c (app_local_s): New field PK.
1403 (do_deinit, do_genkey, app_openpgp_storekey): Clear it.
1404 (get_public_key, send_keypair_info): New.
1405 (do_learn_status): Send KEYPAIR info
1407 * app-common.h (app_ctx_t): Add function pointer READKEY.
1408 * app.c (app_readkey): New.
1409 * command.c (cmd_readkey): Use READKEY function if possible.
1411 2005-01-26 Werner Koch <wk@g10code.com>
1413 * ccid-driver.c (parse_ccid_descriptor): Need the CSM workaround
1414 also for newer firmware versions. Need to get a list of fixed
1415 firmware versions and use that.
1417 2005-01-25 Werner Koch <wk@g10code.com>
1419 * apdu.c (apdu_send_le, apdu_send_direct): Fix some compiler
1422 * app-openpgp.c (get_cached_data): New arg GET_IMMEDIATE to bypass
1423 the cache. Changed all callers.
1424 (get_one_do): Bypass the cache if the value would have been read
1425 directly for v1.1 cards.It makes things a bit slower but obnly for
1426 1.0 cards and there are not that many cards out in the wild. This
1427 is required to fix a caching bug when generating new keys; as a
1428 side effect of the retrieval of the the C4 DO from the 6E DO the
1429 cached fingerprint will get updated to the old value and later
1430 when signing the generated key the checking of the fingerprint
1431 fails because it won't match the new one. Thanks to Moritz for
1432 analyzing this problem.
1433 (verify_chv3): Removed the CHV status reread logic because we
1434 won't cache the C4 DO anymore.
1436 2004-12-28 Werner Koch <wk@g10code.com>
1438 * ccid-driver.c (find_endpoint): New.
1439 (scan_or_find_devices): Add new args to return endpoint info and
1441 (ccid_open_reader, ccid_shutdown_reader): Take care of these new
1443 (bulk_in, bulk_out): Use the correct endpoints.
1444 (ccid_transceive_apdu_level): New.
1445 (ccid_transceive): Divert to above.
1446 (parse_ccid_descriptor): Allow APDU level exchange mode.
1447 (do_close_reader): Pass the interface number to usb_release_interface.
1449 2004-12-21 Werner Koch <wk@g10code.com>
1451 * scdaemon.c (main): Use default_homedir().
1453 2004-12-18 Werner Koch <wk@g10code.com>
1455 * scdaemon.c (main) [W32]: Remove special Pth initialize..
1457 * scdaemon.h (map_assuan_err): Define in terms of
1458 map_assuan_err_with_source.
1460 2004-12-15 Werner Koch <wk@g10code.com>
1462 * scdaemon.c [W32]: Various hacks to make it run under W32.
1464 * command.c (scd_update_reader_status_file) [W32]: Don't use kill.
1466 * apdu.c [W32]: Disable use of pcsc_wrapper.
1468 * Makefile.am (scdaemon_LDADD): Reorder libs.
1469 (sc_copykeys_LDADD): Add libassuan because it is needed for W32.
1471 2004-12-06 Werner Koch <wk@g10code.com>
1473 * Makefile.am (pkglib_PROGRAMS): Build only for W32.
1475 2004-10-22 Werner Koch <wk@g10code.com>
1477 * app-openpgp.c (verify_chv3): The minium length for CHV3 is
1478 8. Changed string to match the other ones.
1480 2004-10-21 Werner Koch <wk@g10code.com>
1482 * app-openpgp.c (do_sign): Replace asprintf by direct allocation.
1483 This avoids problems with missing vasprintf implementations in
1486 * app-common.h (app_openpgp_storekey: Add prototype.
1488 2004-10-20 Werner Koch <wk@g10code.com>
1490 * sc-investigate: Removed.
1491 * Makefile.am (sc_investigate): Removed.
1493 * pcsc-wrapper.c (load_pcsc_driver): Load get_status_change func.
1494 (handle_open): Succeed even without a present card.
1495 (handle_status, handle_reset): New.
1497 * apdu.c (apdu_open_reader): Load pcsc_get_status_change fucntion.
1498 (pcsc_get_status): Implemented.
1499 (reset_pcsc_reader): Implemented.
1500 (open_pcsc_reader): Succeed even with no card inserted.
1501 (open_ccid_reader): Set LAST_STATUS.
1503 * iso7816.c (iso7816_select_application): Always use 0 for P1.
1505 2004-10-18 Werner Koch <wk@g10code.com>
1507 * ccid-driver.c (ccid_get_atr): Reset T=1 state info.
1509 2004-10-14 Werner Koch <wk@g10code.com>
1511 * app-openpgp.c (parse_login_data): New.
1512 (app_select_openpgp): Call it.
1513 (do_setattr): Reparse it after change.
1515 2004-10-06 Werner Koch <wk@g10code.de>
1517 * ccid-driver.c (ccid_open_reader): Store the vendor ID.
1518 (ccid_transceive_secure): New.
1519 (parse_ccid_descriptor): Workaround for an SCM reader problem.
1521 2004-10-04 Werner Koch <wk@g10code.de>
1523 * ccid-driver.c (send_escape_cmd): New.
1525 2004-09-30 Werner Koch <wk@g10code.com>
1527 * Makefile.am: Adjusted for gettext 0.14.
1529 * app-openpgp.c (do_sign): Add the error string to the verify
1532 2004-09-27 Werner Koch <wk@g10code.com>
1536 * app-openpgp.c: Made all strings translatable.
1537 (verify_chv3) [GNUPG_MAJOR_VERSION]: Make opt.allow_admin
1538 available for use in gnupg 2.
1539 (verify_chv3): Reimplemented countdown showing to use only
1540 functions from this module. Flush the CVH status cache on a
1542 (get_one_do): Hack to bypass the cache for cards versions > 1.0.
1543 (store_fpr): Store the creation date for card version > 1.0.
1545 * app-openpgp.c (app_openpgp_storekey): Call flush_cache.
1546 (get_cached_data): Move local data initialization to ..
1547 (app_select_openpgp): .. here. Read some flags for later use.
1548 (do_getattr): New read-only attribute EXTCAP.
1550 * apdu.c (open_pcsc_reader): Do not print empty reader string.
1552 * ccid-driver.c (do_close_reader): Factored some code out from ...
1553 (ccid_close_reader): ..here.
1554 (ccid_shutdown_reader): New.
1556 * apdu.c (apdu_shutdown_reader): New.
1557 (shutdown_ccid_reader): New.
1559 * apdu.c (open_ccid_reader): New arg PORTSTR. Pass it to
1561 (apdu_open_reader): Pass portstr to open_ccid_reader.
1562 (apdu_open_reader): No fallback if a full CCID reader id has been
1565 * ccid-driver.c (ccid_get_reader_list): New.
1566 (ccid_open_reader): Changed API to take a string for the reader.
1567 Removed al the cruft for the libusb development vesion which seems
1568 not to be maintained anymore and there are no packages anyway.
1569 The stable library works just fine.
1570 (struct ccid_reader_id_s): Deleted and replaced everywhere by a
1572 (usb_get_string_simple): Removed.
1573 (bulk_in): Do valgrind hack here and not just everywhere.
1575 * ccid-driver.c (read_device_info): Removed.
1576 (make_reader_id, scan_or_find_devices): New.
1577 (ccid_open_reader): Simplified by make use of the new functions.
1578 (ccid_set_debug_level): New. Changed the macros to make use of
1579 it. It has turned out that it is often useful to enable debugging
1580 at runtime so I added this option.
1582 From gnupg 1.3 - David Shaw <dshaw@jabberwocky.com>
1584 * app-openpgp.c (verify_chv3): Show a countdown of how many wrong
1585 admin PINs can be entered before the card is locked.
1587 * app-openpgp.c (get_cached_data): Avoid mallocing zero since it
1588 breaks us when using --enable-m-guard.
1590 * ccid-driver.c (usb_get_string_simple): Replacement function to
1591 work with older libusb.
1593 * ccid-driver.c (read_device_info): Fix segfault when usb device
1595 (ccid_open_reader): Allow working with an even older version of
1596 libusb (usb_busses global instead of usb_get_busses()).
1598 2004-09-11 Werner Koch <wk@g10code.com>
1600 * app-openpgp.c (app_select_openpgp): Its app_munge_serialno and
1601 not app_number_serialno.
1603 2004-08-20 Werner Koch <wk@g10code.de>
1605 * app.c (select_application): Fixed serial number extraction and
1606 added the BMI card workaround.
1607 (app_munge_serialno): New.
1608 * app-openpgp.c (app_select_openpgp): Try munging serialno.
1610 2004-08-05 Werner Koch <wk@g10code.de>
1612 * scdaemon.c (main): New option --disable-application.
1613 * app.c (is_app_allowed): New.
1614 (select_application): Use it to check for disabled applications.
1616 * ccid-driver.h (CCID_DRIVER_ERR_ABORTED): New.
1617 * ccid-driver.c (ccid_open_reader): Support the stable 0.1 version
1619 (ccid_get_atr): Handle short messages.
1621 * apdu.c (my_rapdu_get_status): Implemented.
1623 2004-07-27 Moritz Schulte <moritz@g10code.com>
1625 * apdu.c: Include <signal.h>.
1627 * Makefile.am: Use @DL_LIBS@ instead of -ldl.
1629 2004-07-22 Werner Koch <wk@g10code.de>
1631 * Makefile.am: Make OpenSC lib link after libgcrypt. Do not link
1633 * apdu.c: Don't use Pth if we use OpenSC.
1634 * sc-investigate.c, scdaemon.c: Disable use of pth if OpenSC is used.
1636 * scdaemon.c (main): Bumbed thread stack size up to 512k.
1638 2004-07-16 Werner Koch <wk@gnupg.org>
1640 * apdu.c (reader_table_s): Add function pointers for the backends.
1641 (apdu_close_reader, apdu_get_status, apdu_activate)
1642 (send_apdu): Make use of them.
1643 (new_reader_slot): Intialize them to NULL.
1644 (dump_ccid_reader_status, ct_dump_reader_status): New.
1645 (dump_pcsc_reader_status): New.
1646 (open_ct_reader, open_pcsc_reader, open_ccid_reader)
1647 (open_osc_reader, open_rapdu_reader): Intialize function pointers.
1648 (ct_activate_card, ct_send_apdu, pcsc_send_apdu, osc_send_apdu)
1649 (error_string): Removed. Replaced by apdu_strerror.
1650 (get_ccid_error_string): Removed.
1651 (ct_activate_card): Remove the unused loop.
1652 (reset_ct_reader): Implemented.
1653 (ct_send_apdu): Activate the card if not yet done.
1654 (pcsc_send_apdu): Ditto.
1656 2004-07-15 Werner Koch <wk@gnupg.org>
1658 * ccid-driver.h: Add error codes.
1659 * ccid-driver.c: Implement more or less proper error codes all
1662 * apdu.c (apdu_send_direct): New.
1663 (get_ccid_error_string): Add some error code mappings.
1664 (send_apdu): Pass error codes along for drivers already supporting
1666 (host_sw_string): New.
1667 (get_ccid_error_string): Use above.
1668 (send_apdu_ccid): Reset the reader if it has not yet been done.
1669 (open_ccid_reader): Don't care if the ATR can't be read.
1670 (apdu_activate_card): New.
1671 (apdu_strerror): New.
1672 (dump_reader_status): Only enable it with opt.VERBOSE.
1673 * iso7816.c (map_sw): Add mappings for the new error codes.
1675 2004-07-02 Werner Koch <wk@gnupg.org>
1677 * apdu.c (open_ct_reader, open_pcsc_reader, open_ccid_reader)
1678 (reset_ccid_reader, open_osc_reader): Call dump_reader_status only
1681 2004-07-01 Werner Koch <wk@gnupg.org>
1683 * sc-investigate.c: Initialize Pth which is now required.
1684 (interactive_shell): New command "readpk".
1686 * app-openpgp.c (do_getattr): Fix for sending CA-FPR.
1688 2004-06-30 Werner Koch <wk@gnupg.org>
1690 * app-openpgp.c (app_openpgp_readkey): Fixed check for valid
1693 2004-06-18 Werner Koch <wk@g10code.com>
1695 * sc-investigate.c (my_read_line): Renamed from read_line.
1697 2004-06-16 Werner Koch <wk@gnupg.org>
1699 * apdu.c (osc_get_status): Fixed type in function name. Noted by
1700 Axel Thimm. Yes, I didn't tested it with OpenSC :-(.
1702 2004-04-28 Werner Koch <wk@gnupg.org>
1704 * app-openpgp.c (do_setattr): Sync FORCE_CHV1.
1706 2004-04-27 Werner Koch <wk@gnupg.org>
1708 * app-common.h: Do not include ksba.h for gnupg 1.
1710 2004-04-26 Werner Koch <wk@gnupg.org>
1712 * app-common.h: New members FNC.DEINIT and APP_LOCAL.
1713 * app.c (release_application): Call new deconstructor.
1714 * app-openpgp.c (do_deinit): New.
1715 (get_cached_data, flush_cache_item, flush_cache_after_error)
1717 (get_one_do): Replaced arg SLOT by APP. Make used of cached data.
1718 (verify_chv2, verify_chv3): Flush some cache item after error.
1719 (do_change_pin): Ditto.
1721 (do_setattr): Flush cache item.
1722 (do_genkey): Flush the entire cache.
1723 (compare_fingerprint): Use cached data.
1725 * scdaemon.c (main): Do the last change the usual way. This is so
1726 that we can easily test for versioned config files above.
1728 2004-04-26 Marcus Brinkmann <marcus@g10code.de>
1730 * scdaemon.c (main): For now, always print default filename for
1731 --gpgconf-list, and never /dev/null.
1733 2004-04-21 Werner Koch <wk@gnupg.org>
1735 * command.c (scd_update_reader_status_file): Send a signal back to
1737 (option_handler): Parse the new event-signal option.
1739 * scdaemon.c (handle_signal): Do not use SIGUSR{1,2} anymore for
1740 changing the verbosity.
1742 2004-04-20 Werner Koch <wk@gnupg.org>
1744 * command.c (scd_update_reader_status_file): Write status files.
1746 * app-help.c (app_help_read_length_of_cert): Fixed calculation of
1749 * pcsc-wrapper.c: New.
1750 * Makefile.am (pkglib_PROGRAMS): Install it here.
1751 * apdu.c (writen, readn): New.
1752 (open_pcsc_reader, pcsc_send_apdu, close_pcsc_reader): Use the
1753 pcsc-wrapper if we are using Pth.
1754 (apdu_send_le): Reinitialize RESULTLEN. Handle SW_EOF_REACHED
1757 2004-04-19 Werner Koch <wk@gnupg.org>
1759 * ccid-driver.c (parse_ccid_descriptor): Store some of the reader
1760 features away. New arg HANDLE
1761 (read_device_info): New arg HANDLE. Changed caller.
1762 (bulk_in): Handle time extension requests.
1763 (ccid_get_atr): Setup parameters and the IFSD.
1764 (compute_edc): New. Factored out code.
1765 (ccid_transceive): Use default NADs when required.
1767 2004-04-14 Werner Koch <wk@gnupg.org>
1769 * scdaemon.h (server_control_s): Add member READER_SLOT.
1770 * scdaemon.c (scd_init_default_ctrl): Initialize READER_SLOT to -1.
1771 * command.c (open_card): Reuse an open slot.
1772 (reset_notify): Just reset the slot if supported by the reader.
1773 (do_reset): Factored code from above out.
1774 (scd_command_handler): Use it for cleanup.
1776 * apdu.h: New pseudo stati SW_HOST_NOT_SUPPORTED,
1777 SW_HOST_LOCKING_FAILED and SW_HOST_BUSY.
1778 * iso7816.c (map_sw): Map it.
1780 * ccid-driver.c (ccid_slot_status): Add arg STATUSBITS.
1781 * apdu.c (apdu_get_status): New.
1782 (ct_get_status, pcsc_get_status, ocsc_get_status): New stubs.
1783 (get_status_ccid): New.
1785 (reset_ct_reader, reset_pcsc_reader, reset_osc_reader): New stubs.
1786 (reset_ccid_reader): New.
1787 (apdu_enum_reader): New.
1789 * apdu.c (lock_slot, trylock_slot, unlock_slot): New helpers.
1790 (new_reader_slot) [USE_GNU_PTH]: Init mutex.
1791 (apdu_reset, apdu_get_status, apdu_send_le): Run functions
1794 * command.c (scd_update_reader_status_file): New.
1795 * scdaemon.c (handle_tick): Call it.
1797 2004-04-13 Werner Koch <wk@gnupg.org>
1799 * scdaemon.c: Convert to a Pth application.
1800 (handle_signal, ticker_thread, handle_tick): New.
1801 (main): Fire up the ticker thread in server mode.
1803 2004-03-23 Werner Koch <wk@gnupg.org>
1805 * scdaemon.c (main) <gpgconf_list>: Fixed output for pcsc_driver.
1807 2004-03-17 Werner Koch <wk@gnupg.org>
1809 * tlv.c (parse_ber_header): Do not check for tag overflow - it
1810 does not make sense. Simplified the check for length overflow.
1812 * scdaemon.c (main) <gpgconf>: Fixed default value quoting.
1814 2004-03-16 Werner Koch <wk@gnupg.org>
1816 * app-dinsig.c: Implemented. Based on app-nks.c and card-dinsig.c
1817 * app-nks.c (get_length_of_cert): Removed.
1819 (app_help_read_length_of_cert): New. Code taken from above. New
1820 optional arg R_CERTOFF.
1822 * card-dinsig.c: Removed.
1823 * card.c (card_get_serial_and_stamp): Do not bind to the old and
1824 never finsiged card-dinsig.c.
1826 * iso7816.c (iso7816_read_binary): Allow for an NMAX > 254.
1828 2004-03-11 Werner Koch <wk@gnupg.org>
1830 * scdaemon.h (out_of_core): Removed. Replaced callers by standard
1833 * apdu.c, iso7816.c, ccid-driver.c [GNUPG_SCD_MAIN_HEADER]: Allow
1834 to include a header defined by the compiler. This helps us to
1835 reuse the source in other software.
1837 2004-03-10 Werner Koch <wk@gnupg.org>
1839 * iso7816.c (iso7816_read_record): New arg SHORT_EF. Changed all
1842 2004-02-18 Werner Koch <wk@gnupg.org>
1844 * sc-investigate.c (main): Setup the used character set.
1845 * scdaemon.c (main): Ditto.
1847 * scdaemon.c (set_debug): New. Add option --debug-level.
1848 (main): Add option --gpgconf-list.
1850 2004-02-12 Werner Koch <wk@gnupg.org>
1852 * Makefile.am: Include cmacros.am for common flags.
1854 2004-01-29 Werner Koch <wk@gnupg.org>
1856 * command.c (reset_notify): Release the application context and
1859 2004-01-28 Werner Koch <wk@gnupg.org>
1861 * iso7816.c (iso7816_manage_security_env): New.
1862 (iso7816_decipher): Add PADIND argument.
1864 2004-01-27 Werner Koch <wk@gnupg.org>
1866 * command.c (cmd_readcert, cmd_readkey): Work on a copy of LINE.
1868 * app-common.h (app_ctx_s): Added readcert field.
1869 * app.c (app_readcert): New.
1870 * tlv.c (parse_ber_header): Added; taken from libksba.
1872 2004-01-26 Werner Koch <wk@gnupg.org>
1874 * card.c (map_sc_err): Use SCD as the error source.
1876 * command.c (open_card): ADD arg NAME to allow requesting a
1877 specific application. Changed all callers.
1878 (cmd_serialno): Allow optional argument to select the desired
1883 * scdaemon.h (opt): Add READER_PORT.
1884 * scdaemon.c (main): Set it here.
1885 * app.c (app_set_default_reader_port): Removed.
1886 (select_application): Add NAME arg and figure out a
1887 default serial number from the GDO. Add SLOT arg and remove all
1889 (release_application): New.
1890 (app_write_learn_status): Output an APPTYPE status line.
1891 * command.c (open_card): Adapt for select_application change.
1892 * app-openpgp.c (app_select_openpgp): Removed SN and SNLEN args
1893 and set it directly. Changed all callers.
1895 2004-01-25 Werner Koch <wk@gnupg.org>
1897 * iso7816.c (iso7816_select_application): P1 kludge for OpenPGP
1899 * app-openpgp.c (find_tlv): Factor out this function to ..
1900 * tlv.c, tlv.h: .. new.
1902 * scdaemon.h: Introduced app_t and ctrl_t as the new types for APP
1905 2004-01-21 Werner Koch <wk@gnupg.org>
1907 * apdu.c (apdu_send_le): Treat SW_EOF_REACHED as a warning.
1909 2004-01-20 Werner Koch <wk@gnupg.org>
1911 * iso7816.c (iso7816_read_binary): New.
1912 (iso7816_select_file): New.
1913 (iso7816_list_directory): New.
1915 * sc-investigate.c: Add option -i.
1916 (select_app, read_line, interactive_shell): New.
1918 2004-01-16 Werner Koch <wk@gnupg.org>
1920 * apdu.h: Add SW_FILE_NOT_FOUND.
1921 * iso7816.c (map_sw): Map it to GPG_ERR_ENOENT.
1922 * iso7816.c (iso7816_select_file): New.
1924 * app-dinsig.c: New file w/o any real code yet.
1925 * Makefile.am (scdaemon_SOURCES,sc_investigate_SOURCES): Add file.
1927 * sc-investigate.c: Add option --disable-ccid.
1929 2003-12-19 Werner Koch <wk@gnupg.org>
1931 * apdu.c (apdu_send_le): Send a get_response with the indicated
1932 length and not the 64 bytes we used for testing.
1934 * app-openpgp.c (verify_chv2, verify_chv3, do_sign): Check the
1935 minimum length of the passphrase, so that we don't need to
1936 decrement the retry counter.
1938 2003-12-17 Werner Koch <wk@gnupg.org>
1940 * card-p15.c (p15_enum_keypairs): Replaced KRC by RC.
1941 * card-dinsig.c (dinsig_enum_keypairs): Ditto.
1943 2003-12-16 Werner Koch <wk@gnupg.org>
1945 * scdaemon.c (main): Set the prefixes for assuan logging.
1947 2003-11-17 Werner Koch <wk@gnupg.org>
1949 * scdaemon.c, scdaemon.h: New options --allow-admin and --deny-admin.
1950 * app-openpgp.c (verify_chv3): Check it here.
1952 2003-11-12 Werner Koch <wk@gnupg.org>
1954 Adjusted for API changes in Libksba.
1956 2003-10-30 Werner Koch <wk@gnupg.org>
1958 * apdu.c (close_ct_reader, close_pcsc_reader): Implemented.
1959 (get_ccid_error_string): New. Not very useful messages, though.
1961 2003-10-25 Werner Koch <wk@gnupg.org>
1963 * ccid-driver.c (ccid_open_reader): Return an error if no USB
1966 * command.c (cmd_genkey, cmd_passwd): Fixed faulty use of
1969 * apdu.c (apdu_open_reader): Hacks for PC/SC under Windows.
1971 2003-10-20 Werner Koch <wk@gnupg.org>
1973 * command.c (cmd_checkpin): New.
1974 (register_commands): Add command CHECKPIN.
1975 * app.c (app_check_pin): New.
1976 * app-openpgp.c (check_against_given_fingerprint): New. Factored
1977 out that code elsewhere.
1978 (do_check_pin): New.
1980 2003-10-10 Werner Koch <wk@gnupg.org>
1982 * ccid-driver.c (ccid_close_reader): New.
1984 * apdu.c (close_ccid_reader, close_ct_reader, close_csc_reader)
1985 (close_osc_reader, apdu_close_reader): New. Not all are properly
1988 2003-10-09 Werner Koch <wk@gnupg.org>
1990 * ccid-driver.c (ccid_transceive): Add T=1 chaining for sending.
1992 2003-10-08 Werner Koch <wk@gnupg.org>
1994 * app-openpgp.c (do_getattr): Support SERIALNO and AID.
1996 2003-10-01 Werner Koch <wk@gnupg.org>
1998 * ccid-driver.c: Detect GnuPG 1.3 and include appropriate files.
2000 * app-openpgp.c: Ditto.
2002 (generate_keypair): Renamed to ..
2003 (do_generate_keypair): .. this.
2004 * app-common.h [GNUPG_MAJOR_VERSION]: New.
2005 * iso7816.h [GNUPG_MAJOR_VERSION]: Include cardglue.h
2007 2003-09-30 Werner Koch <wk@gnupg.org>
2009 * command.c (cmd_getattr): New command GETATTR.
2010 * app.c (app_setattr): New.
2012 (do_learn_status): Reimplemented in terms of do_getattr.
2014 * app-openpgp.c (do_change_pin): Make sure CVH1 and CHV2 are
2016 (verify_chv2, verify_chv3): New. Factored out common code.
2017 (do_setattr, do_sign, do_auth, do_decipher): Change the names of
2018 the prompts to match that we have only 2 different PINs.
2019 (app_select_openpgp): Check whether the card enforced CHV1.
2020 (convert_sig_counter_value): New. Factor out code from
2023 2003-09-28 Werner Koch <wk@gnupg.org>
2025 * app-openpgp.c (dump_all_do): Use gpg_err_code and not gpg_error.
2027 2003-09-19 Werner Koch <wk@gnupg.org>
2029 * ccid-driver.c (parse_ccid_descriptor): New.
2030 (read_device_info): New.
2031 (ccid_open_reader): Check that the device has all required features.
2033 2003-09-06 Werner Koch <wk@gnupg.org>
2035 * scdaemon.c (main): --pcsc-driver again defaults to pcsclite.
2036 David Corcoran was so kind to remove the GPL incompatible
2037 advertisng clause from pcsclite.
2038 * apdu.c (apdu_open_reader): Actually make pcsc-driver option work.
2040 2003-09-05 Werner Koch <wk@gnupg.org>
2042 * ccid-driver.c: More work, data can now actually be retrieved.
2043 * ccid-driver.c, ccid-driver.h: Alternativley allow use under BSD
2046 2003-09-02 Werner Koch <wk@gnupg.org>
2048 * scdaemon.c, scdaemon.h: New option --pcsc-ccid.
2049 * ccid-driver.c, ccid-driver.h: New but far from being useful.
2050 * Makefile.am: Add above.
2051 * apdu.c: Add support for that ccid driver.
2053 2003-08-26 Timo Schulz <twoaday@freakmail.de>
2055 * apdu.c (new_reader_slot): Only set 'is_osc' when OpenSC
2058 2003-08-25 Werner Koch <wk@gnupg.org>
2060 * command.c (cmd_setattr): Use a copy of LINE.
2061 (cmd_genkey): Use a copy of KEYNO.
2062 (cmd_passwd): Use a copy of CHVNOSTR.
2063 (cmd_pksign, cmd_pkauth, cmd_pkdecrypt): s/strdup/xtrystrdup/.
2065 2003-08-19 Werner Koch <wk@gnupg.org>
2067 * scdaemon.c, scdaemon.h: New option --pcsc-driver.
2068 * apdu.c (apdu_open_reader): Use that option here instead of a
2071 2003-08-18 Werner Koch <wk@gnupg.org>
2073 * Makefile.am: Add OPENSC_LIBS to all programs.
2075 * scdaemon.c, scdaemon.h: New option --disable-opensc.
2076 * card.c (card_open): Implement it.
2077 * apdu.c (open_osc_reader, osc_send_apdu): New.
2078 (apdu_open_reader) [HAVE_OPENSC]: Use the opensc driver if not
2080 (error_string) [HAVE_OPENSC]: Use sc_strerror.
2081 (send_apdu) [HAVE_OPENSC]: Call osc_apdu_send.
2083 * card-p15.c (p15_enum_keypairs, p15_prepare_key): Adjusted for
2086 2003-08-14 Timo Schulz <twoaday@freakmail.de>
2088 * apdu.c (ct_activate_card): Change the code a little to avoid
2089 problems with other readers.
2090 * Always use 'dynload.h' instead of 'dlfcn.h'.
2092 2003-08-05 Werner Koch <wk@gnupg.org>
2094 * app-openpgp.c (dump_all_do): Don't analyze constructed DOs after
2097 2003-08-04 Werner Koch <wk@gnupg.org>
2099 * app.c (app_set_default_reader_port): New.
2100 (select_application): Use it here.
2101 * scdaemon.c (main): and here.
2102 * sc-copykeys.c: --reader-port does now take a string.
2103 * sc-investigate.c, scdaemon.c: Ditto.
2104 * apdu.c (apdu_open_reader): Ditto. Load pcsclite if no ctapi
2105 driver is configured. Always include code for ctapi.
2106 (new_reader_slot): Don't test for already used ports and remove
2108 (open_pcsc_reader, pcsc_send_apdu, pcsc_error_string): New.
2109 (apdu_send_le): Changed RC to long to cope with PC/SC.
2111 * scdaemon.c, scdaemon.h: New option --ctapi-driver.
2112 * sc-investigate.c, sc-copykeys.c: Ditto.
2114 2003-07-31 Werner Koch <wk@gnupg.org>
2116 * Makefile.am (scdaemon_LDADD): Added INTLLIBS.
2118 2003-07-28 Werner Koch <wk@gnupg.org>
2120 * app-openpgp.c (do_setattr): Change implementation. Allow all
2123 2003-07-27 Werner Koch <wk@gnupg.org>
2125 Adjusted for gcry_mpi_print and gcry_mpi_scan API change.
2127 2003-07-24 Werner Koch <wk@gnupg.org>
2129 * app-openpgp.c (do_learn_status): Print more status information.
2130 (app_select_openpgp): Store the card version.
2131 (store_fpr): Add argument card_version and fix DOs for old cards.
2132 (app_openpgp_storekey): Likewise.
2134 2003-07-23 Werner Koch <wk@gnupg.org>
2136 * command.c (cmd_pkauth): New.
2137 (cmd_setdata): Check whether data was given at all to avoid
2138 passing 0 to malloc.
2140 * app.c (app_auth): New.
2141 * app-openpgp.c (do_auth): New.
2143 2003-07-22 Werner Koch <wk@gnupg.org>
2145 * command.c (cmd_passwd): New.
2146 * app.c (app_change_pin): New.
2147 * app-openpgp.c (do_change_pin): New.
2148 * iso7816.c (iso7816_reset_retry_counter): Implemented.
2150 * sc-investigate.c (main): New option --gen-random.
2151 * iso7816.c (iso7816_get_challenge): Don't create APDUs with a
2152 length larger than 255.
2154 2003-07-17 Werner Koch <wk@gnupg.org>
2156 * command.c (cmd_random): New command RANDOM.
2158 * iso7816.c (map_sw): New. Use it in this file to return
2159 meaningful error messages. Changed all public fucntions to return
2161 (iso7816_change_reference_data): New.
2162 * apdu.c (apdu_open_reader): Use faked status words for soem
2165 2003-07-16 Werner Koch <wk@gnupg.org>
2167 * apdu.c (apdu_send_simple): Use apdu_send_le so that we can
2168 specify not to send Le as it should be.
2170 2003-07-15 Werner Koch <wk@gnupg.org>
2172 * Makefile.am: Add sc-copykeys program.
2173 * sc-copykeys.c: New.
2174 * app-openpgp.c (app_openpgp_storekey): New.
2175 (app_openpgp_cardinfo): New.
2177 (store_fpr): And use it here to get the actual length in bit.
2179 2003-07-03 Werner Koch <wk@gnupg.org>
2181 * app-openpgp.c (do_setattr): Add setting of the URL.
2182 (app_select_openpgp): Dump card data only in very verbose mode.
2185 2003-07-02 Werner Koch <wk@gnupg.org>
2187 * app-openpgp.c (get_sig_counter): New.
2188 (do_sign): Print the signature counter and enable the PIN callback.
2189 (do_genkey): Implement the PIN callback.
2191 2003-07-01 Werner Koch <wk@gnupg.org>
2193 * app-openpgp.c (store_fpr): Fixed fingerprint calculation.
2195 2003-06-26 Werner Koch <wk@gnupg.org>
2197 * app-openpgp.c (find_tlv): Fixed length header parsing.
2199 * app.c (app_genkey): New.
2200 * command.c (cmd_genkey): New.
2202 2003-06-25 Werner Koch <wk@gnupg.org>
2204 * command.c (percent_plus_unescape): New.
2207 2003-06-24 Werner Koch <wk@gnupg.org>
2209 * command.c (send_status_info): New.
2211 * app-openpgp.c (app_select_openpgp): Replace SLOT arg by APP arg
2212 and setup the function pointers in APP on success. Changed callers.
2214 * app-common.h: New.
2215 * scdaemon.h (APP): New type to handle applications.
2216 (server_control_s): Add an APP context field.
2218 * command.c (cmd_serialno): Handle applications.
2219 (cmd_pksign): Ditto.
2220 (cmd_pkdecrypt): Ditto.
2221 (reset_notify): Ditto.
2222 (cmd_learn): For now return error for application contexts.
2223 (cmd_readcert): Ditto.
2224 (cmd_readkey): Ditto.
2226 2003-06-04 Werner Koch <wk@gnupg.org>
2228 * card.c (map_sc_err): Renamed gpg_make_err to gpg_err_make.
2230 Renamed error codes from INVALID to INV and removed _ERROR suffixes.
2232 2003-06-03 Werner Koch <wk@gnupg.org>
2234 Changed all error codes in all files to the new libgpg-error scheme.
2236 * scdaemon.h: Include gpg-error.h and errno.h
2237 * card.c (map_sc_err): Use unknown for the error source.
2238 * Makefile.am: Link with libgpg-error
2240 2003-05-14 Werner Koch <wk@gnupg.org>
2242 * atr.c, atr.h: New.
2243 * sc-investigate.c: Dump the ATR in a human readable format.
2245 2003-05-08 Werner Koch <wk@gnupg.org>
2247 * scdaemon.h (DBG_CARD_IO_VALUE): New.
2249 * sc-investigate.c: New.
2250 * scdaemon.c (main): Removed --print-atr option.
2252 * iso7816.c, iso7816.h, app-openpgp.c: New.
2254 2003-04-29 Werner Koch <wk@gnupg.org>
2256 * scdaemon.c: New options --print-atr and --reader-port
2257 * apdu.c, apdu.h: New
2259 * card.c, card-p15.c, card-dinsig.c: Allow build without OpenSC.
2261 * Makefile.am (LDFLAGS): Removed.
2263 * command.c (register_commands): Adjusted for new Assuan semantics.
2265 2002-08-21 Werner Koch <wk@gnupg.org>
2267 * scdaemon.c (main): New option --daemon so that the program is
2268 not accidently started in the background.
2270 2002-08-16 Werner Koch <wk@gnupg.org>
2272 * scdaemon.c: Include i18n.h.
2274 * card-common.h (struct p15_private_s): Forward declaration. Add
2276 * card.c (card_close): Make sure private data is released.
2277 (card_enum_certs): New.
2278 * card-p15.c (p15_release_private_data): New.
2279 (init_private_data): New to work around an OpenSC weirdness.
2280 (p15_enum_keypairs): Do an OpenSC get_objects only once.
2281 (p15_enum_certs): New.
2282 (card_p15_bind): Bind new function.
2283 * command.c (cmd_learn): Return information about the certificates.
2285 2002-08-09 Werner Koch <wk@gnupg.org>
2287 * card.c (card_get_serial_and_stamp): Use the tokeinfo serial
2288 number as a fallback. Add a special prefix for serial numbers.
2290 2002-07-30 Werner Koch <wk@gnupg.org>
2292 Changes to cope with OpenSC 0.7.0:
2294 * card.c: Removed the check for the packed opensc version.
2295 Changed include file names of opensc.
2296 (map_sc_err): Adjusted error codes for new opensc version.
2297 * card-p15.c: Changed include filename of opensc.
2298 * card-dinsig.c: Ditto.
2300 * card-p15.c (p15_decipher): Add flags argument to OpenSC call.
2302 2002-07-24 Werner Koch <wk@gnupg.org>
2304 * card.c (find_simple_tlv, find_iccsn): New.
2305 (card_get_serial_and_stamp): Improved serial number parser.
2307 2002-06-27 Werner Koch <wk@gnupg.org>
2309 * scdaemon.c (main): Use GNUPG_DEFAULT_HOMEDIR constant.
2311 2002-06-15 Werner Koch <wk@gnupg.org>
2313 * card-dinsig.c: Documented some stuff from the DIN norm.
2315 2002-04-15 Werner Koch <wk@gnupg.org>
2317 * command.c (cmd_pksign, cmd_pkdecrypt): Use a copy of the key ID.
2319 2002-04-12 Werner Koch <wk@gnupg.org>
2321 * scdaemon.c: New option --debug-sc N.
2322 * card.c (card_open): set it here.
2324 * card-p15.c (p15_prepare_key): Factored out common code from ...
2325 (p15_sign, p15_decipher): here and made the decryption work the
2328 2002-04-10 Werner Koch <wk@gnupg.org>
2330 * card.c (card_open): Return immediately when no reader is available.
2332 2002-03-27 Werner Koch <wk@gnupg.org>
2334 * card.c (card_open, card_close): Adjusted for changes in OpenSC.
2336 2002-03-10 Werner Koch <wk@gnupg.org>
2338 * card-p15.c, card-dinsig.c, card-common.h: New.
2339 * card.c: Factored most code out to the new modules, so that we
2340 can better support different types of card applications.
2342 2002-01-26 Werner Koch <wk@gnupg.org>
2344 * scdaemon.c scdaemon.h, command.c: New. Based on the code from
2348 Copyright 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
2350 This file is free software; as a special exception the author gives
2351 unlimited permission to copy and/or distribute it, with or without
2352 modifications, as long as this notice is preserved.
2354 This file is distributed in the hope that it will be useful, but
2355 WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
2356 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.