Better syncronization of several smartcard sessions.
[gnupg.git] / scd / ChangeLog
blobc12603a598eec6f6960ad284b1800e3e584afe18
1 2009-03-24  Werner Koch  <wk@g10code.com>
3         * command.c (struct server_local_s): Add flag
4         APP_CTX_MARKED_FOR_RELEASE.
5         (do_reset): Set the flag.
6         (open_card): Act on this flag.
7         * app-common.h (struct app_ctx_s): Add flag NO_REUSE.
8         (application_notify_card_reset): Set the flag.
9         * app.c (select_application, release_application): Take care of
10         that flag.
12 2009-03-20  Werner Koch  <wk@g10code.com>
14         * app-nks.c (keygripstr_from_pk_file): Fix for TCOS 3 cards.
16 2009-03-18  Werner Koch  <wk@g10code.com>
18         * apdu.c (open_pcsc_reader_wrapped): Use close_all_fds.
20         * command.c (cmd_learn): Add option --keypairinfo.
21         * app.c (app_write_learn_status): Add arg FLAGS.
22         * app-common.h (struct app_ctx_s): Add arg FLAGS to LEARN_STATUS.
23         Change all implementors.
24         * app-p15.c (do_learn_status): Take care of flag bit 0.
25         * app-nks.c (do_learn_status, do_learn_status_core): Ditto.
27 2009-03-10  Werner Koch  <wk@g10code.com>
29         * app-openpgp.c (send_key_attr): New.
30         (do_getattr): New attribute KEY_ATTR.
31         * command.c (send_status_direct): New.
33 2009-03-06  Werner Koch  <wk@g10code.com>
35         * app-nks.c (do_learn_status): Factor code out to..
36         (do_learn_status_core): .. new.
37         (do_readcert, do_sign, do_decipher): Switch to SigG if needed.
38         (verify_pin): Use DESC also for keypad based verify.
40 2009-03-05  Werner Koch  <wk@g10code.com>
42         * app-openpgp.c (verify_a_chv): Remove special case for keypads.
43         (verify_chv3): Ditto.
45         * app-nks.c (get_chv_status): New.
46         (parse_pwidstr): New.
47         (verify_pin): Add args PWID and DESC and use them.  Remove the
48         CHV1 caching.
49         (do_change_pin): Allow PIN selection and add reset mode.
50         (do_learn_status): Use NKS-NKS3 tag for TCOS 3 cards.
51         (do_readcert, do_sign): Allow NKS-NKS3 tag.
53 2009-03-04  Werner Koch  <wk@g10code.com>
55         * app-nks.c (do_getattr): New.
56         (app_select_nks): Register it.
57         (verify_pin): Factor some code out to...
58         (basic_pin_checks): New.
59         (do_change_pin): Call the basic check.
60         (app_select_nks): Move AID to ..
61         (aid_nks): .. new.
62         (aid_sigg): New.
63         (switch_application): New.
64         (do_getattr, do_learn_status, do_readcert, do_sign, do_decipher) 
65         (do_change_pin, do_check_pin): Make sure we are in NKS mode.
67 2009-03-03  Werner Koch  <wk@g10code.com>
69         * command.c (scd_command_handler): Remove dereference of STOPME
70         after free.
72 2009-02-27  Werner Koch  <wk@g10code.com>
74         * app.c (get_supported_applications): New.
75         * command.c (cmd_getinfo): New subcommand "app_list"
76         (cmd_killscd): New.
77         (register_commands): Register command KILLSCD.
78         (struct server_local_s): Add field STOPME.
79         (scd_command_handler): Act upon this.
81 2009-02-25  Werner Koch  <wk@g10code.com>
83         * apdu.c (apdu_get_status): Factor all code out to ...
84         (apdu_private_get_status): .. new.  Add arg NO_ATR_RESET.
85         (apdu_connect): Call new function.
87         * scdaemon.c: New option --debug-log-tid.
88         (tid_log_callback): New.
89         (main): Move debug-wait code after debug stream init.
91 2009-02-24  Werner Koch  <wk@g10code.com>
93         * ccid-driver.c (ccid_get_atr): Move debug output to ..
94         (print_r2p_parameters): .. new.
95         (print_r2p_header, print_pr_data, print_r2p_unknown)
96         (print_r2p_datablock, print_r2p_slotstatus, print_r2p_escape) 
97         (print_r2p_datarate): New.
98         (bulk_in): Call parameter printing.
99         (ccid_set_debug_level): Add debug level 3.
100         (convert_le_u16): New.
101         (print_p2r_header, print_p2r_iccpoweron, print_p2r_iccpoweroff) 
102         (print_p2r_getslotstatus, print_p2r_xfrblock) 
103         (print_p2r_getparameters, print_p2r_resetparameters) 
104         (print_p2r_setparameters, print_p2r_escape, print_p2r_iccclock) 
105         (print_p2r_to0apdu, print_p2r_secure, print_p2r_mechanical) 
106         (print_p2r_abort, print_p2r_setdatarate, print_r2p_unknown): New.
107         (bulk_out): Add arg NO_DEBUG and change all callers to pass 0.
108         Call parameter printing.
109         (ccid_slot_status): Call with NO_DEBUG set.
110         (abort_cmd, send_escape_cmd, ccid_get_atr, ccid_get_atr) 
111         (ccid_transceive_apdu_level, ccid_transceive) 
112         (ccid_transceive_secure): Remove old debug print code.
114 2009-02-12  Werner Koch  <wk@g10code.com>
116         * command.c (cmd_getinfo): Add new subcommand "deny_admin".
118 2009-01-28  Werner Koch  <wk@g10code.com>
120         * scdaemon.c (main): Make --allow-admin the default and make the
121         option a dummy.
123 2009-01-27  Werner Koch  <wk@g10code.com>
125         * app-geldkarte.c: Changed to use an AID.
127         * app.c (app_munge_serialno): Add case for no serialno.
128         (app_get_serial_and_stamp): Ditto.
130 2009-01-26  Werner Koch  <wk@g10code.com>
132         * app-geldkarte.c: New.
133         * Makefile.am (card_apps): Add new file.
134         * app.c (select_application): Test for geldkarte.
136 2009-01-12  Werner Koch  <wk@g10code.com>
138         * command.c (send_client_notifications) [HAVE_W32_SYSTEM]: Fix
139         brackets.
141 2009-01-08  Werner Koch  <wk@g10code.com>
143         * iso7816.c (iso7816_read_record, iso7816_read_binary): Pass 0 for
144         L_e because the problem with the CCID driver has gone.
145         (iso7816_apdu_direct): New.
147         * app-nks.c (filelist): Add NKS_VER field.  Add NKS 3 specific
148         entries.
149         (app_local_s, do_deinit): New.
150         (get_nks_version): New.
151         (app_select_nks): Setup local data.
152         (keygripstr_from_pk_file): Replace SLOT by APP and take care of
153         NKS version > 2.
154         (do_learn_status): Take care of NKS version.
156 2009-01-05  Werner Koch  <wk@g10code.com>
158         * apdu.c (apdu_get_status): Save the last status.
160 2008-12-18  Werner Koch  <wk@g10code.com>
162         * ccid-driver.c (abort_cmd): New. 
163         (bulk_in): Call abort_cmd after severe errors.
165         * apdu.c (reader_table_s): Add field ANY_STATUS.
166         (new_reader_slot): Clear it.
167         (apdu_get_status): Use ANY_STATUS to update the change counter.
168         Remove the use of the flag bit from LAST_STATUS everywhere.
169         * command.c (update_reader_status_file): Factor code out to ...
170         (send_client_notifications): New.  Track signals already sent.
171         (update_reader_status_file): Shutdown the reader  after a failed
172         apdu_get_status.
174 2008-12-09  Werner Koch  <wk@g10code.com>
176         * scdaemon.c (main): Call i18n_init before init_common_subsystems.
178 2008-12-08  Werner Koch  <wk@g10code.com>
180         * scdaemon.c (handle_connections): Sync ticker to the next full
181         interval.
182         (TIMERTICK_INTERVAL_USEC): Change to 500ms.
184 2008-12-05  Werner Koch  <wk@g10code.com>
186         * app-openpgp.c (app_local_s): Add field ALGO_ATTR_CHANGE.
187         (app_select_openpgp): Parse new capability.
188         (show_caps): Show new capability.
190 2008-12-03  Werner Koch  <wk@g10code.com>
192         * scdaemon.c (opts): Use ARGPARSE_ macros.  Add option
193         --card-timeout.
194         * command.c (update_reader_status_file): Implement it.
196 2008-11-18  Werner Koch  <wk@g10code.com>
198         * scdaemon.c (make_libversion): New.
199         (my_strusage): Print libgcrypt and libksba version.
201 2008-11-03  Werner Koch  <wk@g10code.com>
203         * command.c (server_local_s): Add field DISCONNECT_ALLOWED.
204         (cmd_disconnect): Implement command.
205         (open_card): Reset disconnect flag.
206         (update_reader_status_file): Disconnect if allowed.
208         * app-common.h (app_ctx_s): Remove INITIALIZED.  Make REF_COUNT
209         unsigned. 
210         * app.c (select_application): Remove INITIALIZED.
211         (app_write_learn_status, app_readcert, app_readkey, app_getattr)
212         (app_setattr, app_sign, app_decipher, app_writecert)
213         (app_writekey, app_get_challenge, app_change_pin, app_check_pin):
214         Replace INITIALIZED by REF_COUNT check.
215         (application_notify_card_removed): Rename to ..
216         (application_notify_card_reset): .. this.  Change all callers.
217         * command.c (do_reset): Call application_notify_card_reset after
218         sending a reset.
219         (update_reader_status_file): Add arg SET_CARD_REMOVED.
220         (scd_update_reader_status_file): Pass true for new flag.
221         (do_reset): Pass false for new flag.
223         * app.c (app_get_serial_and_stamp): Use bin2hex.
224         * app-help.c (app_help_get_keygrip_string): Ditto.
225         * app-p15.c (send_certinfo, send_keypairinfo, do_getattr): Ditto.
226         * app-openpgp.c (send_fpr_if_not_null, send_key_data) 
227         (retrieve_fpr_from_card, send_keypair_info): Ditto.
228         * app-nks.c (keygripstr_from_pk_file): Ditto.
229         * command.c (cmd_apdu): Ditto.
231 2008-10-21  Marcus Brinkmann  <marcus@g10code.com>
233         * command.c (open_card): If connect error is SW_HOST_NO_CARD,
234         return a more descriptive error.
236 2008-10-20  Werner Koch  <wk@g10code.com>
238         * pcsc-wrapper.c (read_32): Use provided arg and not stdin.  Is
239         called with stdin, though.
240         (handle_close): Mark unused arg.
241         (handle_status, handle_reset): Ditto.
243         * ccid-driver.c (ccid_check_card_presence): Mark not yet used arg.
245         * scdaemon.c (scd_deinit_default_ctrl): Mark unused arg.
246         * command.c (cmd_unlock, cmd_restart, cmd_disconnect): Ditto.
247         * apdu.c (ct_get_status): Ditto.
248         (ct_send_apdu, pcsc_send_apdu_wrapped)
249         (apdu_open_remote_reader): Ditto.
250         * app.c (select_application): Ditto.
251         * app-openpgp.c (do_writecert, do_change_pin, do_writekey): Ditto.
252         * app-nks.c (do_change_pin, do_check_pin): Ditto.
254 2008-10-16  Werner Koch  <wk@g10code.com>
256         * command.c (cmd_disconnect): New dummy command.
257         (register_commands): Register command.
259 2008-10-15  Werner Koch  <wk@g10code.com>
261         * command.c (scd_command_handler): Return true if there is no more
262         active session.
263         * scdaemon.c (start_connection_thread): Set shutdown flag if
264         requested by command handler.
265         (main): Make PIPE_SERVER module global.
266         (handle_connections): Disable listen_fd if a shutdown is pending.
268 2008-10-14  Werner Koch  <wk@g10code.com>
270         * apdu.c (reader_table_s): Add fields connect_card and
271         disconnect_card.
272         (new_reader_slot): Set them to NULL.
273         (apdu_connect, apdu_disconnect): New.
274         (apdu_close_reader, apdu_shutdown_reader): Call apdu_disconnect.
275         (connect_pcsc_card, disconnect_pcsc_card): new.
276         (reset_pcsc_reader_direct): Implement in terms of
277         disconnect_pcsc_card and connect_pcsc_card.
278         (apdu_get_atr): Return NULL if there is no ATR.
279         * sc-copykeys.c (main): Add call to apdu_connect.
280         * command.c (open_card): Ditto.
282         * apdu.h (SW_HOST_ALREADY_CONNECTED): New.
283         (APDU_CARD_USABLE, APDU_CARD_PRESENT, APDU_CARD_ACTIVE): New.
284         * apdu.c: Replace constants by the new macros.
285         (open_pcsc_reader): Factor  code out to ...
286         (open_pcsc_reader_direct, open_pcsc_reader_wrapped): New.
287         (reset_pcsc_reader): Factor code out to ...
288         (reset_pcsc_reader_direct, reset_pcsc_reader_wrapped): New.
289         (pcsc_get_status): Factor code out to ...
290         (pcsc_get_status_direct, pcsc_get_status_wrapped): New.
291         (pcsc_send_apdu): Factor code out to ...
292         (pcsc_send_apdu_direct, pcsc_send_apdu_wrapped): New.
293         (close_pcsc_reader): Factor code out to ...
294         (close_pcsc_reader_direct, close_pcsc_reader_wrapped): New.
296         * command.c (update_reader_status_file): Open the reader if not
297         yet done.
299         * scdaemon.c (TIMERTICK_INTERVAL_SEC, TIMERTICK_INTERVAL_USEC):
300         New to replace TIMERTICK_INTERVAL.  Chnage from 2s (4 under W32)
301         to 250ms.
303 2008-10-13  Werner Koch  <wk@g10code.com>
305         * command.c (option_handler) [W32]: Use strtoul with base 16.
306         (update_reader_status_file) [W32]: Set Event.
307         (scd_command_handler): Use INT2FD to silent warning.
309 2008-09-29  Werner Koch  <wk@g10code.com>
311         * scdaemon.h (GCRY_MD_USER): Rename to GCRY_MODULE_ID_USER.
312         (GCRY_MD_USER_TLS_MD5SHA1): Rename to MD_USER_TLS_MD5SHA1 and
313         change all users.
315 2008-09-28  Marcus Brinkmann  <marcus@g10code.com>
317         * apdu.c (pcsc_get_status): Fix last change.
319 2008-09-25  Werner Koch  <wk@g10code.com>
321         * app-openpgp.c (do_setattr): Do not allow setting of the reset
322         code.
323         (do_change_pin): Allow setting of the reset code.
325 2008-09-24  Werner Koch  <wk@g10code.com>
327         * app-openpgp.c (verify_chv3): Set the did_chv3 flag which was
328         accidently removed on 2008-03-26.
329         (verify_chv2): Revert last change.
330         (do_change_pin): Do not change CHV2. Add reset code logic for v2
331         cards.
332         * iso7816.c (iso7816_reset_retry_counter_with_rc): New.
333         
334         * app-openpgp.c (add_tlv, build_privkey_template): New.
335         (do_writekey): Support v2 keys and other key lengths than 1024.
336         * iso7816.c (iso7816_put_data_odd): New.
338 2008-09-23  Werner Koch  <wk@g10code.com>
340         * app-openpgp.c (do_sign): Support SHA-2 digests.
341         (verify_chv2): No CHV auto-sync for v2 cards.
342         (do_auth): Allow 2048 bit keys.
343         (parse_algorithm_attribute): New.
344         (rsa_key_format_t): New.
345         (struct app_local_s): Add struct KEYATTR.
347 2008-09-23  Marcus Brinkmann  <marcus@g10code.com>
349         * apdu.c (pcsc_get_status): Be more relaxed with the usable flag
350         under Windows.
352 2008-09-23  Werner Koch  <wk@g10code.com>
354         * app-openpgp.c (do_setattr): Use command chaining for long
355         values.
356         * iso7816.c (iso7816_put_data): Add arg EXTENDED_MODE. Change all
357         callers.
358         * apdu.c (apdu_send_simple): Add arg EXTENDED_MODE. Change all
359         callers.
360         (send_le): Implement command chaining.
361         * ccid-driver.c (ccid_transceive_apdu_level): Increase allowed
362         APDU size.
363         (ccid_transceive): Alow for APDUS of up to 259 bytes.
364         * apdu.h: Add new SW_ codes.
366 2008-09-16  Werner Koch  <wk@g10code.com>
368         * command.c (cmd_writecert): New.
369         (register_commands): Register it.
370         * app-common.h (app_ctx_s): Add member WRITECERT.
371         * app.c (app_writecert): New.
372         * app-openpgp.c (do_writecert): New.
373         (parse_historical): New.
374         (show_extcap): New.
375         (dump_all_do): Print only the length of longs DOs.
376         * command.c (cmd_writekey, cmd_apdu, cmd_pksign)
377         (cmd_passwd): Replace open coding by skip_options.
379 2008-08-30  Moritz  <moritz@gnu.org>
381         * scdaemon.c (main): Use estream_asprintf instead of asprintf.
382         * command.c (update_reader_status_file): Likewise.
383         (cmd_serialno): Use estream_asprintf instead of asprintf
384         and xfree instead of free to release memory allocated
385         through (estream_)asprintf.
386         (cmd_learn): Likewise.
387         (pin_cb): Likewise.
388         * app-openpgp.c (get_public_key): Likewise.
390 2008-08-18  Werner Koch  <wk@g10code.com>
392         * app-openpgp.c (do_setattr): Fix test for v2 cards.
394 2008-08-11  Werner Koch  <wk@g10code.com>
396         * apdu.c (reset_pcsc_reader, open_pcsc_reader)
397         (reset_rapdu_reader, open_rapdu_reader): Allow ATRs of up to 33
398         bytes.  Provide maximum size of ATR buffer using DIM.  Such long
399         ATR are never seen in reality but the PC/SC library of MAC OS X is
400         just too buggy.  Reported by Ludovic Rousseau.  Fixes bug #948.
402 2008-07-30  Werner Koch  <wk@g10code.com>
404         * app-openpgp.c (verify_a_chv): Use xtrymalloc and make the prompt
405         for CHV2 more user friendly.
407 2008-07-03  Werner Koch  <wk@g10code.com>
409         * app-openpgp.c (do_readcert): New.
410         (app_local_s): Add fields IS_V2 and MAX_CERTLEN_3.
411         (app_select_openpgp): Set them and register do_readcert.
412         (do_setattr): Allow storing of the certificate.
414 2008-06-25  Werner Koch  <wk@g10code.com>
416         * app-dinsig.c (do_sign): Allow for SHA256.
418 2008-06-24  Werner Koch  <wk@g10code.com>
420         * app-common.h (app_ctx_s): Renamed reset_mode parameter of
421         change_pin to mode_Flags and make it an unsigned int.
422         (APP_CHANGE_FLAG_RESET, APP_CHANGE_FLAG_NULLPIN): New.
423         * app-openpgp.c (do_change_pin): Adjust for that.
425         * command.c (cmd_passwd): Add option --nullpin.
426         * app-nks.c (do_check_pin, do_change_pin): New.
427         (app_select_nks): Register new functions.
429 2008-04-21  Moritz Schulte  <mo@g10code.com>  (wk)
431         * app-openpgp.c (verify_a_chv): Make use of the default CHV flag.
433 2008-03-26  Werner Koch  <wk@g10code.com>
435         * app-openpgp.c (verify_chv3): Support the keypad.
437 2008-02-09  Marcus Brinkmann  <marcus@g10code.de>
439         * scdaemon.c (main): Use CONFIG_FILENAME as filename if it is set
440         in gpgconf-list output.
442 2007-12-10  Werner Koch  <wk@g10code.com>
444         * app-openpgp.c (do_decipher): Take care of cryptograms shorter
445         that 128 bytes.  Fixes bug#851.
447 2007-11-14  Werner Koch  <wk@g10code.com>
449         * scdaemon.c (main): Pass STANDARD_SOCKET flag to
450         create_server_socket.
451         
452 2007-11-13  Werner Koch  <wk@g10code.com>
454         * scdaemon.c (start_connection_thread): Do not call
455         assuan_sock_check_nonce if we are running in --server mode.
457 2007-11-07  Werner Koch  <wk@g10code.com>
459         * scdaemon.h: Remove errors.h.
461 2007-10-02  Werner Koch  <wk@g10code.com>
463         * command.c (cmd_getinfo): Add "pid" subcommand.
465 2007-10-01  Werner Koch  <wk@g10code.com>
467         * scdaemon.c (create_server_socket): Use Assuan socket wrappers
468         and remove Windows specific code.
469         (socket_nonce): New.
470         (start_connection_thread): Check nonce.
472 2007-09-14  Marcus Brinkmann  <marcus@g10code.de>
474         * scdaemon.c (main): New variable STANDARD_SOCKET, which is 1 for
475         W32 targets.  Use it for create_socket_name.
477 2007-08-07  Werner Koch  <wk@g10code.com>
479         * tlv.c, tlv.h:  Move to ../common/.
481 2007-08-02  Werner Koch  <wk@g10code.com>
483         * scdaemon.c: Include gc-opt-flags.h and remove their definition
484         here.
486 2007-08-01  Werner Koch  <wk@g10code.com>
488         * apdu.c (send_le): Implement exact length hack.  Suggested by
489         Sten Lindgren.
491 2007-07-05  Werner Koch  <wk@g10code.com>
493         * command.c (has_option_name, skip_options): New.
494         (cmd_genkey): Add option --timestamp.
495         (cmd_writekey): Enter confidential mode while inquiring the key data.
497         * app.c (app_genkey): Add arg CREATETIME.
498         * app-common.h (app_ctx_s): Likewise
499         * app-openpgp.c (do_genkey): Ditto.  Use it.
502 2007-07-04  Werner Koch  <wk@g10code.com>
504         * command.c (cmd_getinfo): New subcommand "version".
506         * scdaemon.c (TIMERTICK_INTERVAL): New.
507         (handle_connections) [W32]: Enable a dummy sigs event.
508         (handle_connections): Use a proper count for select and not
509         FD_SETSIZE.
510         (fixed_gcry_pth_init, main): Kludge to fix pth initialization.
512 2007-06-21  Werner Koch  <wk@g10code.com>
514         * scdaemon.h (ctrl_t): Remove.  It is now declared in ../common/util.h.
516 2007-06-18  Marcus Brinkmann  <marcus@g10code.de>
518         * scdaemon.c (main): Percent escape output of --gpgconf-list.
520 2007-06-12  Werner Koch  <wk@g10code.com>
522         * scdaemon.c (main): Replace some calls by init_common_subsystems.
524 2007-06-11  Werner Koch  <wk@g10code.com>
526         * Makefile.am (scdaemon_LDADD): Use libcommonpth macro.
528         * command.c (initialize_module_command): New.
529         * scdaemon.c (main) [W32]: Do not use sigpipe code.
530         (main): Call initialize_module_command.
532 2007-06-06  Werner Koch  <wk@g10code.com>
534         * app-openpgp.c (do_sign): Fix arithmetic on void*.
536         * app.c (dump_mutex_state) [W32]: Handle the W32Pth case.
538         * apdu.c: Remove dynload.h.
540         * scdaemon.c (i18n_init): Remove.
542 2007-04-20  Werner Koch  <wk@g10code.com>
544         * sc-copykeys.c (my_gcry_logger): Removed.
545         (main): Call setup_libgcrypt_logging helper.
546         * scdaemon.c (my_gcry_logger): Removed.
547         (main): Call setup_libgcrypt_logging helper.
549 2007-04-03  Werner Koch  <wk@g10code.com>
551         * command.c (cmd_getinfo): New subcommand "reader_list".
552         * ccid-driver.c (scan_or_find_devices): Ignore EBUSY in scan mode
553         for special transports.
555 2007-03-07  Werner Koch  <wk@g10code.com>
557         * app-dinsig.c: Include i18n.h.
558         (verify_pin): Support PIN pads.
559         * app-nks.c (verify_pin): Ditto.
561         * ccid-driver.c (bulk_in): Handle time extension before checking
562         the message type.
563         (ccid_transceive_secure): Support the Cherry XX44 keyboard.
564         Kudos to the nice folks at Cherry for helping with that.
566 2007-02-18  Werner Koch  <wk@g10code.com>
568         * scdaemon.c (DEFAULT_PCSC_DRIVER): Add a default for OS X.
570 2007-01-25  Werner Koch  <wk@g10code.com>
572         * Makefile.am (scdaemon_LDADD): Added LIBICONV.  Noted by Billy
573         Halsey.
575 2006-12-21  Werner Koch  <wk@g10code.com>
577         * app-openpgp.c (verify_chv2): Factored most code out into...
578         (verify_a_chv): ... new.
579         (do_sign): Factored verification code out to new function and
580         take care of a keypad entered PIN.
581         (compare_fingerprint): Print an additional diagnostic.
583 2006-11-28  Werner Koch  <wk@g10code.com>
585         * apdu.c (send_le, apdu_send_direct): Increase RESULTLEN to 258 to
586         allow for full 256 byte and the status word.  This might break
587         some old PC/SC drivers or cards, but we will see.  Suggested by
588         Kenneth Wang.
590 2006-11-23  Werner Koch  <wk@g10code.com>
592         * command.c (scd_command_handler): Fixed use of CTRL.
594 2006-11-21  Werner Koch  <wk@g10code.com>
596         * Makefile.am (libexec_PROGRAMS): Put pscs-wrapper into libexec.
597         Renamed to gnupg-pcsc-wrapper.
598         * apdu.c (open_pcsc_reader): Use GNUPG_LIBEXECDIR to accces the
599         wrapper.  Suggested by Eric Dorland.
601 2006-11-20  Werner Koch  <wk@g10code.com>
603         * app-openpgp.c (verify_chv2): Support for keypads (only CHV2).
605         * ccid-driver.c (ccid_transceive_secure): Made it work for Kaan
606         and SCM.
608 2006-11-17  Werner Koch  <wk@g10code.com>
610         * ccid-driver.c (scan_or_find_devices): Use DEBUGOUT_2 instead of
611         log_debug.  Removed few other log_debug.
613         * iso7816.c (iso7816_check_keypad): Allow for a SW of 0.
615         * command.c (pin_cb): New mode to prompt for a keypad entry.
617         * scdaemon.c (main) <gpgconf-list>: Add disable-keypad.
619 2006-11-15  Werner Koch  <wk@g10code.com>
621         * app-p15.c (read_ef_odf): Cast one printf arg.
623         * scdaemon.h (struct server_control_s): Add field THREAD_STARTUP.
624         * command.c (scd_command_handler): Add new arg CTRL.
625         * scdaemon.c (scd_init_default_ctrl): Made static.
626         (scd_deinit_default_ctrl): New.
627         (start_connection_thread): Call init/deinit of ctrl.
628         (handle_connections): Allocate CTRL.
630         * apdu.c (PCSC_ERR_MASK): New.
631         (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu)
632         (close_pcsc_reader, open_pcsc_reader): Use it after shifting error
633         values.  Reported by Henrik Nordstrom.  Fixes bug #724.
635 2006-10-24  Werner Koch  <wk@g10code.com>
637         * scdaemon.h (GCRY_MD_USER_TLS_MD5SHA1): New.
638         (MAX_DIGEST_LEN): Increased to 36.
639         * app-p15.c (do_sign): Support for TLS_MD5SHA1.
640         (do_auth): Detect TLS_MD5SHA1.
641         (do_sign): Tweaks for that digest.
643 2006-10-23  Werner Koch  <wk@g10code.com>
645         * scdaemon.c (main): New command --gpgconf-test.
647 2006-10-17  Werner Koch  <wk@g10code.com>
649         * Makefile.am (scdaemon_LDADD): Link against libcommonpth.
651 2006-10-12  Werner Koch  <wk@g10code.com>
653         * apdu.c: Include pth.h after unistd.h for the sake of newer Pth
654         versions.
656 2006-10-11  Werner Koch  <wk@g10code.com>
658         * app-openpgp.c (do_sign): Redirect to do_auth for OpenPGP.3.
660 2006-10-06  Werner Koch  <wk@g10code.com>
662         * Makefile.am (AM_CFLAGS): Use PTH version of libassuan.
663         (scdaemon_LDADD): Ditto.
665         * scdaemon.h (send_status_info): Mark with sentinel attribute.
667 2006-10-02  Marcus Brinkmann  <marcus@g10code.de>
669         * command.c (update_reader_status_file): Increase buffer of
670         NUMBUF2 (fixing typo).
672 2006-09-24  Marcus Brinkmann  <marcus@g10code.de>
674         * app-openpgp.c (do_sign): Advance INDATA by the SHA1 resp. RMD160
675         prefix length.
677 2006-09-14  Werner Koch  <wk@g10code.com>
679         Replaced all call gpg_error_from_errno(errno) by
680         gpg_error_from_syserror().
682         * command.c (scd_command_handler): Replaced
683         init_connected_socket_server by init_socket_server_ext.
685 2006-09-07  Werner Koch  <wk@g10code.com>
687         * command.c (update_reader_status_file): Execute an event handler
688         if available.
690 2006-09-06  Werner Koch  <wk@g10code.com>
692         * apdu.c (pcsc_end_transaction): 
693         * pcsc-wrapper.c (pcsc_end_transaction: Fixed dclaration.
694         Reported by Bob Dunlop.
696         * scdaemon.h (CTRL,APP): Removed and changed everywhere to
697         ctrl_t/app_t.
699         Replaced all Assuan error codes by libgpg-error codes.  Removed
700         all map_to_assuan_status and map_assuan_err.
701         
702         * scdaemon.c (main): Call assuan_set_assuan_err_source to have Assuan
703         switch to gpg-error codes.
704         * command.c (set_error): Adjusted.
706 2006-09-02  Marcus Brinkmann  <marcus@g10code.de>
708         * command.c (get_reader_slot): Return the slot_table index, not
709         the APDU slot number.
710         (update_reader_status_file): Use the slot_table index in the
711         update_card_removed invocation.
713 2006-09-01  Marcus Brinkmann  <marcus@g10code.de>
715         * command.c (cmd_getinfo): Handle status command.
717 2006-08-30  Marcus Brinkmann  <marcus@g10code.de>
719         * command.c (do_reset): Delay resetting CTRL->reader_slot until
720         after update_card_removed invocation.
722 2006-08-28  Marcus Brinkmann  <marcus@g10code.de>
724         * app-openpgp.c (do_decipher, do_sign): Allow "OPENPGP.2"
725         resp. "OPENPGP.1" for KEYIDSTR.
727 2006-08-21  Werner Koch  <wk@g10code.com>
729         * pcsc-wrapper.c (handle_open, handle_close): Reset card and
730         protocol on error/close.
731         (handle_status): Don't set the state if the state is unknown.
732         (handle_reset): Ignore an error if already disconnected.  May
733         happen due to system wake-up after hibernation.  Suggested by Bob
734         Dunlop.
736 2006-06-28  Werner Koch  <wk@g10code.com>
738         * app-openpgp.c (do_writekey): Fixed computation of memmove
739         length.  This led to garbled keys if E was larger than one byte.
740         Thanks to Achim Pietig for hinting at the garbled E.
742 2006-06-09  Marcus Brinkmann  <marcus@g10code.de>
744         * Makefile.am (scdaemon_LDADD): Add $(NETLIBS).
746 2006-04-14  Marcus Brinkmann  <marcus@g10code.de>
748         * app.c (select_application): Cover up a slot mismatch error in
749         case it happens (it shouldn't happen).
750         (release_application): Use APP->slot.  Lock the reader.
751         (application_notify_card_removed): Lock the reader.
753 2006-04-11  Werner Koch  <wk@g10code.com>
755         * command.c (hex_to_buffer): New.
756         (cmd_apdu): New.
758 2006-04-03  Werner Koch  <wk@g10code.com>
760         * scdaemon.c [__GLIBC__]: Default to libpcsclite.so.1.
762 2006-03-21  Werner Koch  <wk@g10code.com>
764         * command.c (cmd_pksign): Add --hash option.
766 2006-03-01  Werner Koch  <wk@g10code.com>
768         * command.c (status_file_update_lock): New.
769         (scd_update_reader_status_file): Use lock and factor existing code
770         out to ..
771         (update_reader_status_file): .. this.
772         (do_reset): Use the lock and call update_reader_status_file.
774 2006-02-20  Werner Koch  <wk@g10code.com>
776         * apdu.c (open_pcsc_reader): Fixed double free.  Thanks to Moritz.
778 2006-02-09  Werner Koch  <wk@g10code.com>
780         * command.c (get_reader_slot, do_reset) 
781         (scd_update_reader_status_file): Rewrote.
783         * app.c (release_application): Factored code out to ..
784         (deallocate_app): new function.
785         (select_application): Introduce new saved application stuff.
786         (application_notify_card_removed): New.
787         * command.c (update_card_removed): Call it here.
788         (do_reset): And here.
790         * app.c (check_application_conflict): New.
791         * command.c (open_card): Use it here.
792         (cmd_restart): New command.
794         * command.c (cmd_lock): Fixed --wait option to actually terminate.
796 2006-02-08  Werner Koch  <wk@g10code.com>
798         * ccid-driver.c (ccid_get_atr): Read Parameter and select T=1
799         using these parameters.
800         (scan_or_find_devices): Check for NULL r_fd.
802 2006-02-02  Werner Koch  <wk@g10code.com>
804         * ccid-driver.c (special_transport): New
805         (ccid_open_reader, do_close_reader, ccid_shutdown_reader)
806         (bulk_out, bulk_in): Add support for CardMan 4040 reader.
808         * ccid-driver.c (scan_or_find_devices): Factored most code out to
809         (scan_or_find_usb_device): .. new.
810         (make_reader_id): Fixed vendor mask.
812 2006-01-01  Werner Koch  <wk@g10code.com>
814         * app-openpgp.c (do_sign): Give user error if hash algorithm is
815         not supported by the card.
817 2005-12-06  Werner Koch  <wk@g10code.com>
819         * apdu.c (open_pcsc_reader): Check that pcsc-wrapper is actually
820         installed.
822 2005-11-23  Werner Koch  <wk@g10code.com>
824         * app-nks.c (verify_pin): Give a special error message for a Nullpin.
826 2005-10-29  Werner Koch  <wk@g10code.com>
828         * ccid-driver.c (send_escape_cmd): New args RESULT, RESULTLEN and
829         RESULTMAX.  Changed all callers.
830         (ccid_transceive_escape): New.
832 2005-10-27  Werner Koch  <wk@g10code.com>
834         * apdu.c [__CYGWIN__]: Make cygwin environment similar to _WIN32.
835         Suggested by John P. Clizbe.
836         * scdaemon.c [__CYGWIN__]: Set default PC/SC driver to winscard.dll.
838 2005-10-19  Werner Koch  <wk@g10code.com>
840         * ccid-driver.h (CCID_DRIVER_ERR_NO_KEYPAD): New.
841         * apdu.h (SW_HOST_NO_KEYPAD): New.
842         * iso7816.h (struct iso7816_pininfo_s): New.
843         * iso7816.c (map_sw): Support new code.
844         (iso7816_check_keypad): New.
845         (iso7816_verify_kp, iso7816_change_reference_data_kp) 
846         (iso7816_reset_retry_counter_kp): New.  Extended versions of the
847         original functions.
848         * apdu.c (host_sw_string): Support new code. 
849         (reader_table_s): New field CHECK_KEYPAD.
850         (new_reader_slot, open_ct_reader, open_pcsc_reader) 
851         (open_ccid_reader, open_rapdu_reader): Initialize it.
852         (check_ccid_keypad): New.
853         (apdu_check_keypad): New.
854         (apdu_send_le): Factored all code out to ...
855         (send_le): .. new.  Takes an additional arg; changed all callers
856         of the orginal function to use this one with a NULL for the new
857         arg.
858         (apdu_send_simple_kp): New.
859         (ct_send_apdu, pcsc_send_apdu, my_rapdu_send_apdu) 
860         (send_apdu_ccid): New arg PININFO.
861         (send_apdu_ccid): Use the new arg.
863         * scdaemon.c: New option --disable-keypad.
865 2005-10-08  Marcus Brinkmann  <marcus@g10code.de>
867         * Makefile.am (scdaemon_LDADD): Add ../gl/libgnu.a after
868         ../common/libcommon.a.
870 2005-09-20  Werner Koch  <wk@g10code.com>
872         * app-dinsig.c (verify_pin): Try ISO 9564 BCD encoding.
874         * iso7816.c (iso7816_select_application): Add arg FLAGS.  Changed
875         all callers to pass 0.
876         * app-openpgp.c (app_select_openpgp): But this one requires a
877         special flag.
879         * app-p15.c (app_select_p15): Don't use select application for the
880         BELPIC.
882 2005-09-09  Werner Koch  <wk@g10code.com>
884         * pcsc-wrapper.c (main): Removed bogus free.
886         * app-p15.c (do_auth): New.
887         (do_getattr): New attribs $AUTHKEYID and $DISPSERIALNO.
888         * app-openpgp.c (do_getattr): Ditto.
890 2005-09-08  Werner Koch  <wk@g10code.com>
892         * app-openpgp.c (do_getattr): New key $AUTHKEYID.
894 2005-09-06  Werner Koch  <wk@g10code.com>
896         * app-p15.c (do_sign): Tweaked for BELPIC cards.
897         (read_home_df): New arg R_BELPIC.
898         (app_select_p15): Set card type for BELPIC.
900 2005-09-05  Werner Koch  <wk@g10code.com>
902         * iso7816.c (iso7816_select_path): New.
903         * app-p15.c (select_ef_by_path): Allow for direct path selection.
904         (app_select_p15): Try using the Belgian variant of pkcs#15.
905         (read_home_df): New.
906         (read_ef_odf): Generalized.
907         (read_ef_tokeninfo): New.
908         (read_p15_info): Set serialnumber from TokenInfo.
909         (app_select_p15): Don't munge serialNumber - that must be done
910         only once.
912         * iso7816.c (iso7816_read_binary): Use Le=0 when reading all
913         data.  Handle 6C00 error and take 6B00 as indication for EOF.
914         * apdu.h (SW_EXACT_LENGTH_P): New.
915         * apdu.c (new_reader_slot, reset_pcsc_reader, pcsc_get_status) 
916         (open_pcsc_reader): Set new reader state IS_T0.
917         (apdu_send_le): When doing T=0 make sure not to send Lc and Le.
918         Problem reported by Carl Meijer.
919         (apdu_send_direct): Initialize RESULTLEN.
920         * pcsc-wrapper.c (handle_status): Return the current protocol as
921         a new third word.
923 2005-08-05  Werner Koch  <wk@g10code.com>
925         * apdu.c (open_rapdu_reader): Set the reader number.
927 2005-07-05  Werner Koch  <wk@g10code.com>
929         * app-openpgp.c (do_readkey): Return a mallcoed copy of the key as
930         required by the description.  Thanks to Moritz for tracking this
931         problem down.
933 2005-06-21  Werner Koch  <wk@g10code.com>
935         * scdaemon.c (main): ifdef call to ccid_set_debug_level.
937         * apdu.c (reset_pcsc_reader, open_pcsc_reader): Cast size_t to
938         ulong for printf.
940 2005-06-06  Werner Koch  <wk@g10code.com>
942         * scdaemon.c (main): New option --debug-allow-core-dump. 
944 2005-06-03  Werner Koch  <wk@g10code.com>
946         * scdaemon.c (handle_connections): Make sure that the signals we
947         are handling are not blocked.Block signals while creating new
948         threads.
949         (handle_connections): Include the file descriptor into the name of
950         the thread.
952 2005-06-02  Werner Koch  <wk@g10code.com>
954         * app.c (app_dump_state, dump_mutex_state): New.
955         * scdaemon.c (handle_signal): Print it on SIGUSR1.
957         * app-openpgp.c (do_writekey): Typo fix.
959         * command.c (open_card): Check for locked state even if an
960         application context is available.
962         * app-common.h: Add REF_COUNT field.
963         * app.c (release_application, select_application): Implement
964         reference counting to share the context beween connections.
966         * app.c (lock_reader, unlock_reader): Take SLOT instead of APP as
967         argument.  Changed all callers.
968         (select_application): Unlock the reader on error.  This should fix
969         the hangs I noticed last week.
971         * scdaemon.h: Removed card_ctx_t cruft.
973 2005-06-01  Werner Koch  <wk@g10code.com>
975         * scdaemon.c: Include mkdtemp.h.
977 2005-05-31  Werner Koch  <wk@g10code.com>
979         * tlv.c [GNUPG_MAJOR_VERSION==1]: Define constants instead of
980         including a gnupg 1.4 header.
982 2005-05-30  Werner Koch  <wk@g10code.com>
984         * tlv.c: Add hack to compile without gpg-error.h when used with
985         GnuPG 1.4.
987 2005-05-23  Werner Koch  <wk@g10code.com>
989         * Makefile.am: Do not build sc-copykeys anymore.
991         * app-openpgp.c (app_openpgp_storekey, app_openpgp_readkey)
992         (app_openpgp_cardinfo): Removed.
994         * ccid-driver.c (parse_ccid_descriptor): SCR335 FW version 5.14 is
995         good.
996         (do_close_reader): Never do a reset. The caller should instead
997         make sure that the reader has been closed properly.  The new retry
998         code in ccid_slot_status will make sure that the readersatrts up
999         fine even if the last process didn't closed the USB connection
1000         properly.
1001         (ccid_get_atr): For certain readers try switching to ISO mode.
1002         Thanks to Ludovic Rousseau for this hint and the magic numbers.
1003         (print_command_failed): New.
1004         (bulk_in): Use it here. Add new arg NO_DEBUG.
1005         (ccid_slot_status): Disabled debugging.
1007 2005-05-21  Werner Koch  <wk@g10code.com>
1009         * scdaemon.c (handle_signal): Print thread info on SIGUSR1.
1011 2005-05-20  Werner Koch  <wk@g10code.com>
1013         * ccid-driver.c: Replaced macro DEBUG_T1 by a new debug level.
1014         (parse_ccid_descriptor): Mark SCR335 firmware version 5.18 good.
1015         (ccid_transceive): Arghhh.  The seqno is another bit in the
1016         R-block than in the I block, this was wrong at one place.
1018         * scdaemon.c: New options --debug-ccid-driver and
1019         --debug-disable-ticker.
1021         * app-openpgp.c (do_genkey, do_writekey): Factored code to check
1022         for existing key out into ..
1023         (does_key_exist): .. New function.
1025 2005-05-19  Werner Koch  <wk@g10code.com>
1027         * tlv.c (parse_sexp): New.
1029         * command.c (cmd_writekey): New.
1030         * app.c (app_writekey): New.
1031         * app-common.c (app_t): Add function ptr WRITEKEY.
1032         * app-openpgp.c (do_writekey): New.
1034         * app-openpgp.c (do_readkey) [GNUPG_MAJOR_VERSION==1]: Return error.
1035         * app-common.h (app_t) [GNUPG_MAJOR_VERSION==1]: Add a field to
1036         store the Assuan context.
1038 2005-05-17  Werner Koch  <wk@g10code.com>
1040         * scdaemon.c: Removed non-pth code paths.
1041         (create_socket_name, create_server_socket): New.  Taken from
1042         ../agent/gpg-agent.
1043         (cleanup): Changed to adjust for SOCKET_NAME now being malloced.
1044         (ticker_thread): Always use pth_event_occurred; it is again
1045         defined for all decent PTH versions.
1046         (handle_connections): New. Based on the gpg-agent code.
1047         (start_connection_thread): Ditto.
1048         (ticker_thread): Removed.
1049         (cleanup_sh): Removed.
1050         (main): Run the handler for the pipe server in a separate
1051         thread.  This replaces the old ticker thread.
1052         (scd_get_socket_name): New.
1053         * command.c (cmd_getinfo): New command GETINFO.
1054         (scd_command_handler): Renamed argument and changed code to use an
1055         already connected FD.
1057 2005-05-15  Werner Koch  <wk@g10code.com>
1059         * app.c, app-common.h, app-nks.c, app-p15.c, app-dinsig.c
1060         * app-openpgp.c: Change most function return types from int to
1061         gpg_error_t.
1062         * command.c (pin_cb): Ditto.
1063         * sc-copykeys.c (pincb): Ditto.
1065         * app.c (lock_reader, unlock_reader): New.  Changed call handler
1066         wrappers to make use of these functions.
1068 2005-05-07  Werner Koch  <wk@g10code.com>
1070         * ccid-driver.c (do_close_reader): Don't do a reset before close.
1071         Some folks reported that it makes the SCR335 hang less often.
1072         Look at the source on how to re-enable it.
1074 2005-04-27  Werner Koch  <wk@g10code.com>
1076         * app-p15.c (micardo_mse): New.
1077         (do_sign): Call it.
1078         * iso7816.c (iso7816_manage_security_env): Allow passing DATA as
1079         NULL to indicate an empty Lc.
1080         * tlv.c (find_tlv): Check that a found object fits into the
1081         buffer.
1082         (find_tlv_unchecked): New as replacement for the old non-checking
1083         variant.
1084         * app.c (select_application): Keep on using the non-checking
1085         variant.
1086         * app-openpgp.c (get_one_do, dump_all_do): Ditto.
1088         
1089         Removal of the old OpenSC based code.
1090         
1091         * app-p15.c: New.  Basic support for pkcs15 cards without OpenSC.
1092         There are quite a couple of things missing but at least I can use
1093         my old TCOS cards from the Aegypten-1 development for signing.
1094         * app.c (select_application): Detect pkcs15 applications.
1095         * Makefile.am (scdaemon_SOURCES): Removed card.c, card-common.h
1096         and card-p15.c because they are now obsolete. Added app-p15.c.
1097         Removed all OpenSC stuff.
1098         * command.c (do_reset, open_card, cmd_serialno, cmd_learn) 
1099         (cmd_readcert, cmd_readkey, cmd_pksign, cmd_pkdecrypt): Removed
1100         all special cases for the old card.c based mechanisms.
1101         * scdaemon.c, apdu.c: Removed all special cases for OpenSC.
1103 2005-04-20  Werner Koch  <wk@g10code.com>
1105         * command.c: Use GPG_ERR_LOCKED instead of EBUSY.
1107 2005-04-14  Werner Koch  <wk@g10code.com>
1109         * app-openpgp.c (retrieve_key_material): Rewritten.  Return a
1110         proper error code.
1111         (retrieve_next_token): Removed.
1112         (retrieve_fpr_from_card): Rewritten to make use of DO caching and
1113         to take the KEYNO as arg.
1114         (get_public_key): Renamed variable for clarity.
1116 2005-04-12  Werner Koch  <wk@g10code.com>
1118         Basic support for several sessions.
1119         
1120         * command.c (scd_command_handler): Replace the primary_connection
1121         stuff by a real connection list.  Release the local context on
1122         exit.
1123         (scd_update_reader_status_file): Update accordingly.  Send signal
1124         to all connections who registered an event signal.
1125         (cmd_lock, cmd_unlock, register_commands): New commands LOCK and
1126         UNLOCK.
1127         (cmd_setdata, cmd_pksign, cmd_pkauth, cmd_pkdecrypt, cmd_setattr) 
1128         (cmd_genkey, cmd_passwd, cmd_checkpin): Return an error if reader
1129         is locked.
1130         (do_reset): Handle locking.
1131         (open_card): Ditto.  Share the reader slot with other sessions.
1132         (get_reader_slot): New.
1133         (update_card_removed): New.  Use it in the TEST_CARD_REMOVAL macro.
1135 2005-04-07  Werner Koch  <wk@g10code.com>
1137         * app-openpgp.c (do_check_pin): Add hack to allow verification of
1138         CHV3.
1139         (get_public_key): Don't use gcry functions to create S-expressions.
1140         (do_deinit, do_readkey, do_genkey, send_keypair_info): Adjust for
1141         above change.
1143 2005-03-29  Moritz Schulte  <moritz@g10code.com>
1145         * app-openpgp.c (retrieve_fpr_from_card): New function.
1146         (retrieve_next_token): New function.
1147         (retrieve_key_material): New function.
1148         (get_public_key): Implement retrival of key through expernal
1149         helper (gpg) in case the openpgp card is not cooperative enough.
1151 2005-03-16  Werner Koch  <wk@g10code.com>
1153         * ccid-driver.c (parse_ccid_descriptor): Make SCM workaround
1154         reader type specific.
1155         (scan_or_find_devices): Do not check the interface subclass in the
1156         SPR532 kludge, as this depends on the firmware version.
1157         (ccid_get_atr): Get the Slot status first.  This solves the
1158         problem with readers hanging on recent Linux 2.6.x.
1159         (bulk_in): Add argument TIMEOUT and changed all callers to pass an
1160         appropriate one.  Change the standard timeout from 10 to 5 seconds.
1161         (ccid_slot_status): Add a retry code with an initial short timeout.
1162         (do_close_reader): Do an usb_reset before closing the reader.
1164 2005-02-25  Werner Koch  <wk@g10code.com>
1166         * app-openpgp.c (get_public_key): Make sure not to return negative
1167         numbers.
1168         (do_sign): Allow passing of indata with algorithm prefix.
1169         (do_auth): Allow OPENPGP.3 as an alternative ID.
1171         * app.c (app_getattr): Return just the S/N but not the timestamp.
1173 2005-02-24  Werner Koch  <wk@g10code.com>
1175         * app.c (app_getattr): Return APPTYPE or SERIALNO type even if the
1176         application does dot support the getattr call.
1178         * app-openpgp.c (get_one_do): Never try to get a non cacheable
1179         object from the cache.
1180         (get_one_do): Add new arg to return an error code.  Changed all
1181         callers.
1182         (do_getattr): Let it return a proper error code.
1184         * app.c (select_application): Return an error code and the
1185         application context in an new arg.
1186         * command.c (open_card): Adjusted for that.  Don't use the
1187         fallback if no card is present.  Return an error if the card has
1188         been removed without a reset.
1189         (do_reset, cmd_serialno): Clear that error flag.
1190         (TEST_CARD_REMOVAL): New. Use it with all command handlers.
1191         (scd_update_reader_status_file): Set the error flag on all changes.
1193         * scdaemon.c (ticker_thread): Termintate if a shutdown is pending.
1195         * apdu.c: Added some PCSC error codes.
1196         (pcsc_error_to_sw): New.
1197         (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu) 
1198         (open_pcsc_reader): Do proper error code mapping.
1200 2005-03-16  Werner Koch  <wk@g10code.com>
1202         * ccid-driver.c (parse_ccid_descriptor): Make SCM workaround
1203         reader type specific.
1204         (scan_or_find_devices): Do not check the interface subclass in the
1205         SPR532 kludge, as this depends on the firmware version.
1206         (ccid_get_atr): Get the Slot status first.  This solves the
1207         problem with readers hanging on recent Linux 2.6.x.
1209 2005-02-22  Werner Koch  <wk@g10code.com>
1211         * app-openpgp.c (app_local_s): New field PK.
1212         (do_deinit, do_genkey, app_openpgp_storekey): Clear it.
1213         (get_public_key, send_keypair_info): New.
1214         (do_learn_status): Send KEYPAIR info
1216         * app-common.h (app_ctx_t): Add function pointer READKEY.
1217         * app.c (app_readkey): New.
1218         * command.c (cmd_readkey): Use READKEY function if possible.
1220 2005-01-26  Werner Koch  <wk@g10code.com>
1222         * ccid-driver.c (parse_ccid_descriptor): Need the CSM workaround
1223         also for newer firmware versions.  Need to get a list of fixed
1224         firmware versions and use that.
1226 2005-01-25  Werner Koch  <wk@g10code.com>
1228         * apdu.c (apdu_send_le, apdu_send_direct): Fix some compiler
1229         warnings.
1231         * app-openpgp.c (get_cached_data): New arg GET_IMMEDIATE to bypass
1232         the cache.  Changed all callers.
1233         (get_one_do): Bypass the cache if the value would have been read
1234         directly for v1.1 cards.It makes things a bit slower but obnly for
1235         1.0 cards and there are not that many cards out in the wild.  This
1236         is required to fix a caching bug when generating new keys; as a
1237         side effect of the retrieval of the the C4 DO from the 6E DO the
1238         cached fingerprint will get updated to the old value and later
1239         when signing the generated key the checking of the fingerprint
1240         fails because it won't match the new one.  Thanks to Moritz for
1241         analyzing this problem.
1242         (verify_chv3): Removed the CHV status reread logic because we
1243         won't cache the C4 DO anymore.
1245 2004-12-28  Werner Koch  <wk@g10code.com>
1247         * ccid-driver.c (find_endpoint): New.
1248         (scan_or_find_devices): Add new args to return endpoint info and
1249         interface number.
1250         (ccid_open_reader, ccid_shutdown_reader): Take care of these new
1251         args.
1252         (bulk_in, bulk_out): Use the correct endpoints.
1253         (ccid_transceive_apdu_level): New.
1254         (ccid_transceive): Divert to above.
1255         (parse_ccid_descriptor): Allow APDU level exchange mode.
1256         (do_close_reader): Pass the interface number to usb_release_interface.
1258 2004-12-21  Werner Koch  <wk@g10code.com>
1260         * scdaemon.c (main): Use default_homedir().
1262 2004-12-18  Werner Koch  <wk@g10code.com>
1264         * scdaemon.c (main) [W32]: Remove special Pth initialize..
1266         * scdaemon.h (map_assuan_err): Define in terms of
1267         map_assuan_err_with_source.
1269 2004-12-15  Werner Koch  <wk@g10code.com>
1271         * scdaemon.c [W32]: Various hacks to make it run under W32.
1273         * command.c (scd_update_reader_status_file) [W32]: Don't use kill.
1275         * apdu.c [W32]: Disable use of pcsc_wrapper.
1277         * Makefile.am (scdaemon_LDADD): Reorder libs.
1278         (sc_copykeys_LDADD): Add libassuan because it is needed for W32. 
1280 2004-12-06  Werner Koch  <wk@g10code.com>
1282         * Makefile.am (pkglib_PROGRAMS): Build only for W32.
1284 2004-10-22  Werner Koch  <wk@g10code.com>
1286         * app-openpgp.c (verify_chv3): The minium length for CHV3 is
1287         8. Changed string to match the other ones.
1289 2004-10-21  Werner Koch  <wk@g10code.com>
1291         * app-openpgp.c (do_sign): Replace asprintf by direct allocation.
1292         This avoids problems with missing vasprintf implementations in
1293         gnupg 1.4.
1295         * app-common.h (app_openpgp_storekey: Add prototype. 
1297 2004-10-20  Werner Koch  <wk@g10code.com>
1299         * sc-investigate: Removed.
1300         * Makefile.am (sc_investigate): Removed.
1301         
1302         * pcsc-wrapper.c (load_pcsc_driver): Load get_status_change func.
1303         (handle_open): Succeed even without a present card.
1304         (handle_status, handle_reset): New.
1305         
1306         * apdu.c (apdu_open_reader): Load pcsc_get_status_change fucntion.
1307         (pcsc_get_status): Implemented.
1308         (reset_pcsc_reader): Implemented.
1309         (open_pcsc_reader): Succeed even with no card inserted.
1310         (open_ccid_reader): Set LAST_STATUS.
1312         * iso7816.c (iso7816_select_application): Always use 0 for P1.
1314 2004-10-18  Werner Koch  <wk@g10code.com>
1316         * ccid-driver.c (ccid_get_atr): Reset T=1 state info.
1318 2004-10-14  Werner Koch  <wk@g10code.com>
1320         * app-openpgp.c (parse_login_data): New. 
1321         (app_select_openpgp): Call it.
1322         (do_setattr): Reparse it after change.
1324 2004-10-06  Werner Koch  <wk@g10code.de>
1326         * ccid-driver.c (ccid_open_reader): Store the vendor ID.
1327         (ccid_transceive_secure): New.
1328         (parse_ccid_descriptor): Workaround for an SCM reader problem.
1330 2004-10-04  Werner Koch  <wk@g10code.de>
1332         * ccid-driver.c (send_escape_cmd): New.
1334 2004-09-30  Werner Koch  <wk@g10code.com>
1336         * Makefile.am: Adjusted for gettext 0.14.
1338         * app-openpgp.c (do_sign): Add the error string to the verify
1339         failed messages.
1341 2004-09-27  Werner Koch  <wk@g10code.com>
1343         From gnupg 1.3
1345         * app-openpgp.c: Made all strings translatable.
1346         (verify_chv3) [GNUPG_MAJOR_VERSION]: Make opt.allow_admin
1347         available for use in gnupg 2. 
1348         (verify_chv3): Reimplemented countdown showing to use only
1349         functions from this module.  Flush the CVH status cache on a
1350         successful read.
1351         (get_one_do): Hack to bypass the cache for cards versions > 1.0.
1352         (store_fpr): Store the creation date for card version > 1.0.
1354         * app-openpgp.c (app_openpgp_storekey): Call flush_cache.
1355         (get_cached_data): Move local data initialization to ..
1356         (app_select_openpgp): .. here. Read some flags for later use.
1357         (do_getattr): New read-only attribute EXTCAP.
1358         
1359         * apdu.c (open_pcsc_reader): Do not print empty reader string.
1361         * ccid-driver.c (do_close_reader): Factored some code out from ...
1362         (ccid_close_reader): ..here.
1363         (ccid_shutdown_reader): New.
1365         * apdu.c (apdu_shutdown_reader): New.
1366         (shutdown_ccid_reader): New.
1368         * apdu.c (open_ccid_reader): New arg PORTSTR.  Pass it to
1369         ccid_open_reader.
1370         (apdu_open_reader): Pass portstr to open_ccid_reader.
1371         (apdu_open_reader): No fallback if a full CCID reader id has been
1372         given.
1374         * ccid-driver.c (ccid_get_reader_list): New.
1375         (ccid_open_reader): Changed API to take a string for the reader.
1376         Removed al the cruft for the libusb development vesion which seems
1377         not to be maintained anymore and there are no packages anyway.
1378         The stable library works just fine.
1379         (struct ccid_reader_id_s): Deleted and replaced everywhere by a
1380         simple string.
1381         (usb_get_string_simple): Removed.
1382         (bulk_in): Do valgrind hack here and not just everywhere.
1384         * ccid-driver.c (read_device_info): Removed.
1385         (make_reader_id, scan_or_find_devices): New.
1386         (ccid_open_reader): Simplified by make use of the new functions.
1387         (ccid_set_debug_level): New.  Changed the macros to make use of
1388         it.  It has turned out that it is often useful to enable debugging
1389         at runtime so I added this option.
1391         From gnupg 1.3 - David Shaw  <dshaw@jabberwocky.com>
1393         * app-openpgp.c (verify_chv3): Show a countdown of how many wrong
1394         admin PINs can be entered before the card is locked.
1396         * app-openpgp.c (get_cached_data): Avoid mallocing zero since it
1397         breaks us when using --enable-m-guard.
1399         * ccid-driver.c (usb_get_string_simple): Replacement function to
1400         work with older libusb.
1402         * ccid-driver.c (read_device_info): Fix segfault when usb device
1403         is not accessible.
1404         (ccid_open_reader): Allow working with an even older version of
1405         libusb (usb_busses global instead of usb_get_busses()).
1407 2004-09-11  Werner Koch  <wk@g10code.com>
1409         * app-openpgp.c (app_select_openpgp): Its app_munge_serialno and
1410         not app_number_serialno.
1412 2004-08-20  Werner Koch  <wk@g10code.de>
1414         * app.c (select_application): Fixed serial number extraction and
1415         added the BMI card workaround.
1416         (app_munge_serialno): New.
1417         * app-openpgp.c (app_select_openpgp): Try munging serialno.
1419 2004-08-05  Werner Koch  <wk@g10code.de>
1421         * scdaemon.c (main): New option --disable-application.
1422         * app.c (is_app_allowed): New.
1423         (select_application): Use it to check for disabled applications.
1425         * ccid-driver.h (CCID_DRIVER_ERR_ABORTED): New.
1426         * ccid-driver.c (ccid_open_reader): Support the stable 0.1 version
1427         of libusb.
1428         (ccid_get_atr): Handle short messages.
1430         * apdu.c (my_rapdu_get_status): Implemented.
1432 2004-07-27  Moritz Schulte  <moritz@g10code.com>
1434         * apdu.c: Include <signal.h>.
1436         * Makefile.am: Use @DL_LIBS@ instead of -ldl.
1438 2004-07-22  Werner Koch  <wk@g10code.de>
1440         * Makefile.am: Make OpenSC lib link after libgcrypt. Do not link
1441         to pth.
1442         * apdu.c: Don't use Pth if we use OpenSC.
1443         * sc-investigate.c, scdaemon.c: Disable use of pth if OpenSC is used. 
1445         * scdaemon.c (main): Bumbed thread stack size up to 512k.
1447 2004-07-16  Werner Koch  <wk@gnupg.org>
1449         * apdu.c (reader_table_s):  Add function pointers for the backends.
1450         (apdu_close_reader, apdu_get_status, apdu_activate) 
1451         (send_apdu): Make use of them.
1452         (new_reader_slot): Intialize them to NULL.
1453         (dump_ccid_reader_status, ct_dump_reader_status): New.
1454         (dump_pcsc_reader_status): New.
1455         (open_ct_reader, open_pcsc_reader, open_ccid_reader) 
1456         (open_osc_reader, open_rapdu_reader): Intialize function pointers.
1457         (ct_activate_card, ct_send_apdu, pcsc_send_apdu, osc_send_apdu) 
1458         (error_string): Removed.  Replaced by apdu_strerror.
1459         (get_ccid_error_string): Removed.
1460         (ct_activate_card): Remove the unused loop.
1461         (reset_ct_reader): Implemented.
1462         (ct_send_apdu): Activate the card if not yet done.
1463         (pcsc_send_apdu): Ditto.
1465 2004-07-15  Werner Koch  <wk@gnupg.org>
1467         * ccid-driver.h: Add error codes.
1468         * ccid-driver.c: Implement more or less proper error codes all
1469         over the place.
1471         * apdu.c (apdu_send_direct): New.
1472         (get_ccid_error_string): Add some error code mappings.
1473         (send_apdu): Pass error codes along for drivers already supporting
1474         them.
1475         (host_sw_string): New.
1476         (get_ccid_error_string): Use above.
1477         (send_apdu_ccid): Reset the reader if it has not yet been done.
1478         (open_ccid_reader): Don't care if the ATR can't be read.
1479         (apdu_activate_card): New.
1480         (apdu_strerror): New.
1481         (dump_reader_status): Only enable it with opt.VERBOSE.
1482         * iso7816.c (map_sw): Add mappings for the new error codes.
1484 2004-07-02  Werner Koch  <wk@gnupg.org>
1486         * apdu.c (open_ct_reader, open_pcsc_reader, open_ccid_reader)
1487         (reset_ccid_reader, open_osc_reader): Call dump_reader_status only
1488         in verbose mode.
1490 2004-07-01  Werner Koch  <wk@gnupg.org>
1492         * sc-investigate.c: Initialize Pth which is now required.
1493         (interactive_shell): New command "readpk".
1495         * app-openpgp.c (do_getattr): Fix for sending CA-FPR.
1497 2004-06-30  Werner Koch  <wk@gnupg.org>
1499         * app-openpgp.c (app_openpgp_readkey): Fixed check for valid
1500         exponent.
1502 2004-06-18  Werner Koch  <wk@g10code.com>
1504         * sc-investigate.c (my_read_line): Renamed from read_line.
1506 2004-06-16  Werner Koch  <wk@gnupg.org>
1508         * apdu.c (osc_get_status): Fixed type in function name. Noted by
1509         Axel Thimm.  Yes, I didn't tested it with OpenSC :-(.
1511 2004-04-28  Werner Koch  <wk@gnupg.org>
1513         * app-openpgp.c (do_setattr): Sync FORCE_CHV1.
1515 2004-04-27  Werner Koch  <wk@gnupg.org>
1517         * app-common.h: Do not include ksba.h for gnupg 1.
1519 2004-04-26  Werner Koch  <wk@gnupg.org>
1521         * app-common.h: New members FNC.DEINIT and APP_LOCAL.
1522         * app.c (release_application): Call new deconstructor.
1523         * app-openpgp.c (do_deinit): New.
1524         (get_cached_data, flush_cache_item, flush_cache_after_error)
1525         (flush_cache): New.
1526         (get_one_do): Replaced arg SLOT by APP.  Make used of cached data.
1527         (verify_chv2, verify_chv3): Flush some cache item after error.
1528         (do_change_pin): Ditto.
1529         (do_sign): Ditto.
1530         (do_setattr): Flush cache item.
1531         (do_genkey): Flush the entire cache.
1532         (compare_fingerprint): Use cached data.
1534         * scdaemon.c (main): Do the last change the usual way. This is so
1535         that we can easily test for versioned config files above.
1537 2004-04-26  Marcus Brinkmann  <marcus@g10code.de>
1539         * scdaemon.c (main): For now, always print default filename for
1540         --gpgconf-list, and never /dev/null.
1542 2004-04-21  Werner Koch  <wk@gnupg.org>
1544         * command.c (scd_update_reader_status_file): Send a signal back to
1545         the client.
1546         (option_handler): Parse the new event-signal option.
1548         * scdaemon.c (handle_signal): Do not use SIGUSR{1,2} anymore for
1549         changing the verbosity.
1551 2004-04-20  Werner Koch  <wk@gnupg.org>
1553         * command.c (scd_update_reader_status_file): Write status files.
1555         * app-help.c (app_help_read_length_of_cert): Fixed calculation of
1556         R_CERTOFF.
1558         * pcsc-wrapper.c: New.
1559         * Makefile.am (pkglib_PROGRAMS): Install it here.
1560         * apdu.c (writen, readn): New.
1561         (open_pcsc_reader, pcsc_send_apdu, close_pcsc_reader): Use the
1562         pcsc-wrapper if we are using Pth.
1563         (apdu_send_le): Reinitialize RESULTLEN.  Handle SW_EOF_REACHED
1564         like SW_SUCCESS.
1566 2004-04-19  Werner Koch  <wk@gnupg.org>
1568         * ccid-driver.c (parse_ccid_descriptor): Store some of the reader
1569         features away.  New arg HANDLE
1570         (read_device_info): New arg HANDLE. Changed caller.
1571         (bulk_in): Handle time extension requests.
1572         (ccid_get_atr): Setup parameters and the IFSD.
1573         (compute_edc): New. Factored out code.
1574         (ccid_transceive): Use default NADs when required.
1576 2004-04-14  Werner Koch  <wk@gnupg.org>
1578         * scdaemon.h (server_control_s): Add member READER_SLOT.
1579         * scdaemon.c (scd_init_default_ctrl): Initialize READER_SLOT to -1.
1580         * command.c (open_card): Reuse an open slot.
1581         (reset_notify): Just reset the slot if supported by the reader.
1582         (do_reset): Factored code from above out.
1583         (scd_command_handler): Use it for cleanup.
1585         * apdu.h: New pseudo stati SW_HOST_NOT_SUPPORTED,
1586         SW_HOST_LOCKING_FAILED and SW_HOST_BUSY.
1587         * iso7816.c (map_sw): Map it.
1588         
1589         * ccid-driver.c (ccid_slot_status): Add arg STATUSBITS.
1590         * apdu.c (apdu_get_status): New.
1591         (ct_get_status, pcsc_get_status, ocsc_get_status): New stubs.
1592         (get_status_ccid): New.
1593         (apdu_reset): New.
1594         (reset_ct_reader, reset_pcsc_reader, reset_osc_reader): New stubs.
1595         (reset_ccid_reader): New.
1596         (apdu_enum_reader): New.
1597         
1598         * apdu.c (lock_slot, trylock_slot, unlock_slot): New helpers.
1599         (new_reader_slot) [USE_GNU_PTH]: Init mutex.
1600         (apdu_reset, apdu_get_status, apdu_send_le): Run functions
1601         in locked mode.
1603         * command.c (scd_update_reader_status_file): New.
1604         * scdaemon.c (handle_tick): Call it.
1606 2004-04-13  Werner Koch  <wk@gnupg.org>
1608         * scdaemon.c: Convert to a Pth application.
1609         (handle_signal, ticker_thread, handle_tick): New.
1610         (main): Fire up the ticker thread in server mode.
1612 2004-03-23  Werner Koch  <wk@gnupg.org>
1614         * scdaemon.c (main) <gpgconf_list>: Fixed output for pcsc_driver.
1616 2004-03-17  Werner Koch  <wk@gnupg.org>
1618         * tlv.c (parse_ber_header): Do not check for tag overflow - it
1619         does not make sense.  Simplified the check for length overflow.
1621         * scdaemon.c (main) <gpgconf>: Fixed default value quoting.
1623 2004-03-16  Werner Koch  <wk@gnupg.org>
1625         * app-dinsig.c: Implemented. Based on app-nks.c and card-dinsig.c
1626         * app-nks.c (get_length_of_cert): Removed.
1627         * app-help.c: New.
1628         (app_help_read_length_of_cert): New.  Code taken from above.  New
1629         optional arg R_CERTOFF.
1631         * card-dinsig.c: Removed.
1632         * card.c (card_get_serial_and_stamp): Do not bind to the old and
1633         never finsiged card-dinsig.c.
1635         * iso7816.c (iso7816_read_binary): Allow for an NMAX > 254.
1637 2004-03-11  Werner Koch  <wk@gnupg.org>
1639         * scdaemon.h (out_of_core): Removed.  Replaced callers by standard
1640         gpg_error function.
1642         * apdu.c, iso7816.c, ccid-driver.c [GNUPG_SCD_MAIN_HEADER]: Allow
1643         to include a header defined by the compiler.  This helps us to
1644         reuse the source in other software.
1646 2004-03-10  Werner Koch  <wk@gnupg.org>
1648         * iso7816.c (iso7816_read_record): New arg SHORT_EF.  Changed all
1649         callers.
1651 2004-02-18  Werner Koch  <wk@gnupg.org>
1653         * sc-investigate.c (main): Setup the used character set.
1654         * scdaemon.c (main): Ditto.
1656         * scdaemon.c (set_debug): New.  Add option --debug-level.
1657         (main): Add option --gpgconf-list.
1659 2004-02-12  Werner Koch  <wk@gnupg.org>
1661         * Makefile.am: Include cmacros.am for common flags.
1663 2004-01-29  Werner Koch  <wk@gnupg.org>
1665         * command.c (reset_notify): Release the application context and
1666         close the reader.
1668 2004-01-28  Werner Koch  <wk@gnupg.org>
1670         * iso7816.c (iso7816_manage_security_env): New.
1671         (iso7816_decipher): Add PADIND argument.
1673 2004-01-27  Werner Koch  <wk@gnupg.org>
1675         * command.c (cmd_readcert, cmd_readkey): Work on a copy of LINE.
1677         * app-common.h (app_ctx_s): Added readcert field.
1678         * app.c (app_readcert): New.
1679         * tlv.c (parse_ber_header): Added; taken from libksba.
1681 2004-01-26  Werner Koch  <wk@gnupg.org>
1683         * card.c (map_sc_err): Use SCD as the error source.
1685         * command.c (open_card): ADD arg NAME to allow requesting a
1686         specific application.  Changed all callers.
1687         (cmd_serialno): Allow optional argument to select the desired
1688         application.
1690         * app-nks.c: New. 
1692         * scdaemon.h (opt): Add READER_PORT.
1693         * scdaemon.c (main): Set it here.
1694         * app.c (app_set_default_reader_port): Removed.
1695         (select_application): Add NAME arg and figure out a
1696         default serial number from the GDO. Add SLOT arg and remove all
1697         reader management.
1698         (release_application): New.
1699         (app_write_learn_status): Output an APPTYPE status line.
1700         * command.c (open_card): Adapt for select_application change.
1701         * app-openpgp.c (app_select_openpgp): Removed SN and SNLEN args
1702         and set it directly.  Changed all callers.
1704 2004-01-25  Werner Koch  <wk@gnupg.org>
1706         * iso7816.c (iso7816_select_application): P1 kludge for OpenPGP
1707         card.
1708         * app-openpgp.c (find_tlv): Factor out this function to ..
1709         * tlv.c, tlv.h: .. new.
1711         * scdaemon.h: Introduced app_t and ctrl_t as the new types for APP
1712         and CTRL.
1714 2004-01-21  Werner Koch  <wk@gnupg.org>
1716         * apdu.c (apdu_send_le): Treat SW_EOF_REACHED as a warning.
1718 2004-01-20  Werner Koch  <wk@gnupg.org>
1720         * iso7816.c (iso7816_read_binary): New.
1721         (iso7816_select_file): New.
1722         (iso7816_list_directory): New.
1724         * sc-investigate.c: Add option -i.
1725         (select_app, read_line, interactive_shell): New.
1727 2004-01-16  Werner Koch  <wk@gnupg.org>
1729         * apdu.h: Add SW_FILE_NOT_FOUND.
1730         * iso7816.c (map_sw): Map it to GPG_ERR_ENOENT.
1731         * iso7816.c (iso7816_select_file): New.
1733         * app-dinsig.c: New file w/o any real code yet.
1734         * Makefile.am (scdaemon_SOURCES,sc_investigate_SOURCES): Add file.
1736         * sc-investigate.c: Add option --disable-ccid.
1738 2003-12-19  Werner Koch  <wk@gnupg.org>
1740         * apdu.c (apdu_send_le): Send a get_response with the indicated
1741         length and not the 64 bytes we used for testing.
1743         * app-openpgp.c (verify_chv2, verify_chv3, do_sign): Check the
1744         minimum length of the passphrase, so that we don't need to
1745         decrement the retry counter.
1747 2003-12-17  Werner Koch  <wk@gnupg.org>
1749         * card-p15.c (p15_enum_keypairs): Replaced KRC by RC.
1750         * card-dinsig.c (dinsig_enum_keypairs): Ditto.
1752 2003-12-16  Werner Koch  <wk@gnupg.org>
1754         * scdaemon.c (main): Set the prefixes for assuan logging.
1756 2003-11-17  Werner Koch  <wk@gnupg.org>
1758         * scdaemon.c, scdaemon.h: New options --allow-admin and --deny-admin.
1759         * app-openpgp.c (verify_chv3): Check it here.
1761 2003-11-12  Werner Koch  <wk@gnupg.org>
1763         Adjusted for API changes in Libksba.
1765 2003-10-30  Werner Koch  <wk@gnupg.org>
1767         * apdu.c (close_ct_reader, close_pcsc_reader): Implemented.
1768         (get_ccid_error_string): New.  Not very useful messages, though.
1770 2003-10-25  Werner Koch  <wk@gnupg.org>
1772         * ccid-driver.c (ccid_open_reader): Return an error if no USB
1773         devices are found.
1775         * command.c (cmd_genkey, cmd_passwd): Fixed faulty use of
1776         !spacep().
1778         * apdu.c (apdu_open_reader): Hacks for PC/SC under Windows.
1780 2003-10-20  Werner Koch  <wk@gnupg.org>
1782         * command.c (cmd_checkpin): New.
1783         (register_commands): Add command CHECKPIN.
1784         * app.c (app_check_pin): New.
1785         * app-openpgp.c (check_against_given_fingerprint): New. Factored
1786         out that code elsewhere.
1787         (do_check_pin): New.
1789 2003-10-10  Werner Koch  <wk@gnupg.org>
1791         * ccid-driver.c (ccid_close_reader): New.
1793         * apdu.c (close_ccid_reader, close_ct_reader, close_csc_reader)
1794         (close_osc_reader, apdu_close_reader): New.  Not all are properly
1795         implemented yet.
1797 2003-10-09  Werner Koch  <wk@gnupg.org>
1799         * ccid-driver.c (ccid_transceive): Add T=1 chaining for sending.
1801 2003-10-08  Werner Koch  <wk@gnupg.org>
1803         * app-openpgp.c (do_getattr): Support SERIALNO and AID.
1805 2003-10-01  Werner Koch  <wk@gnupg.org>
1807         * ccid-driver.c: Detect GnuPG 1.3 and include appropriate files.
1808         * apdu.c: Ditto.
1809         * app-openpgp.c: Ditto.
1810         * iso7816.c: Ditto.
1811         (generate_keypair): Renamed to ..
1812         (do_generate_keypair): .. this.
1813         * app-common.h [GNUPG_MAJOR_VERSION]: New.
1814         * iso7816.h [GNUPG_MAJOR_VERSION]: Include cardglue.h
1816 2003-09-30  Werner Koch  <wk@gnupg.org>
1818         * command.c (cmd_getattr): New command GETATTR.
1819         * app.c (app_setattr): New.
1820         (do_getattr): New.
1821         (do_learn_status): Reimplemented in terms of do_getattr.
1823         * app-openpgp.c (do_change_pin): Make sure CVH1 and CHV2 are
1824         always synced.
1825         (verify_chv2, verify_chv3): New. Factored out common code.
1826         (do_setattr, do_sign, do_auth, do_decipher): Change the names of
1827         the prompts to match that we have only 2 different PINs.
1828         (app_select_openpgp): Check whether the card enforced CHV1.
1829         (convert_sig_counter_value): New. Factor out code from
1830         get_sig_counter.
1832 2003-09-28  Werner Koch  <wk@gnupg.org>
1834         * app-openpgp.c (dump_all_do): Use gpg_err_code and not gpg_error.
1836 2003-09-19  Werner Koch  <wk@gnupg.org>
1838         * ccid-driver.c (parse_ccid_descriptor): New.
1839         (read_device_info): New.
1840         (ccid_open_reader): Check that the device has all required features.
1842 2003-09-06  Werner Koch  <wk@gnupg.org>
1844         * scdaemon.c (main): --pcsc-driver again defaults to pcsclite.
1845         David Corcoran was so kind to remove the GPL incompatible
1846         advertisng clause from pcsclite.
1847         * apdu.c (apdu_open_reader): Actually make pcsc-driver option work.
1849 2003-09-05  Werner Koch  <wk@gnupg.org>
1851         * ccid-driver.c: More work, data can now actually be retrieved.
1852         * ccid-driver.c, ccid-driver.h: Alternativley allow use under BSD
1853         conditions.
1855 2003-09-02  Werner Koch  <wk@gnupg.org>
1857         * scdaemon.c, scdaemon.h: New option --pcsc-ccid.
1858         * ccid-driver.c, ccid-driver.h: New but far from being useful.
1859         * Makefile.am: Add above.
1860         * apdu.c: Add support for that ccid driver.
1861         
1862 2003-08-26  Timo Schulz  <twoaday@freakmail.de>
1864         * apdu.c (new_reader_slot): Only set 'is_osc' when OpenSC
1865         is used.
1866         
1867 2003-08-25  Werner Koch  <wk@gnupg.org>
1869         * command.c (cmd_setattr): Use a copy of LINE.
1870         (cmd_genkey): Use a copy of KEYNO.
1871         (cmd_passwd): Use a copy of CHVNOSTR.
1872         (cmd_pksign, cmd_pkauth, cmd_pkdecrypt): s/strdup/xtrystrdup/.
1874 2003-08-19  Werner Koch  <wk@gnupg.org>
1876         * scdaemon.c, scdaemon.h: New option --pcsc-driver.
1877         * apdu.c (apdu_open_reader): Use that option here instead of a
1878         hardcoded one.
1880 2003-08-18  Werner Koch  <wk@gnupg.org>
1882         * Makefile.am: Add OPENSC_LIBS to all programs. 
1884         * scdaemon.c, scdaemon.h: New option --disable-opensc.
1885         * card.c (card_open): Implement it.
1886         * apdu.c (open_osc_reader, osc_send_apdu): New.
1887         (apdu_open_reader) [HAVE_OPENSC]: Use the opensc driver if not
1888         disabled.
1889         (error_string) [HAVE_OPENSC]: Use sc_strerror.
1890         (send_apdu) [HAVE_OPENSC]: Call osc_apdu_send.
1892         * card-p15.c (p15_enum_keypairs, p15_prepare_key): Adjusted for
1893         libgpg-error.
1895 2003-08-14  Timo Schulz  <twoaday@freakmail.de>
1897         * apdu.c (ct_activate_card): Change the code a little to avoid
1898         problems with other readers.
1899         * Always use 'dynload.h' instead of 'dlfcn.h'.
1901 2003-08-05  Werner Koch  <wk@gnupg.org>
1903         * app-openpgp.c (dump_all_do): Don't analyze constructed DOs after
1904         an error.
1906 2003-08-04  Werner Koch  <wk@gnupg.org>
1908         * app.c (app_set_default_reader_port): New.
1909         (select_application): Use it here.
1910         * scdaemon.c (main): and here.
1911         * sc-copykeys.c: --reader-port does now take a string.
1912         * sc-investigate.c, scdaemon.c: Ditto.
1913         * apdu.c (apdu_open_reader): Ditto.  Load pcsclite if no ctapi
1914         driver is configured.  Always include code for ctapi.
1915         (new_reader_slot): Don't test for already used ports and remove
1916         port arg.
1917         (open_pcsc_reader, pcsc_send_apdu, pcsc_error_string): New.
1918         (apdu_send_le): Changed RC to long to cope with PC/SC.
1920         * scdaemon.c, scdaemon.h: New option --ctapi-driver.
1921         * sc-investigate.c, sc-copykeys.c: Ditto.
1922         
1923 2003-07-31  Werner Koch  <wk@gnupg.org>
1925         * Makefile.am (scdaemon_LDADD): Added INTLLIBS.
1927 2003-07-28  Werner Koch  <wk@gnupg.org>
1929         * app-openpgp.c (do_setattr): Change implementation.  Allow all
1930         useful DOs.
1932 2003-07-27  Werner Koch  <wk@gnupg.org>
1934         Adjusted for gcry_mpi_print and gcry_mpi_scan API change.
1936 2003-07-24  Werner Koch  <wk@gnupg.org>
1938         * app-openpgp.c (do_learn_status): Print more status information.
1939         (app_select_openpgp): Store the card version.
1940         (store_fpr): Add argument card_version and fix DOs for old cards.
1941         (app_openpgp_storekey): Likewise.
1943 2003-07-23  Werner Koch  <wk@gnupg.org>
1945         * command.c (cmd_pkauth): New.
1946         (cmd_setdata): Check whether data was given at all to avoid
1947         passing 0 to malloc.
1949         * app.c (app_auth): New.
1950         * app-openpgp.c (do_auth): New.
1952 2003-07-22  Werner Koch  <wk@gnupg.org>
1954         * command.c (cmd_passwd): New.
1955         * app.c (app_change_pin): New.
1956         * app-openpgp.c (do_change_pin): New.
1957         * iso7816.c (iso7816_reset_retry_counter): Implemented.
1959         * sc-investigate.c (main): New option --gen-random.
1960         * iso7816.c (iso7816_get_challenge): Don't create APDUs with a
1961         length larger than 255.
1963 2003-07-17  Werner Koch  <wk@gnupg.org>
1965         * command.c (cmd_random): New command RANDOM.
1967         * iso7816.c (map_sw): New. Use it in this file to return
1968         meaningful error messages.  Changed all public fucntions to return
1969         a gpg_error_t.
1970         (iso7816_change_reference_data): New.
1971         * apdu.c (apdu_open_reader): Use faked status words for soem
1972         system errors.
1974 2003-07-16  Werner Koch  <wk@gnupg.org>
1976         * apdu.c (apdu_send_simple): Use apdu_send_le so that we can
1977         specify not to send Le as it should be.
1979 2003-07-15  Werner Koch  <wk@gnupg.org>
1981         * Makefile.am: Add sc-copykeys program.
1982         * sc-copykeys.c: New.
1983         * app-openpgp.c (app_openpgp_storekey): New.
1984         (app_openpgp_cardinfo): New.
1985         (count_bits): New.
1986         (store_fpr): And use it here to get the actual length in bit.
1988 2003-07-03  Werner Koch  <wk@gnupg.org>
1990         * app-openpgp.c (do_setattr): Add setting of the URL.
1991         (app_select_openpgp): Dump card data only in very verbose mode.
1992         (do_decipher): New.
1994 2003-07-02  Werner Koch  <wk@gnupg.org>
1996         * app-openpgp.c (get_sig_counter): New.
1997         (do_sign): Print the signature counter and enable the PIN callback.
1998         (do_genkey): Implement the PIN callback. 
2000 2003-07-01  Werner Koch  <wk@gnupg.org>
2002         * app-openpgp.c (store_fpr): Fixed fingerprint calculation.
2004 2003-06-26  Werner Koch  <wk@gnupg.org>
2006         * app-openpgp.c (find_tlv): Fixed length header parsing.
2008         * app.c (app_genkey): New.
2009         * command.c (cmd_genkey): New.
2011 2003-06-25  Werner Koch  <wk@gnupg.org>
2013         * command.c (percent_plus_unescape): New.
2014         (cmd_setattr): New.
2016 2003-06-24  Werner Koch  <wk@gnupg.org>
2018         * command.c (send_status_info): New.
2020         * app-openpgp.c (app_select_openpgp): Replace SLOT arg by APP arg
2021         and setup the function pointers in APP on success. Changed callers.
2022         * app.c: New.
2023         * app-common.h: New.
2024         * scdaemon.h (APP): New type to handle applications.
2025         (server_control_s): Add an APP context field.
2027         * command.c (cmd_serialno): Handle applications.
2028         (cmd_pksign): Ditto.
2029         (cmd_pkdecrypt): Ditto.
2030         (reset_notify): Ditto.
2031         (cmd_learn): For now return error for application contexts.
2032         (cmd_readcert): Ditto.
2033         (cmd_readkey): Ditto.
2035 2003-06-04  Werner Koch  <wk@gnupg.org>
2037         * card.c (map_sc_err): Renamed gpg_make_err to gpg_err_make.
2039         Renamed error codes from INVALID to INV and removed _ERROR suffixes.
2041 2003-06-03  Werner Koch  <wk@gnupg.org>
2043         Changed all error codes in all files to the new libgpg-error scheme.
2045         * scdaemon.h: Include gpg-error.h and errno.h
2046         * card.c (map_sc_err): Use unknown for the error source.
2047         * Makefile.am: Link with libgpg-error
2049 2003-05-14  Werner Koch  <wk@gnupg.org>
2051         * atr.c, atr.h: New.
2052         * sc-investigate.c: Dump the ATR in a human readable format.
2054 2003-05-08  Werner Koch  <wk@gnupg.org>
2056         * scdaemon.h (DBG_CARD_IO_VALUE): New.
2058         * sc-investigate.c: New.
2059         * scdaemon.c (main): Removed --print-atr option.
2061         * iso7816.c, iso7816.h, app-openpgp.c: New.
2063 2003-04-29  Werner Koch  <wk@gnupg.org>
2065         * scdaemon.c: New options --print-atr and --reader-port
2066         * apdu.c, apdu.h: New
2068         * card.c, card-p15.c, card-dinsig.c: Allow build without OpenSC.
2069         
2070         * Makefile.am (LDFLAGS): Removed.
2072         * command.c (register_commands): Adjusted for new Assuan semantics.
2074 2002-08-21  Werner Koch  <wk@gnupg.org>
2076         * scdaemon.c (main): New option --daemon so that the program is
2077         not accidently started in the background.
2079 2002-08-16  Werner Koch  <wk@gnupg.org>
2081         * scdaemon.c: Include i18n.h.
2083         * card-common.h (struct p15_private_s): Forward declaration.  Add
2084         it to card_ctx_s.
2085         * card.c (card_close): Make sure private data is released.
2086         (card_enum_certs): New.
2087         * card-p15.c (p15_release_private_data): New.
2088         (init_private_data): New to work around an OpenSC weirdness.
2089         (p15_enum_keypairs): Do an OpenSC get_objects only once.
2090         (p15_enum_certs): New.
2091         (card_p15_bind): Bind new function.
2092         * command.c (cmd_learn): Return information about the certificates.
2094 2002-08-09  Werner Koch  <wk@gnupg.org>
2096         * card.c (card_get_serial_and_stamp): Use the tokeinfo serial
2097         number as a fallback. Add a special prefix for serial numbers.
2099 2002-07-30  Werner Koch  <wk@gnupg.org>
2101         Changes to cope with OpenSC 0.7.0:
2102         
2103         * card.c: Removed the check for the packed opensc version.
2104         Changed include file names of opensc.
2105         (map_sc_err): Adjusted error codes for new opensc version.
2106         * card-p15.c: Changed include filename of opensc.
2107         * card-dinsig.c: Ditto.
2109         * card-p15.c (p15_decipher): Add flags argument to OpenSC call.
2110         
2111 2002-07-24  Werner Koch  <wk@gnupg.org>
2113         * card.c (find_simple_tlv, find_iccsn): New.
2114         (card_get_serial_and_stamp): Improved serial number parser.
2116 2002-06-27  Werner Koch  <wk@gnupg.org>
2118         * scdaemon.c (main): Use GNUPG_DEFAULT_HOMEDIR constant.
2120 2002-06-15  Werner Koch  <wk@gnupg.org>
2122         * card-dinsig.c: Documented some stuff from the DIN norm.
2124 2002-04-15  Werner Koch  <wk@gnupg.org>
2126         * command.c (cmd_pksign, cmd_pkdecrypt): Use a copy of the key ID.
2128 2002-04-12  Werner Koch  <wk@gnupg.org>
2130         * scdaemon.c: New option --debug-sc N.
2131         * card.c (card_open): set it here.
2133         * card-p15.c (p15_prepare_key): Factored out common code from ...
2134         (p15_sign, p15_decipher): here and made the decryption work the
2135         regular way.
2137 2002-04-10  Werner Koch  <wk@gnupg.org>
2139         * card.c (card_open): Return immediately when no reader is available.
2141 2002-03-27  Werner Koch  <wk@gnupg.org>
2143         * card.c (card_open, card_close): Adjusted for changes in OpenSC.
2145 2002-03-10  Werner Koch  <wk@gnupg.org>
2147         * card-p15.c, card-dinsig.c, card-common.h: New.
2148         * card.c: Factored most code out to the new modules, so that we
2149         can better support different types of card applications.
2151 2002-01-26  Werner Koch  <wk@gnupg.org>
2153         * scdaemon.c scdaemon.h, command.c: New. Based on the code from
2154         the gpg-agent.
2156         
2157  Copyright 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
2159  This file is free software; as a special exception the author gives
2160  unlimited permission to copy and/or distribute it, with or without
2161  modifications, as long as this notice is preserved.
2163  This file is distributed in the hope that it will be useful, but
2164  WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
2165  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.