1 2008-09-23 Marcus Brinkmann <marcus@g10code.com>
3 * apdu.c (pcsc_get_status): Be more relaxed with the usable flag
6 2008-09-23 Werner Koch <wk@g10code.com>
8 * app-openpgp.c (do_setattr): Use command chaining for long
10 * iso7816.c (iso7816_put_data): Add arg EXTENDED_MODE. Change all
12 * apdu.c (apdu_send_simple): Add arg EXTENDED_MODE. Change all
14 (send_le): Implement command chaining.
15 * ccid-driver.c (ccid_transceive_apdu_level): Increase allowed
17 (ccid_transceive): Alow for APDUS of up to 259 bytes.
18 * apdu.h: Add new SW_ codes.
20 2008-09-16 Werner Koch <wk@g10code.com>
22 * command.c (cmd_writecert): New.
23 (register_commands): Register it.
24 * app-common.h (app_ctx_s): Add member WRITECERT.
25 * app.c (app_writecert): New.
26 * app-openpgp.c (do_writecert): New.
27 (parse_historical): New.
29 (dump_all_do): Print only the length of longs DOs.
30 * command.c (cmd_writekey, cmd_apdu, cmd_pksign)
31 (cmd_passwd): Replace open coding by skip_options.
33 2008-08-30 Moritz <moritz@gnu.org>
35 * scdaemon.c (main): Use estream_asprintf instead of asprintf.
36 * command.c (update_reader_status_file): Likewise.
37 (cmd_serialno): Use estream_asprintf instead of asprintf
38 and xfree instead of free to release memory allocated
39 through (estream_)asprintf.
40 (cmd_learn): Likewise.
42 * app-openpgp.c (get_public_key): Likewise.
44 2008-08-18 Werner Koch <wk@g10code.com>
46 * app-openpgp.c (do_setattr): Fix test for v2 cards.
48 2008-08-11 Werner Koch <wk@g10code.com>
50 * apdu.c (reset_pcsc_reader, open_pcsc_reader)
51 (reset_rapdu_reader, open_rapdu_reader): Allow ATRs of up to 33
52 bytes. Provide maximum size of ATR buffer using DIM. Such long
53 ATR are never seen in reality but the PC/SC library of MAC OS X is
54 just too buggy. Reported by Ludovic Rousseau. Fixes bug #948.
56 2008-07-30 Werner Koch <wk@g10code.com>
58 * app-openpgp.c (verify_a_chv): Use xtrymalloc and make the prompt
59 for CHV2 more user friendly.
61 2008-07-03 Werner Koch <wk@g10code.com>
63 * app-openpgp.c (do_readcert): New.
64 (app_local_s): Add fields IS_V2 and MAX_CERTLEN_3.
65 (app_select_openpgp): Set them and register do_readcert.
66 (do_setattr): Allow storing of the certificate.
68 2008-06-25 Werner Koch <wk@g10code.com>
70 * app-dinsig.c (do_sign): Allow for SHA256.
72 2008-06-24 Werner Koch <wk@g10code.com>
74 * app-common.h (app_ctx_s): Renamed reset_mode parameter of
75 change_pin to mode_Flags and make it an unsigned int.
76 (APP_CHANGE_FLAG_RESET, APP_CHANGE_FLAG_NULLPIN): New.
77 * app-openpgp.c (do_change_pin): Adjust for that.
79 * command.c (cmd_passwd): Add option --nullpin.
80 * app-nks.c (do_check_pin, do_change_pin): New.
81 (app_select_nks): Register new functions.
83 2008-04-21 Moritz Schulte <mo@g10code.com> (wk)
85 * app-openpgp.c (verify_a_chv): Make use of the default CHV flag.
87 2008-03-26 Werner Koch <wk@g10code.com>
89 * app-openpgp.c (verify_chv3): Support the keypad.
91 2008-02-09 Marcus Brinkmann <marcus@g10code.de>
93 * scdaemon.c (main): Use CONFIG_FILENAME as filename if it is set
94 in gpgconf-list output.
96 2007-12-10 Werner Koch <wk@g10code.com>
98 * app-openpgp.c (do_decipher): Take care of cryptograms shorter
99 that 128 bytes. Fixes bug#851.
101 2007-11-14 Werner Koch <wk@g10code.com>
103 * scdaemon.c (main): Pass STANDARD_SOCKET flag to
104 create_server_socket.
106 2007-11-13 Werner Koch <wk@g10code.com>
108 * scdaemon.c (start_connection_thread): Do not call
109 assuan_sock_check_nonce if we are running in --server mode.
111 2007-11-07 Werner Koch <wk@g10code.com>
113 * scdaemon.h: Remove errors.h.
115 2007-10-02 Werner Koch <wk@g10code.com>
117 * command.c (cmd_getinfo): Add "pid" subcommand.
119 2007-10-01 Werner Koch <wk@g10code.com>
121 * scdaemon.c (create_server_socket): Use Assuan socket wrappers
122 and remove Windows specific code.
124 (start_connection_thread): Check nonce.
126 2007-09-14 Marcus Brinkmann <marcus@g10code.de>
128 * scdaemon.c (main): New variable STANDARD_SOCKET, which is 1 for
129 W32 targets. Use it for create_socket_name.
131 2007-08-07 Werner Koch <wk@g10code.com>
133 * tlv.c, tlv.h: Move to ../common/.
135 2007-08-02 Werner Koch <wk@g10code.com>
137 * scdaemon.c: Include gc-opt-flags.h and remove their definition
140 2007-08-01 Werner Koch <wk@g10code.com>
142 * apdu.c (send_le): Implement exact length hack. Suggested by
145 2007-07-05 Werner Koch <wk@g10code.com>
147 * command.c (has_option_name, skip_options): New.
148 (cmd_genkey): Add option --timestamp.
149 (cmd_writekey): Enter confidential mode while inquiring the key data.
151 * app.c (app_genkey): Add arg CREATETIME.
152 * app-common.h (app_ctx_s): Likewise
153 * app-openpgp.c (do_genkey): Ditto. Use it.
156 2007-07-04 Werner Koch <wk@g10code.com>
158 * command.c (cmd_getinfo): New subcommand "version".
160 * scdaemon.c (TIMERTICK_INTERVAL): New.
161 (handle_connections) [W32]: Enable a dummy sigs event.
162 (handle_connections): Use a proper count for select and not
164 (fixed_gcry_pth_init, main): Kludge to fix pth initialization.
166 2007-06-21 Werner Koch <wk@g10code.com>
168 * scdaemon.h (ctrl_t): Remove. It is now declared in ../common/util.h.
170 2007-06-18 Marcus Brinkmann <marcus@g10code.de>
172 * scdaemon.c (main): Percent escape output of --gpgconf-list.
174 2007-06-12 Werner Koch <wk@g10code.com>
176 * scdaemon.c (main): Replace some calls by init_common_subsystems.
178 2007-06-11 Werner Koch <wk@g10code.com>
180 * Makefile.am (scdaemon_LDADD): Use libcommonpth macro.
182 * command.c (initialize_module_command): New.
183 * scdaemon.c (main) [W32]: Do not use sigpipe code.
184 (main): Call initialize_module_command.
186 2007-06-06 Werner Koch <wk@g10code.com>
188 * app-openpgp.c (do_sign): Fix arithmetic on void*.
190 * app.c (dump_mutex_state) [W32]: Handle the W32Pth case.
192 * apdu.c: Remove dynload.h.
194 * scdaemon.c (i18n_init): Remove.
196 2007-04-20 Werner Koch <wk@g10code.com>
198 * sc-copykeys.c (my_gcry_logger): Removed.
199 (main): Call setup_libgcrypt_logging helper.
200 * scdaemon.c (my_gcry_logger): Removed.
201 (main): Call setup_libgcrypt_logging helper.
203 2007-04-03 Werner Koch <wk@g10code.com>
205 * command.c (cmd_getinfo): New subcommand "reader_list".
206 * ccid-driver.c (scan_or_find_devices): Ignore EBUSY in scan mode
207 for special transports.
209 2007-03-07 Werner Koch <wk@g10code.com>
211 * app-dinsig.c: Include i18n.h.
212 (verify_pin): Support PIN pads.
213 * app-nks.c (verify_pin): Ditto.
215 * ccid-driver.c (bulk_in): Handle time extension before checking
217 (ccid_transceive_secure): Support the Cherry XX44 keyboard.
218 Kudos to the nice folks at Cherry for helping with that.
220 2007-02-18 Werner Koch <wk@g10code.com>
222 * scdaemon.c (DEFAULT_PCSC_DRIVER): Add a default for OS X.
224 2007-01-25 Werner Koch <wk@g10code.com>
226 * Makefile.am (scdaemon_LDADD): Added LIBICONV. Noted by Billy
229 2006-12-21 Werner Koch <wk@g10code.com>
231 * app-openpgp.c (verify_chv2): Factored most code out into...
232 (verify_a_chv): ... new.
233 (do_sign): Factored verification code out to new function and
234 take care of a keypad entered PIN.
235 (compare_fingerprint): Print an additional diagnostic.
237 2006-11-28 Werner Koch <wk@g10code.com>
239 * apdu.c (send_le, apdu_send_direct): Increase RESULTLEN to 258 to
240 allow for full 256 byte and the status word. This might break
241 some old PC/SC drivers or cards, but we will see. Suggested by
244 2006-11-23 Werner Koch <wk@g10code.com>
246 * command.c (scd_command_handler): Fixed use of CTRL.
248 2006-11-21 Werner Koch <wk@g10code.com>
250 * Makefile.am (libexec_PROGRAMS): Put pscs-wrapper into libexec.
251 Renamed to gnupg-pcsc-wrapper.
252 * apdu.c (open_pcsc_reader): Use GNUPG_LIBEXECDIR to accces the
253 wrapper. Suggested by Eric Dorland.
255 2006-11-20 Werner Koch <wk@g10code.com>
257 * app-openpgp.c (verify_chv2): Support for keypads (only CHV2).
259 * ccid-driver.c (ccid_transceive_secure): Made it work for Kaan
262 2006-11-17 Werner Koch <wk@g10code.com>
264 * ccid-driver.c (scan_or_find_devices): Use DEBUGOUT_2 instead of
265 log_debug. Removed few other log_debug.
267 * iso7816.c (iso7816_check_keypad): Allow for a SW of 0.
269 * command.c (pin_cb): New mode to prompt for a keypad entry.
271 * scdaemon.c (main) <gpgconf-list>: Add disable-keypad.
273 2006-11-15 Werner Koch <wk@g10code.com>
275 * app-p15.c (read_ef_odf): Cast one printf arg.
277 * scdaemon.h (struct server_control_s): Add field THREAD_STARTUP.
278 * command.c (scd_command_handler): Add new arg CTRL.
279 * scdaemon.c (scd_init_default_ctrl): Made static.
280 (scd_deinit_default_ctrl): New.
281 (start_connection_thread): Call init/deinit of ctrl.
282 (handle_connections): Allocate CTRL.
284 * apdu.c (PCSC_ERR_MASK): New.
285 (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu)
286 (close_pcsc_reader, open_pcsc_reader): Use it after shifting error
287 values. Reported by Henrik Nordstrom. Fixes bug #724.
289 2006-10-24 Werner Koch <wk@g10code.com>
291 * scdaemon.h (GCRY_MD_USER_TLS_MD5SHA1): New.
292 (MAX_DIGEST_LEN): Increased to 36.
293 * app-p15.c (do_sign): Support for TLS_MD5SHA1.
294 (do_auth): Detect TLS_MD5SHA1.
295 (do_sign): Tweaks for that digest.
297 2006-10-23 Werner Koch <wk@g10code.com>
299 * scdaemon.c (main): New command --gpgconf-test.
301 2006-10-17 Werner Koch <wk@g10code.com>
303 * Makefile.am (scdaemon_LDADD): Link against libcommonpth.
305 2006-10-12 Werner Koch <wk@g10code.com>
307 * apdu.c: Include pth.h after unistd.h for the sake of newer Pth
310 2006-10-11 Werner Koch <wk@g10code.com>
312 * app-openpgp.c (do_sign): Redirect to do_auth for OpenPGP.3.
314 2006-10-06 Werner Koch <wk@g10code.com>
316 * Makefile.am (AM_CFLAGS): Use PTH version of libassuan.
317 (scdaemon_LDADD): Ditto.
319 * scdaemon.h (send_status_info): Mark with sentinel attribute.
321 2006-10-02 Marcus Brinkmann <marcus@g10code.de>
323 * command.c (update_reader_status_file): Increase buffer of
324 NUMBUF2 (fixing typo).
326 2006-09-24 Marcus Brinkmann <marcus@g10code.de>
328 * app-openpgp.c (do_sign): Advance INDATA by the SHA1 resp. RMD160
331 2006-09-14 Werner Koch <wk@g10code.com>
333 Replaced all call gpg_error_from_errno(errno) by
334 gpg_error_from_syserror().
336 * command.c (scd_command_handler): Replaced
337 init_connected_socket_server by init_socket_server_ext.
339 2006-09-07 Werner Koch <wk@g10code.com>
341 * command.c (update_reader_status_file): Execute an event handler
344 2006-09-06 Werner Koch <wk@g10code.com>
346 * apdu.c (pcsc_end_transaction):
347 * pcsc-wrapper.c (pcsc_end_transaction: Fixed dclaration.
348 Reported by Bob Dunlop.
350 * scdaemon.h (CTRL,APP): Removed and changed everywhere to
353 Replaced all Assuan error codes by libgpg-error codes. Removed
354 all map_to_assuan_status and map_assuan_err.
356 * scdaemon.c (main): Call assuan_set_assuan_err_source to have Assuan
357 switch to gpg-error codes.
358 * command.c (set_error): Adjusted.
360 2006-09-02 Marcus Brinkmann <marcus@g10code.de>
362 * command.c (get_reader_slot): Return the slot_table index, not
363 the APDU slot number.
364 (update_reader_status_file): Use the slot_table index in the
365 update_card_removed invocation.
367 2006-09-01 Marcus Brinkmann <marcus@g10code.de>
369 * command.c (cmd_getinfo): Handle status command.
371 2006-08-30 Marcus Brinkmann <marcus@g10code.de>
373 * command.c (do_reset): Delay resetting CTRL->reader_slot until
374 after update_card_removed invocation.
376 2006-08-28 Marcus Brinkmann <marcus@g10code.de>
378 * app-openpgp.c (do_decipher, do_sign): Allow "OPENPGP.2"
379 resp. "OPENPGP.1" for KEYIDSTR.
381 2006-08-21 Werner Koch <wk@g10code.com>
383 * pcsc-wrapper.c (handle_open, handle_close): Reset card and
384 protocol on error/close.
385 (handle_status): Don't set the state if the state is unknown.
386 (handle_reset): Ignore an error if already disconnected. May
387 happen due to system wake-up after hibernation. Suggested by Bob
390 2006-06-28 Werner Koch <wk@g10code.com>
392 * app-openpgp.c (do_writekey): Fixed computation of memmove
393 length. This led to garbled keys if E was larger than one byte.
394 Thanks to Achim Pietig for hinting at the garbled E.
396 2006-06-09 Marcus Brinkmann <marcus@g10code.de>
398 * Makefile.am (scdaemon_LDADD): Add $(NETLIBS).
400 2006-04-14 Marcus Brinkmann <marcus@g10code.de>
402 * app.c (select_application): Cover up a slot mismatch error in
403 case it happens (it shouldn't happen).
404 (release_application): Use APP->slot. Lock the reader.
405 (application_notify_card_removed): Lock the reader.
407 2006-04-11 Werner Koch <wk@g10code.com>
409 * command.c (hex_to_buffer): New.
412 2006-04-03 Werner Koch <wk@g10code.com>
414 * scdaemon.c [__GLIBC__]: Default to libpcsclite.so.1.
416 2006-03-21 Werner Koch <wk@g10code.com>
418 * command.c (cmd_pksign): Add --hash option.
420 2006-03-01 Werner Koch <wk@g10code.com>
422 * command.c (status_file_update_lock): New.
423 (scd_update_reader_status_file): Use lock and factor existing code
425 (update_reader_status_file): .. this.
426 (do_reset): Use the lock and call update_reader_status_file.
428 2006-02-20 Werner Koch <wk@g10code.com>
430 * apdu.c (open_pcsc_reader): Fixed double free. Thanks to Moritz.
432 2006-02-09 Werner Koch <wk@g10code.com>
434 * command.c (get_reader_slot, do_reset)
435 (scd_update_reader_status_file): Rewrote.
437 * app.c (release_application): Factored code out to ..
438 (deallocate_app): new function.
439 (select_application): Introduce new saved application stuff.
440 (application_notify_card_removed): New.
441 * command.c (update_card_removed): Call it here.
442 (do_reset): And here.
444 * app.c (check_application_conflict): New.
445 * command.c (open_card): Use it here.
446 (cmd_restart): New command.
448 * command.c (cmd_lock): Fixed --wait option to actually terminate.
450 2006-02-08 Werner Koch <wk@g10code.com>
452 * ccid-driver.c (ccid_get_atr): Read Parameter and select T=1
453 using these parameters.
454 (scan_or_find_devices): Check for NULL r_fd.
456 2006-02-02 Werner Koch <wk@g10code.com>
458 * ccid-driver.c (special_transport): New
459 (ccid_open_reader, do_close_reader, ccid_shutdown_reader)
460 (bulk_out, bulk_in): Add support for CardMan 4040 reader.
462 * ccid-driver.c (scan_or_find_devices): Factored most code out to
463 (scan_or_find_usb_device): .. new.
464 (make_reader_id): Fixed vendor mask.
466 2006-01-01 Werner Koch <wk@g10code.com>
468 * app-openpgp.c (do_sign): Give user error if hash algorithm is
469 not supported by the card.
471 2005-12-06 Werner Koch <wk@g10code.com>
473 * apdu.c (open_pcsc_reader): Check that pcsc-wrapper is actually
476 2005-11-23 Werner Koch <wk@g10code.com>
478 * app-nks.c (verify_pin): Give a special error message for a Nullpin.
480 2005-10-29 Werner Koch <wk@g10code.com>
482 * ccid-driver.c (send_escape_cmd): New args RESULT, RESULTLEN and
483 RESULTMAX. Changed all callers.
484 (ccid_transceive_escape): New.
486 2005-10-27 Werner Koch <wk@g10code.com>
488 * apdu.c [__CYGWIN__]: Make cygwin environment similar to _WIN32.
489 Suggested by John P. Clizbe.
490 * scdaemon.c [__CYGWIN__]: Set default PC/SC driver to winscard.dll.
492 2005-10-19 Werner Koch <wk@g10code.com>
494 * ccid-driver.h (CCID_DRIVER_ERR_NO_KEYPAD): New.
495 * apdu.h (SW_HOST_NO_KEYPAD): New.
496 * iso7816.h (struct iso7816_pininfo_s): New.
497 * iso7816.c (map_sw): Support new code.
498 (iso7816_check_keypad): New.
499 (iso7816_verify_kp, iso7816_change_reference_data_kp)
500 (iso7816_reset_retry_counter_kp): New. Extended versions of the
502 * apdu.c (host_sw_string): Support new code.
503 (reader_table_s): New field CHECK_KEYPAD.
504 (new_reader_slot, open_ct_reader, open_pcsc_reader)
505 (open_ccid_reader, open_rapdu_reader): Initialize it.
506 (check_ccid_keypad): New.
507 (apdu_check_keypad): New.
508 (apdu_send_le): Factored all code out to ...
509 (send_le): .. new. Takes an additional arg; changed all callers
510 of the orginal function to use this one with a NULL for the new
512 (apdu_send_simple_kp): New.
513 (ct_send_apdu, pcsc_send_apdu, my_rapdu_send_apdu)
514 (send_apdu_ccid): New arg PININFO.
515 (send_apdu_ccid): Use the new arg.
517 * scdaemon.c: New option --disable-keypad.
519 2005-10-08 Marcus Brinkmann <marcus@g10code.de>
521 * Makefile.am (scdaemon_LDADD): Add ../gl/libgnu.a after
522 ../common/libcommon.a.
524 2005-09-20 Werner Koch <wk@g10code.com>
526 * app-dinsig.c (verify_pin): Try ISO 9564 BCD encoding.
528 * iso7816.c (iso7816_select_application): Add arg FLAGS. Changed
529 all callers to pass 0.
530 * app-openpgp.c (app_select_openpgp): But this one requires a
533 * app-p15.c (app_select_p15): Don't use select application for the
536 2005-09-09 Werner Koch <wk@g10code.com>
538 * pcsc-wrapper.c (main): Removed bogus free.
540 * app-p15.c (do_auth): New.
541 (do_getattr): New attribs $AUTHKEYID and $DISPSERIALNO.
542 * app-openpgp.c (do_getattr): Ditto.
544 2005-09-08 Werner Koch <wk@g10code.com>
546 * app-openpgp.c (do_getattr): New key $AUTHKEYID.
548 2005-09-06 Werner Koch <wk@g10code.com>
550 * app-p15.c (do_sign): Tweaked for BELPIC cards.
551 (read_home_df): New arg R_BELPIC.
552 (app_select_p15): Set card type for BELPIC.
554 2005-09-05 Werner Koch <wk@g10code.com>
556 * iso7816.c (iso7816_select_path): New.
557 * app-p15.c (select_ef_by_path): Allow for direct path selection.
558 (app_select_p15): Try using the Belgian variant of pkcs#15.
560 (read_ef_odf): Generalized.
561 (read_ef_tokeninfo): New.
562 (read_p15_info): Set serialnumber from TokenInfo.
563 (app_select_p15): Don't munge serialNumber - that must be done
566 * iso7816.c (iso7816_read_binary): Use Le=0 when reading all
567 data. Handle 6C00 error and take 6B00 as indication for EOF.
568 * apdu.h (SW_EXACT_LENGTH_P): New.
569 * apdu.c (new_reader_slot, reset_pcsc_reader, pcsc_get_status)
570 (open_pcsc_reader): Set new reader state IS_T0.
571 (apdu_send_le): When doing T=0 make sure not to send Lc and Le.
572 Problem reported by Carl Meijer.
573 (apdu_send_direct): Initialize RESULTLEN.
574 * pcsc-wrapper.c (handle_status): Return the current protocol as
577 2005-08-05 Werner Koch <wk@g10code.com>
579 * apdu.c (open_rapdu_reader): Set the reader number.
581 2005-07-05 Werner Koch <wk@g10code.com>
583 * app-openpgp.c (do_readkey): Return a mallcoed copy of the key as
584 required by the description. Thanks to Moritz for tracking this
587 2005-06-21 Werner Koch <wk@g10code.com>
589 * scdaemon.c (main): ifdef call to ccid_set_debug_level.
591 * apdu.c (reset_pcsc_reader, open_pcsc_reader): Cast size_t to
594 2005-06-06 Werner Koch <wk@g10code.com>
596 * scdaemon.c (main): New option --debug-allow-core-dump.
598 2005-06-03 Werner Koch <wk@g10code.com>
600 * scdaemon.c (handle_connections): Make sure that the signals we
601 are handling are not blocked.Block signals while creating new
603 (handle_connections): Include the file descriptor into the name of
606 2005-06-02 Werner Koch <wk@g10code.com>
608 * app.c (app_dump_state, dump_mutex_state): New.
609 * scdaemon.c (handle_signal): Print it on SIGUSR1.
611 * app-openpgp.c (do_writekey): Typo fix.
613 * command.c (open_card): Check for locked state even if an
614 application context is available.
616 * app-common.h: Add REF_COUNT field.
617 * app.c (release_application, select_application): Implement
618 reference counting to share the context beween connections.
620 * app.c (lock_reader, unlock_reader): Take SLOT instead of APP as
621 argument. Changed all callers.
622 (select_application): Unlock the reader on error. This should fix
623 the hangs I noticed last week.
625 * scdaemon.h: Removed card_ctx_t cruft.
627 2005-06-01 Werner Koch <wk@g10code.com>
629 * scdaemon.c: Include mkdtemp.h.
631 2005-05-31 Werner Koch <wk@g10code.com>
633 * tlv.c [GNUPG_MAJOR_VERSION==1]: Define constants instead of
634 including a gnupg 1.4 header.
636 2005-05-30 Werner Koch <wk@g10code.com>
638 * tlv.c: Add hack to compile without gpg-error.h when used with
641 2005-05-23 Werner Koch <wk@g10code.com>
643 * Makefile.am: Do not build sc-copykeys anymore.
645 * app-openpgp.c (app_openpgp_storekey, app_openpgp_readkey)
646 (app_openpgp_cardinfo): Removed.
648 * ccid-driver.c (parse_ccid_descriptor): SCR335 FW version 5.14 is
650 (do_close_reader): Never do a reset. The caller should instead
651 make sure that the reader has been closed properly. The new retry
652 code in ccid_slot_status will make sure that the readersatrts up
653 fine even if the last process didn't closed the USB connection
655 (ccid_get_atr): For certain readers try switching to ISO mode.
656 Thanks to Ludovic Rousseau for this hint and the magic numbers.
657 (print_command_failed): New.
658 (bulk_in): Use it here. Add new arg NO_DEBUG.
659 (ccid_slot_status): Disabled debugging.
661 2005-05-21 Werner Koch <wk@g10code.com>
663 * scdaemon.c (handle_signal): Print thread info on SIGUSR1.
665 2005-05-20 Werner Koch <wk@g10code.com>
667 * ccid-driver.c: Replaced macro DEBUG_T1 by a new debug level.
668 (parse_ccid_descriptor): Mark SCR335 firmware version 5.18 good.
669 (ccid_transceive): Arghhh. The seqno is another bit in the
670 R-block than in the I block, this was wrong at one place.
672 * scdaemon.c: New options --debug-ccid-driver and
673 --debug-disable-ticker.
675 * app-openpgp.c (do_genkey, do_writekey): Factored code to check
676 for existing key out into ..
677 (does_key_exist): .. New function.
679 2005-05-19 Werner Koch <wk@g10code.com>
681 * tlv.c (parse_sexp): New.
683 * command.c (cmd_writekey): New.
684 * app.c (app_writekey): New.
685 * app-common.c (app_t): Add function ptr WRITEKEY.
686 * app-openpgp.c (do_writekey): New.
688 * app-openpgp.c (do_readkey) [GNUPG_MAJOR_VERSION==1]: Return error.
689 * app-common.h (app_t) [GNUPG_MAJOR_VERSION==1]: Add a field to
690 store the Assuan context.
692 2005-05-17 Werner Koch <wk@g10code.com>
694 * scdaemon.c: Removed non-pth code paths.
695 (create_socket_name, create_server_socket): New. Taken from
697 (cleanup): Changed to adjust for SOCKET_NAME now being malloced.
698 (ticker_thread): Always use pth_event_occurred; it is again
699 defined for all decent PTH versions.
700 (handle_connections): New. Based on the gpg-agent code.
701 (start_connection_thread): Ditto.
702 (ticker_thread): Removed.
703 (cleanup_sh): Removed.
704 (main): Run the handler for the pipe server in a separate
705 thread. This replaces the old ticker thread.
706 (scd_get_socket_name): New.
707 * command.c (cmd_getinfo): New command GETINFO.
708 (scd_command_handler): Renamed argument and changed code to use an
709 already connected FD.
711 2005-05-15 Werner Koch <wk@g10code.com>
713 * app.c, app-common.h, app-nks.c, app-p15.c, app-dinsig.c
714 * app-openpgp.c: Change most function return types from int to
716 * command.c (pin_cb): Ditto.
717 * sc-copykeys.c (pincb): Ditto.
719 * app.c (lock_reader, unlock_reader): New. Changed call handler
720 wrappers to make use of these functions.
722 2005-05-07 Werner Koch <wk@g10code.com>
724 * ccid-driver.c (do_close_reader): Don't do a reset before close.
725 Some folks reported that it makes the SCR335 hang less often.
726 Look at the source on how to re-enable it.
728 2005-04-27 Werner Koch <wk@g10code.com>
730 * app-p15.c (micardo_mse): New.
732 * iso7816.c (iso7816_manage_security_env): Allow passing DATA as
733 NULL to indicate an empty Lc.
734 * tlv.c (find_tlv): Check that a found object fits into the
736 (find_tlv_unchecked): New as replacement for the old non-checking
738 * app.c (select_application): Keep on using the non-checking
740 * app-openpgp.c (get_one_do, dump_all_do): Ditto.
743 Removal of the old OpenSC based code.
745 * app-p15.c: New. Basic support for pkcs15 cards without OpenSC.
746 There are quite a couple of things missing but at least I can use
747 my old TCOS cards from the Aegypten-1 development for signing.
748 * app.c (select_application): Detect pkcs15 applications.
749 * Makefile.am (scdaemon_SOURCES): Removed card.c, card-common.h
750 and card-p15.c because they are now obsolete. Added app-p15.c.
751 Removed all OpenSC stuff.
752 * command.c (do_reset, open_card, cmd_serialno, cmd_learn)
753 (cmd_readcert, cmd_readkey, cmd_pksign, cmd_pkdecrypt): Removed
754 all special cases for the old card.c based mechanisms.
755 * scdaemon.c, apdu.c: Removed all special cases for OpenSC.
757 2005-04-20 Werner Koch <wk@g10code.com>
759 * command.c: Use GPG_ERR_LOCKED instead of EBUSY.
761 2005-04-14 Werner Koch <wk@g10code.com>
763 * app-openpgp.c (retrieve_key_material): Rewritten. Return a
765 (retrieve_next_token): Removed.
766 (retrieve_fpr_from_card): Rewritten to make use of DO caching and
767 to take the KEYNO as arg.
768 (get_public_key): Renamed variable for clarity.
770 2005-04-12 Werner Koch <wk@g10code.com>
772 Basic support for several sessions.
774 * command.c (scd_command_handler): Replace the primary_connection
775 stuff by a real connection list. Release the local context on
777 (scd_update_reader_status_file): Update accordingly. Send signal
778 to all connections who registered an event signal.
779 (cmd_lock, cmd_unlock, register_commands): New commands LOCK and
781 (cmd_setdata, cmd_pksign, cmd_pkauth, cmd_pkdecrypt, cmd_setattr)
782 (cmd_genkey, cmd_passwd, cmd_checkpin): Return an error if reader
784 (do_reset): Handle locking.
785 (open_card): Ditto. Share the reader slot with other sessions.
786 (get_reader_slot): New.
787 (update_card_removed): New. Use it in the TEST_CARD_REMOVAL macro.
789 2005-04-07 Werner Koch <wk@g10code.com>
791 * app-openpgp.c (do_check_pin): Add hack to allow verification of
793 (get_public_key): Don't use gcry functions to create S-expressions.
794 (do_deinit, do_readkey, do_genkey, send_keypair_info): Adjust for
797 2005-03-29 Moritz Schulte <moritz@g10code.com>
799 * app-openpgp.c (retrieve_fpr_from_card): New function.
800 (retrieve_next_token): New function.
801 (retrieve_key_material): New function.
802 (get_public_key): Implement retrival of key through expernal
803 helper (gpg) in case the openpgp card is not cooperative enough.
805 2005-03-16 Werner Koch <wk@g10code.com>
807 * ccid-driver.c (parse_ccid_descriptor): Make SCM workaround
808 reader type specific.
809 (scan_or_find_devices): Do not check the interface subclass in the
810 SPR532 kludge, as this depends on the firmware version.
811 (ccid_get_atr): Get the Slot status first. This solves the
812 problem with readers hanging on recent Linux 2.6.x.
813 (bulk_in): Add argument TIMEOUT and changed all callers to pass an
814 appropriate one. Change the standard timeout from 10 to 5 seconds.
815 (ccid_slot_status): Add a retry code with an initial short timeout.
816 (do_close_reader): Do an usb_reset before closing the reader.
818 2005-02-25 Werner Koch <wk@g10code.com>
820 * app-openpgp.c (get_public_key): Make sure not to return negative
822 (do_sign): Allow passing of indata with algorithm prefix.
823 (do_auth): Allow OPENPGP.3 as an alternative ID.
825 * app.c (app_getattr): Return just the S/N but not the timestamp.
827 2005-02-24 Werner Koch <wk@g10code.com>
829 * app.c (app_getattr): Return APPTYPE or SERIALNO type even if the
830 application does dot support the getattr call.
832 * app-openpgp.c (get_one_do): Never try to get a non cacheable
833 object from the cache.
834 (get_one_do): Add new arg to return an error code. Changed all
836 (do_getattr): Let it return a proper error code.
838 * app.c (select_application): Return an error code and the
839 application context in an new arg.
840 * command.c (open_card): Adjusted for that. Don't use the
841 fallback if no card is present. Return an error if the card has
842 been removed without a reset.
843 (do_reset, cmd_serialno): Clear that error flag.
844 (TEST_CARD_REMOVAL): New. Use it with all command handlers.
845 (scd_update_reader_status_file): Set the error flag on all changes.
847 * scdaemon.c (ticker_thread): Termintate if a shutdown is pending.
849 * apdu.c: Added some PCSC error codes.
850 (pcsc_error_to_sw): New.
851 (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu)
852 (open_pcsc_reader): Do proper error code mapping.
854 2005-03-16 Werner Koch <wk@g10code.com>
856 * ccid-driver.c (parse_ccid_descriptor): Make SCM workaround
857 reader type specific.
858 (scan_or_find_devices): Do not check the interface subclass in the
859 SPR532 kludge, as this depends on the firmware version.
860 (ccid_get_atr): Get the Slot status first. This solves the
861 problem with readers hanging on recent Linux 2.6.x.
863 2005-02-22 Werner Koch <wk@g10code.com>
865 * app-openpgp.c (app_local_s): New field PK.
866 (do_deinit, do_genkey, app_openpgp_storekey): Clear it.
867 (get_public_key, send_keypair_info): New.
868 (do_learn_status): Send KEYPAIR info
870 * app-common.h (app_ctx_t): Add function pointer READKEY.
871 * app.c (app_readkey): New.
872 * command.c (cmd_readkey): Use READKEY function if possible.
874 2005-01-26 Werner Koch <wk@g10code.com>
876 * ccid-driver.c (parse_ccid_descriptor): Need the CSM workaround
877 also for newer firmware versions. Need to get a list of fixed
878 firmware versions and use that.
880 2005-01-25 Werner Koch <wk@g10code.com>
882 * apdu.c (apdu_send_le, apdu_send_direct): Fix some compiler
885 * app-openpgp.c (get_cached_data): New arg GET_IMMEDIATE to bypass
886 the cache. Changed all callers.
887 (get_one_do): Bypass the cache if the value would have been read
888 directly for v1.1 cards.It makes things a bit slower but obnly for
889 1.0 cards and there are not that many cards out in the wild. This
890 is required to fix a caching bug when generating new keys; as a
891 side effect of the retrieval of the the C4 DO from the 6E DO the
892 cached fingerprint will get updated to the old value and later
893 when signing the generated key the checking of the fingerprint
894 fails because it won't match the new one. Thanks to Moritz for
895 analyzing this problem.
896 (verify_chv3): Removed the CHV status reread logic because we
897 won't cache the C4 DO anymore.
899 2004-12-28 Werner Koch <wk@g10code.com>
901 * ccid-driver.c (find_endpoint): New.
902 (scan_or_find_devices): Add new args to return endpoint info and
904 (ccid_open_reader, ccid_shutdown_reader): Take care of these new
906 (bulk_in, bulk_out): Use the correct endpoints.
907 (ccid_transceive_apdu_level): New.
908 (ccid_transceive): Divert to above.
909 (parse_ccid_descriptor): Allow APDU level exchange mode.
910 (do_close_reader): Pass the interface number to usb_release_interface.
912 2004-12-21 Werner Koch <wk@g10code.com>
914 * scdaemon.c (main): Use default_homedir().
916 2004-12-18 Werner Koch <wk@g10code.com>
918 * scdaemon.c (main) [W32]: Remove special Pth initialize..
920 * scdaemon.h (map_assuan_err): Define in terms of
921 map_assuan_err_with_source.
923 2004-12-15 Werner Koch <wk@g10code.com>
925 * scdaemon.c [W32]: Various hacks to make it run under W32.
927 * command.c (scd_update_reader_status_file) [W32]: Don't use kill.
929 * apdu.c [W32]: Disable use of pcsc_wrapper.
931 * Makefile.am (scdaemon_LDADD): Reorder libs.
932 (sc_copykeys_LDADD): Add libassuan because it is needed for W32.
934 2004-12-06 Werner Koch <wk@g10code.com>
936 * Makefile.am (pkglib_PROGRAMS): Build only for W32.
938 2004-10-22 Werner Koch <wk@g10code.com>
940 * app-openpgp.c (verify_chv3): The minium length for CHV3 is
941 8. Changed string to match the other ones.
943 2004-10-21 Werner Koch <wk@g10code.com>
945 * app-openpgp.c (do_sign): Replace asprintf by direct allocation.
946 This avoids problems with missing vasprintf implementations in
949 * app-common.h (app_openpgp_storekey: Add prototype.
951 2004-10-20 Werner Koch <wk@g10code.com>
953 * sc-investigate: Removed.
954 * Makefile.am (sc_investigate): Removed.
956 * pcsc-wrapper.c (load_pcsc_driver): Load get_status_change func.
957 (handle_open): Succeed even without a present card.
958 (handle_status, handle_reset): New.
960 * apdu.c (apdu_open_reader): Load pcsc_get_status_change fucntion.
961 (pcsc_get_status): Implemented.
962 (reset_pcsc_reader): Implemented.
963 (open_pcsc_reader): Succeed even with no card inserted.
964 (open_ccid_reader): Set LAST_STATUS.
966 * iso7816.c (iso7816_select_application): Always use 0 for P1.
968 2004-10-18 Werner Koch <wk@g10code.com>
970 * ccid-driver.c (ccid_get_atr): Reset T=1 state info.
972 2004-10-14 Werner Koch <wk@g10code.com>
974 * app-openpgp.c (parse_login_data): New.
975 (app_select_openpgp): Call it.
976 (do_setattr): Reparse it after change.
978 2004-10-06 Werner Koch <wk@g10code.de>
980 * ccid-driver.c (ccid_open_reader): Store the vendor ID.
981 (ccid_transceive_secure): New.
982 (parse_ccid_descriptor): Workaround for an SCM reader problem.
984 2004-10-04 Werner Koch <wk@g10code.de>
986 * ccid-driver.c (send_escape_cmd): New.
988 2004-09-30 Werner Koch <wk@g10code.com>
990 * Makefile.am: Adjusted for gettext 0.14.
992 * app-openpgp.c (do_sign): Add the error string to the verify
995 2004-09-27 Werner Koch <wk@g10code.com>
999 * app-openpgp.c: Made all strings translatable.
1000 (verify_chv3) [GNUPG_MAJOR_VERSION]: Make opt.allow_admin
1001 available for use in gnupg 2.
1002 (verify_chv3): Reimplemented countdown showing to use only
1003 functions from this module. Flush the CVH status cache on a
1005 (get_one_do): Hack to bypass the cache for cards versions > 1.0.
1006 (store_fpr): Store the creation date for card version > 1.0.
1008 * app-openpgp.c (app_openpgp_storekey): Call flush_cache.
1009 (get_cached_data): Move local data initialization to ..
1010 (app_select_openpgp): .. here. Read some flags for later use.
1011 (do_getattr): New read-only attribute EXTCAP.
1013 * apdu.c (open_pcsc_reader): Do not print empty reader string.
1015 * ccid-driver.c (do_close_reader): Factored some code out from ...
1016 (ccid_close_reader): ..here.
1017 (ccid_shutdown_reader): New.
1019 * apdu.c (apdu_shutdown_reader): New.
1020 (shutdown_ccid_reader): New.
1022 * apdu.c (open_ccid_reader): New arg PORTSTR. Pass it to
1024 (apdu_open_reader): Pass portstr to open_ccid_reader.
1025 (apdu_open_reader): No fallback if a full CCID reader id has been
1028 * ccid-driver.c (ccid_get_reader_list): New.
1029 (ccid_open_reader): Changed API to take a string for the reader.
1030 Removed al the cruft for the libusb development vesion which seems
1031 not to be maintained anymore and there are no packages anyway.
1032 The stable library works just fine.
1033 (struct ccid_reader_id_s): Deleted and replaced everywhere by a
1035 (usb_get_string_simple): Removed.
1036 (bulk_in): Do valgrind hack here and not just everywhere.
1038 * ccid-driver.c (read_device_info): Removed.
1039 (make_reader_id, scan_or_find_devices): New.
1040 (ccid_open_reader): Simplified by make use of the new functions.
1041 (ccid_set_debug_level): New. Changed the macros to make use of
1042 it. It has turned out that it is often useful to enable debugging
1043 at runtime so I added this option.
1045 From gnupg 1.3 - David Shaw <dshaw@jabberwocky.com>
1047 * app-openpgp.c (verify_chv3): Show a countdown of how many wrong
1048 admin PINs can be entered before the card is locked.
1050 * app-openpgp.c (get_cached_data): Avoid mallocing zero since it
1051 breaks us when using --enable-m-guard.
1053 * ccid-driver.c (usb_get_string_simple): Replacement function to
1054 work with older libusb.
1056 * ccid-driver.c (read_device_info): Fix segfault when usb device
1058 (ccid_open_reader): Allow working with an even older version of
1059 libusb (usb_busses global instead of usb_get_busses()).
1061 2004-09-11 Werner Koch <wk@g10code.com>
1063 * app-openpgp.c (app_select_openpgp): Its app_munge_serialno and
1064 not app_number_serialno.
1066 2004-08-20 Werner Koch <wk@g10code.de>
1068 * app.c (select_application): Fixed serial number extraction and
1069 added the BMI card workaround.
1070 (app_munge_serialno): New.
1071 * app-openpgp.c (app_select_openpgp): Try munging serialno.
1073 2004-08-05 Werner Koch <wk@g10code.de>
1075 * scdaemon.c (main): New option --disable-application.
1076 * app.c (is_app_allowed): New.
1077 (select_application): Use it to check for disabled applications.
1079 * ccid-driver.h (CCID_DRIVER_ERR_ABORTED): New.
1080 * ccid-driver.c (ccid_open_reader): Support the stable 0.1 version
1082 (ccid_get_atr): Handle short messages.
1084 * apdu.c (my_rapdu_get_status): Implemented.
1086 2004-07-27 Moritz Schulte <moritz@g10code.com>
1088 * apdu.c: Include <signal.h>.
1090 * Makefile.am: Use @DL_LIBS@ instead of -ldl.
1092 2004-07-22 Werner Koch <wk@g10code.de>
1094 * Makefile.am: Make OpenSC lib link after libgcrypt. Do not link
1096 * apdu.c: Don't use Pth if we use OpenSC.
1097 * sc-investigate.c, scdaemon.c: Disable use of pth if OpenSC is used.
1099 * scdaemon.c (main): Bumbed thread stack size up to 512k.
1101 2004-07-16 Werner Koch <wk@gnupg.org>
1103 * apdu.c (reader_table_s): Add function pointers for the backends.
1104 (apdu_close_reader, apdu_get_status, apdu_activate)
1105 (send_apdu): Make use of them.
1106 (new_reader_slot): Intialize them to NULL.
1107 (dump_ccid_reader_status, ct_dump_reader_status): New.
1108 (dump_pcsc_reader_status): New.
1109 (open_ct_reader, open_pcsc_reader, open_ccid_reader)
1110 (open_osc_reader, open_rapdu_reader): Intialize function pointers.
1111 (ct_activate_card, ct_send_apdu, pcsc_send_apdu, osc_send_apdu)
1112 (error_string): Removed. Replaced by apdu_strerror.
1113 (get_ccid_error_string): Removed.
1114 (ct_activate_card): Remove the unused loop.
1115 (reset_ct_reader): Implemented.
1116 (ct_send_apdu): Activate the card if not yet done.
1117 (pcsc_send_apdu): Ditto.
1119 2004-07-15 Werner Koch <wk@gnupg.org>
1121 * ccid-driver.h: Add error codes.
1122 * ccid-driver.c: Implement more or less proper error codes all
1125 * apdu.c (apdu_send_direct): New.
1126 (get_ccid_error_string): Add some error code mappings.
1127 (send_apdu): Pass error codes along for drivers already supporting
1129 (host_sw_string): New.
1130 (get_ccid_error_string): Use above.
1131 (send_apdu_ccid): Reset the reader if it has not yet been done.
1132 (open_ccid_reader): Don't care if the ATR can't be read.
1133 (apdu_activate_card): New.
1134 (apdu_strerror): New.
1135 (dump_reader_status): Only enable it with opt.VERBOSE.
1136 * iso7816.c (map_sw): Add mappings for the new error codes.
1138 2004-07-02 Werner Koch <wk@gnupg.org>
1140 * apdu.c (open_ct_reader, open_pcsc_reader, open_ccid_reader)
1141 (reset_ccid_reader, open_osc_reader): Call dump_reader_status only
1144 2004-07-01 Werner Koch <wk@gnupg.org>
1146 * sc-investigate.c: Initialize Pth which is now required.
1147 (interactive_shell): New command "readpk".
1149 * app-openpgp.c (do_getattr): Fix for sending CA-FPR.
1151 2004-06-30 Werner Koch <wk@gnupg.org>
1153 * app-openpgp.c (app_openpgp_readkey): Fixed check for valid
1156 2004-06-18 Werner Koch <wk@g10code.com>
1158 * sc-investigate.c (my_read_line): Renamed from read_line.
1160 2004-06-16 Werner Koch <wk@gnupg.org>
1162 * apdu.c (osc_get_status): Fixed type in function name. Noted by
1163 Axel Thimm. Yes, I didn't tested it with OpenSC :-(.
1165 2004-04-28 Werner Koch <wk@gnupg.org>
1167 * app-openpgp.c (do_setattr): Sync FORCE_CHV1.
1169 2004-04-27 Werner Koch <wk@gnupg.org>
1171 * app-common.h: Do not include ksba.h for gnupg 1.
1173 2004-04-26 Werner Koch <wk@gnupg.org>
1175 * app-common.h: New members FNC.DEINIT and APP_LOCAL.
1176 * app.c (release_application): Call new deconstructor.
1177 * app-openpgp.c (do_deinit): New.
1178 (get_cached_data, flush_cache_item, flush_cache_after_error)
1180 (get_one_do): Replaced arg SLOT by APP. Make used of cached data.
1181 (verify_chv2, verify_chv3): Flush some cache item after error.
1182 (do_change_pin): Ditto.
1184 (do_setattr): Flush cache item.
1185 (do_genkey): Flush the entire cache.
1186 (compare_fingerprint): Use cached data.
1188 * scdaemon.c (main): Do the last change the usual way. This is so
1189 that we can easily test for versioned config files above.
1191 2004-04-26 Marcus Brinkmann <marcus@g10code.de>
1193 * scdaemon.c (main): For now, always print default filename for
1194 --gpgconf-list, and never /dev/null.
1196 2004-04-21 Werner Koch <wk@gnupg.org>
1198 * command.c (scd_update_reader_status_file): Send a signal back to
1200 (option_handler): Parse the new event-signal option.
1202 * scdaemon.c (handle_signal): Do not use SIGUSR{1,2} anymore for
1203 changing the verbosity.
1205 2004-04-20 Werner Koch <wk@gnupg.org>
1207 * command.c (scd_update_reader_status_file): Write status files.
1209 * app-help.c (app_help_read_length_of_cert): Fixed calculation of
1212 * pcsc-wrapper.c: New.
1213 * Makefile.am (pkglib_PROGRAMS): Install it here.
1214 * apdu.c (writen, readn): New.
1215 (open_pcsc_reader, pcsc_send_apdu, close_pcsc_reader): Use the
1216 pcsc-wrapper if we are using Pth.
1217 (apdu_send_le): Reinitialize RESULTLEN. Handle SW_EOF_REACHED
1220 2004-04-19 Werner Koch <wk@gnupg.org>
1222 * ccid-driver.c (parse_ccid_descriptor): Store some of the reader
1223 features away. New arg HANDLE
1224 (read_device_info): New arg HANDLE. Changed caller.
1225 (bulk_in): Handle time extension requests.
1226 (ccid_get_atr): Setup parameters and the IFSD.
1227 (compute_edc): New. Factored out code.
1228 (ccid_transceive): Use default NADs when required.
1230 2004-04-14 Werner Koch <wk@gnupg.org>
1232 * scdaemon.h (server_control_s): Add member READER_SLOT.
1233 * scdaemon.c (scd_init_default_ctrl): Initialize READER_SLOT to -1.
1234 * command.c (open_card): Reuse an open slot.
1235 (reset_notify): Just reset the slot if supported by the reader.
1236 (do_reset): Factored code from above out.
1237 (scd_command_handler): Use it for cleanup.
1239 * apdu.h: New pseudo stati SW_HOST_NOT_SUPPORTED,
1240 SW_HOST_LOCKING_FAILED and SW_HOST_BUSY.
1241 * iso7816.c (map_sw): Map it.
1243 * ccid-driver.c (ccid_slot_status): Add arg STATUSBITS.
1244 * apdu.c (apdu_get_status): New.
1245 (ct_get_status, pcsc_get_status, ocsc_get_status): New stubs.
1246 (get_status_ccid): New.
1248 (reset_ct_reader, reset_pcsc_reader, reset_osc_reader): New stubs.
1249 (reset_ccid_reader): New.
1250 (apdu_enum_reader): New.
1252 * apdu.c (lock_slot, trylock_slot, unlock_slot): New helpers.
1253 (new_reader_slot) [USE_GNU_PTH]: Init mutex.
1254 (apdu_reset, apdu_get_status, apdu_send_le): Run functions
1257 * command.c (scd_update_reader_status_file): New.
1258 * scdaemon.c (handle_tick): Call it.
1260 2004-04-13 Werner Koch <wk@gnupg.org>
1262 * scdaemon.c: Convert to a Pth application.
1263 (handle_signal, ticker_thread, handle_tick): New.
1264 (main): Fire up the ticker thread in server mode.
1266 2004-03-23 Werner Koch <wk@gnupg.org>
1268 * scdaemon.c (main) <gpgconf_list>: Fixed output for pcsc_driver.
1270 2004-03-17 Werner Koch <wk@gnupg.org>
1272 * tlv.c (parse_ber_header): Do not check for tag overflow - it
1273 does not make sense. Simplified the check for length overflow.
1275 * scdaemon.c (main) <gpgconf>: Fixed default value quoting.
1277 2004-03-16 Werner Koch <wk@gnupg.org>
1279 * app-dinsig.c: Implemented. Based on app-nks.c and card-dinsig.c
1280 * app-nks.c (get_length_of_cert): Removed.
1282 (app_help_read_length_of_cert): New. Code taken from above. New
1283 optional arg R_CERTOFF.
1285 * card-dinsig.c: Removed.
1286 * card.c (card_get_serial_and_stamp): Do not bind to the old and
1287 never finsiged card-dinsig.c.
1289 * iso7816.c (iso7816_read_binary): Allow for an NMAX > 254.
1291 2004-03-11 Werner Koch <wk@gnupg.org>
1293 * scdaemon.h (out_of_core): Removed. Replaced callers by standard
1296 * apdu.c, iso7816.c, ccid-driver.c [GNUPG_SCD_MAIN_HEADER]: Allow
1297 to include a header defined by the compiler. This helps us to
1298 reuse the source in other software.
1300 2004-03-10 Werner Koch <wk@gnupg.org>
1302 * iso7816.c (iso7816_read_record): New arg SHORT_EF. Changed all
1305 2004-02-18 Werner Koch <wk@gnupg.org>
1307 * sc-investigate.c (main): Setup the used character set.
1308 * scdaemon.c (main): Ditto.
1310 * scdaemon.c (set_debug): New. Add option --debug-level.
1311 (main): Add option --gpgconf-list.
1313 2004-02-12 Werner Koch <wk@gnupg.org>
1315 * Makefile.am: Include cmacros.am for common flags.
1317 2004-01-29 Werner Koch <wk@gnupg.org>
1319 * command.c (reset_notify): Release the application context and
1322 2004-01-28 Werner Koch <wk@gnupg.org>
1324 * iso7816.c (iso7816_manage_security_env): New.
1325 (iso7816_decipher): Add PADIND argument.
1327 2004-01-27 Werner Koch <wk@gnupg.org>
1329 * command.c (cmd_readcert, cmd_readkey): Work on a copy of LINE.
1331 * app-common.h (app_ctx_s): Added readcert field.
1332 * app.c (app_readcert): New.
1333 * tlv.c (parse_ber_header): Added; taken from libksba.
1335 2004-01-26 Werner Koch <wk@gnupg.org>
1337 * card.c (map_sc_err): Use SCD as the error source.
1339 * command.c (open_card): ADD arg NAME to allow requesting a
1340 specific application. Changed all callers.
1341 (cmd_serialno): Allow optional argument to select the desired
1346 * scdaemon.h (opt): Add READER_PORT.
1347 * scdaemon.c (main): Set it here.
1348 * app.c (app_set_default_reader_port): Removed.
1349 (select_application): Add NAME arg and figure out a
1350 default serial number from the GDO. Add SLOT arg and remove all
1352 (release_application): New.
1353 (app_write_learn_status): Output an APPTYPE status line.
1354 * command.c (open_card): Adapt for select_application change.
1355 * app-openpgp.c (app_select_openpgp): Removed SN and SNLEN args
1356 and set it directly. Changed all callers.
1358 2004-01-25 Werner Koch <wk@gnupg.org>
1360 * iso7816.c (iso7816_select_application): P1 kludge for OpenPGP
1362 * app-openpgp.c (find_tlv): Factor out this function to ..
1363 * tlv.c, tlv.h: .. new.
1365 * scdaemon.h: Introduced app_t and ctrl_t as the new types for APP
1368 2004-01-21 Werner Koch <wk@gnupg.org>
1370 * apdu.c (apdu_send_le): Treat SW_EOF_REACHED as a warning.
1372 2004-01-20 Werner Koch <wk@gnupg.org>
1374 * iso7816.c (iso7816_read_binary): New.
1375 (iso7816_select_file): New.
1376 (iso7816_list_directory): New.
1378 * sc-investigate.c: Add option -i.
1379 (select_app, read_line, interactive_shell): New.
1381 2004-01-16 Werner Koch <wk@gnupg.org>
1383 * apdu.h: Add SW_FILE_NOT_FOUND.
1384 * iso7816.c (map_sw): Map it to GPG_ERR_ENOENT.
1385 * iso7816.c (iso7816_select_file): New.
1387 * app-dinsig.c: New file w/o any real code yet.
1388 * Makefile.am (scdaemon_SOURCES,sc_investigate_SOURCES): Add file.
1390 * sc-investigate.c: Add option --disable-ccid.
1392 2003-12-19 Werner Koch <wk@gnupg.org>
1394 * apdu.c (apdu_send_le): Send a get_response with the indicated
1395 length and not the 64 bytes we used for testing.
1397 * app-openpgp.c (verify_chv2, verify_chv3, do_sign): Check the
1398 minimum length of the passphrase, so that we don't need to
1399 decrement the retry counter.
1401 2003-12-17 Werner Koch <wk@gnupg.org>
1403 * card-p15.c (p15_enum_keypairs): Replaced KRC by RC.
1404 * card-dinsig.c (dinsig_enum_keypairs): Ditto.
1406 2003-12-16 Werner Koch <wk@gnupg.org>
1408 * scdaemon.c (main): Set the prefixes for assuan logging.
1410 2003-11-17 Werner Koch <wk@gnupg.org>
1412 * scdaemon.c, scdaemon.h: New options --allow-admin and --deny-admin.
1413 * app-openpgp.c (verify_chv3): Check it here.
1415 2003-11-12 Werner Koch <wk@gnupg.org>
1417 Adjusted for API changes in Libksba.
1419 2003-10-30 Werner Koch <wk@gnupg.org>
1421 * apdu.c (close_ct_reader, close_pcsc_reader): Implemented.
1422 (get_ccid_error_string): New. Not very useful messages, though.
1424 2003-10-25 Werner Koch <wk@gnupg.org>
1426 * ccid-driver.c (ccid_open_reader): Return an error if no USB
1429 * command.c (cmd_genkey, cmd_passwd): Fixed faulty use of
1432 * apdu.c (apdu_open_reader): Hacks for PC/SC under Windows.
1434 2003-10-20 Werner Koch <wk@gnupg.org>
1436 * command.c (cmd_checkpin): New.
1437 (register_commands): Add command CHECKPIN.
1438 * app.c (app_check_pin): New.
1439 * app-openpgp.c (check_against_given_fingerprint): New. Factored
1440 out that code elsewhere.
1441 (do_check_pin): New.
1443 2003-10-10 Werner Koch <wk@gnupg.org>
1445 * ccid-driver.c (ccid_close_reader): New.
1447 * apdu.c (close_ccid_reader, close_ct_reader, close_csc_reader)
1448 (close_osc_reader, apdu_close_reader): New. Not all are properly
1451 2003-10-09 Werner Koch <wk@gnupg.org>
1453 * ccid-driver.c (ccid_transceive): Add T=1 chaining for sending.
1455 2003-10-08 Werner Koch <wk@gnupg.org>
1457 * app-openpgp.c (do_getattr): Support SERIALNO and AID.
1459 2003-10-01 Werner Koch <wk@gnupg.org>
1461 * ccid-driver.c: Detect GnuPG 1.3 and include appropriate files.
1463 * app-openpgp.c: Ditto.
1465 (generate_keypair): Renamed to ..
1466 (do_generate_keypair): .. this.
1467 * app-common.h [GNUPG_MAJOR_VERSION]: New.
1468 * iso7816.h [GNUPG_MAJOR_VERSION]: Include cardglue.h
1470 2003-09-30 Werner Koch <wk@gnupg.org>
1472 * command.c (cmd_getattr): New command GETATTR.
1473 * app.c (app_setattr): New.
1475 (do_learn_status): Reimplemented in terms of do_getattr.
1477 * app-openpgp.c (do_change_pin): Make sure CVH1 and CHV2 are
1479 (verify_chv2, verify_chv3): New. Factored out common code.
1480 (do_setattr, do_sign, do_auth, do_decipher): Change the names of
1481 the prompts to match that we have only 2 different PINs.
1482 (app_select_openpgp): Check whether the card enforced CHV1.
1483 (convert_sig_counter_value): New. Factor out code from
1486 2003-09-28 Werner Koch <wk@gnupg.org>
1488 * app-openpgp.c (dump_all_do): Use gpg_err_code and not gpg_error.
1490 2003-09-19 Werner Koch <wk@gnupg.org>
1492 * ccid-driver.c (parse_ccid_descriptor): New.
1493 (read_device_info): New.
1494 (ccid_open_reader): Check that the device has all required features.
1496 2003-09-06 Werner Koch <wk@gnupg.org>
1498 * scdaemon.c (main): --pcsc-driver again defaults to pcsclite.
1499 David Corcoran was so kind to remove the GPL incompatible
1500 advertisng clause from pcsclite.
1501 * apdu.c (apdu_open_reader): Actually make pcsc-driver option work.
1503 2003-09-05 Werner Koch <wk@gnupg.org>
1505 * ccid-driver.c: More work, data can now actually be retrieved.
1506 * ccid-driver.c, ccid-driver.h: Alternativley allow use under BSD
1509 2003-09-02 Werner Koch <wk@gnupg.org>
1511 * scdaemon.c, scdaemon.h: New option --pcsc-ccid.
1512 * ccid-driver.c, ccid-driver.h: New but far from being useful.
1513 * Makefile.am: Add above.
1514 * apdu.c: Add support for that ccid driver.
1516 2003-08-26 Timo Schulz <twoaday@freakmail.de>
1518 * apdu.c (new_reader_slot): Only set 'is_osc' when OpenSC
1521 2003-08-25 Werner Koch <wk@gnupg.org>
1523 * command.c (cmd_setattr): Use a copy of LINE.
1524 (cmd_genkey): Use a copy of KEYNO.
1525 (cmd_passwd): Use a copy of CHVNOSTR.
1526 (cmd_pksign, cmd_pkauth, cmd_pkdecrypt): s/strdup/xtrystrdup/.
1528 2003-08-19 Werner Koch <wk@gnupg.org>
1530 * scdaemon.c, scdaemon.h: New option --pcsc-driver.
1531 * apdu.c (apdu_open_reader): Use that option here instead of a
1534 2003-08-18 Werner Koch <wk@gnupg.org>
1536 * Makefile.am: Add OPENSC_LIBS to all programs.
1538 * scdaemon.c, scdaemon.h: New option --disable-opensc.
1539 * card.c (card_open): Implement it.
1540 * apdu.c (open_osc_reader, osc_send_apdu): New.
1541 (apdu_open_reader) [HAVE_OPENSC]: Use the opensc driver if not
1543 (error_string) [HAVE_OPENSC]: Use sc_strerror.
1544 (send_apdu) [HAVE_OPENSC]: Call osc_apdu_send.
1546 * card-p15.c (p15_enum_keypairs, p15_prepare_key): Adjusted for
1549 2003-08-14 Timo Schulz <twoaday@freakmail.de>
1551 * apdu.c (ct_activate_card): Change the code a little to avoid
1552 problems with other readers.
1553 * Always use 'dynload.h' instead of 'dlfcn.h'.
1555 2003-08-05 Werner Koch <wk@gnupg.org>
1557 * app-openpgp.c (dump_all_do): Don't analyze constructed DOs after
1560 2003-08-04 Werner Koch <wk@gnupg.org>
1562 * app.c (app_set_default_reader_port): New.
1563 (select_application): Use it here.
1564 * scdaemon.c (main): and here.
1565 * sc-copykeys.c: --reader-port does now take a string.
1566 * sc-investigate.c, scdaemon.c: Ditto.
1567 * apdu.c (apdu_open_reader): Ditto. Load pcsclite if no ctapi
1568 driver is configured. Always include code for ctapi.
1569 (new_reader_slot): Don't test for already used ports and remove
1571 (open_pcsc_reader, pcsc_send_apdu, pcsc_error_string): New.
1572 (apdu_send_le): Changed RC to long to cope with PC/SC.
1574 * scdaemon.c, scdaemon.h: New option --ctapi-driver.
1575 * sc-investigate.c, sc-copykeys.c: Ditto.
1577 2003-07-31 Werner Koch <wk@gnupg.org>
1579 * Makefile.am (scdaemon_LDADD): Added INTLLIBS.
1581 2003-07-28 Werner Koch <wk@gnupg.org>
1583 * app-openpgp.c (do_setattr): Change implementation. Allow all
1586 2003-07-27 Werner Koch <wk@gnupg.org>
1588 Adjusted for gcry_mpi_print and gcry_mpi_scan API change.
1590 2003-07-24 Werner Koch <wk@gnupg.org>
1592 * app-openpgp.c (do_learn_status): Print more status information.
1593 (app_select_openpgp): Store the card version.
1594 (store_fpr): Add argument card_version and fix DOs for old cards.
1595 (app_openpgp_storekey): Likewise.
1597 2003-07-23 Werner Koch <wk@gnupg.org>
1599 * command.c (cmd_pkauth): New.
1600 (cmd_setdata): Check whether data was given at all to avoid
1601 passing 0 to malloc.
1603 * app.c (app_auth): New.
1604 * app-openpgp.c (do_auth): New.
1606 2003-07-22 Werner Koch <wk@gnupg.org>
1608 * command.c (cmd_passwd): New.
1609 * app.c (app_change_pin): New.
1610 * app-openpgp.c (do_change_pin): New.
1611 * iso7816.c (iso7816_reset_retry_counter): Implemented.
1613 * sc-investigate.c (main): New option --gen-random.
1614 * iso7816.c (iso7816_get_challenge): Don't create APDUs with a
1615 length larger than 255.
1617 2003-07-17 Werner Koch <wk@gnupg.org>
1619 * command.c (cmd_random): New command RANDOM.
1621 * iso7816.c (map_sw): New. Use it in this file to return
1622 meaningful error messages. Changed all public fucntions to return
1624 (iso7816_change_reference_data): New.
1625 * apdu.c (apdu_open_reader): Use faked status words for soem
1628 2003-07-16 Werner Koch <wk@gnupg.org>
1630 * apdu.c (apdu_send_simple): Use apdu_send_le so that we can
1631 specify not to send Le as it should be.
1633 2003-07-15 Werner Koch <wk@gnupg.org>
1635 * Makefile.am: Add sc-copykeys program.
1636 * sc-copykeys.c: New.
1637 * app-openpgp.c (app_openpgp_storekey): New.
1638 (app_openpgp_cardinfo): New.
1640 (store_fpr): And use it here to get the actual length in bit.
1642 2003-07-03 Werner Koch <wk@gnupg.org>
1644 * app-openpgp.c (do_setattr): Add setting of the URL.
1645 (app_select_openpgp): Dump card data only in very verbose mode.
1648 2003-07-02 Werner Koch <wk@gnupg.org>
1650 * app-openpgp.c (get_sig_counter): New.
1651 (do_sign): Print the signature counter and enable the PIN callback.
1652 (do_genkey): Implement the PIN callback.
1654 2003-07-01 Werner Koch <wk@gnupg.org>
1656 * app-openpgp.c (store_fpr): Fixed fingerprint calculation.
1658 2003-06-26 Werner Koch <wk@gnupg.org>
1660 * app-openpgp.c (find_tlv): Fixed length header parsing.
1662 * app.c (app_genkey): New.
1663 * command.c (cmd_genkey): New.
1665 2003-06-25 Werner Koch <wk@gnupg.org>
1667 * command.c (percent_plus_unescape): New.
1670 2003-06-24 Werner Koch <wk@gnupg.org>
1672 * command.c (send_status_info): New.
1674 * app-openpgp.c (app_select_openpgp): Replace SLOT arg by APP arg
1675 and setup the function pointers in APP on success. Changed callers.
1677 * app-common.h: New.
1678 * scdaemon.h (APP): New type to handle applications.
1679 (server_control_s): Add an APP context field.
1681 * command.c (cmd_serialno): Handle applications.
1682 (cmd_pksign): Ditto.
1683 (cmd_pkdecrypt): Ditto.
1684 (reset_notify): Ditto.
1685 (cmd_learn): For now return error for application contexts.
1686 (cmd_readcert): Ditto.
1687 (cmd_readkey): Ditto.
1689 2003-06-04 Werner Koch <wk@gnupg.org>
1691 * card.c (map_sc_err): Renamed gpg_make_err to gpg_err_make.
1693 Renamed error codes from INVALID to INV and removed _ERROR suffixes.
1695 2003-06-03 Werner Koch <wk@gnupg.org>
1697 Changed all error codes in all files to the new libgpg-error scheme.
1699 * scdaemon.h: Include gpg-error.h and errno.h
1700 * card.c (map_sc_err): Use unknown for the error source.
1701 * Makefile.am: Link with libgpg-error
1703 2003-05-14 Werner Koch <wk@gnupg.org>
1705 * atr.c, atr.h: New.
1706 * sc-investigate.c: Dump the ATR in a human readable format.
1708 2003-05-08 Werner Koch <wk@gnupg.org>
1710 * scdaemon.h (DBG_CARD_IO_VALUE): New.
1712 * sc-investigate.c: New.
1713 * scdaemon.c (main): Removed --print-atr option.
1715 * iso7816.c, iso7816.h, app-openpgp.c: New.
1717 2003-04-29 Werner Koch <wk@gnupg.org>
1719 * scdaemon.c: New options --print-atr and --reader-port
1720 * apdu.c, apdu.h: New
1722 * card.c, card-p15.c, card-dinsig.c: Allow build without OpenSC.
1724 * Makefile.am (LDFLAGS): Removed.
1726 * command.c (register_commands): Adjusted for new Assuan semantics.
1728 2002-08-21 Werner Koch <wk@gnupg.org>
1730 * scdaemon.c (main): New option --daemon so that the program is
1731 not accidently started in the background.
1733 2002-08-16 Werner Koch <wk@gnupg.org>
1735 * scdaemon.c: Include i18n.h.
1737 * card-common.h (struct p15_private_s): Forward declaration. Add
1739 * card.c (card_close): Make sure private data is released.
1740 (card_enum_certs): New.
1741 * card-p15.c (p15_release_private_data): New.
1742 (init_private_data): New to work around an OpenSC weirdness.
1743 (p15_enum_keypairs): Do an OpenSC get_objects only once.
1744 (p15_enum_certs): New.
1745 (card_p15_bind): Bind new function.
1746 * command.c (cmd_learn): Return information about the certificates.
1748 2002-08-09 Werner Koch <wk@gnupg.org>
1750 * card.c (card_get_serial_and_stamp): Use the tokeinfo serial
1751 number as a fallback. Add a special prefix for serial numbers.
1753 2002-07-30 Werner Koch <wk@gnupg.org>
1755 Changes to cope with OpenSC 0.7.0:
1757 * card.c: Removed the check for the packed opensc version.
1758 Changed include file names of opensc.
1759 (map_sc_err): Adjusted error codes for new opensc version.
1760 * card-p15.c: Changed include filename of opensc.
1761 * card-dinsig.c: Ditto.
1763 * card-p15.c (p15_decipher): Add flags argument to OpenSC call.
1765 2002-07-24 Werner Koch <wk@gnupg.org>
1767 * card.c (find_simple_tlv, find_iccsn): New.
1768 (card_get_serial_and_stamp): Improved serial number parser.
1770 2002-06-27 Werner Koch <wk@gnupg.org>
1772 * scdaemon.c (main): Use GNUPG_DEFAULT_HOMEDIR constant.
1774 2002-06-15 Werner Koch <wk@gnupg.org>
1776 * card-dinsig.c: Documented some stuff from the DIN norm.
1778 2002-04-15 Werner Koch <wk@gnupg.org>
1780 * command.c (cmd_pksign, cmd_pkdecrypt): Use a copy of the key ID.
1782 2002-04-12 Werner Koch <wk@gnupg.org>
1784 * scdaemon.c: New option --debug-sc N.
1785 * card.c (card_open): set it here.
1787 * card-p15.c (p15_prepare_key): Factored out common code from ...
1788 (p15_sign, p15_decipher): here and made the decryption work the
1791 2002-04-10 Werner Koch <wk@gnupg.org>
1793 * card.c (card_open): Return immediately when no reader is available.
1795 2002-03-27 Werner Koch <wk@gnupg.org>
1797 * card.c (card_open, card_close): Adjusted for changes in OpenSC.
1799 2002-03-10 Werner Koch <wk@gnupg.org>
1801 * card-p15.c, card-dinsig.c, card-common.h: New.
1802 * card.c: Factored most code out to the new modules, so that we
1803 can better support different types of card applications.
1805 2002-01-26 Werner Koch <wk@gnupg.org>
1807 * scdaemon.c scdaemon.h, command.c: New. Based on the code from
1811 Copyright 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
1813 This file is free software; as a special exception the author gives
1814 unlimited permission to copy and/or distribute it, with or without
1815 modifications, as long as this notice is preserved.
1817 This file is distributed in the hope that it will be useful, but
1818 WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
1819 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.