g10/
[gnupg.git] / scd / ChangeLog
blob60c139c401b5b2557a22c4580dc00acce432c80c
1 2008-06-24  Werner Koch  <wk@g10code.com>
3         * app-common.h (app_ctx_s): Renamed reset_mode parameter of
4         change_pin to mode_Flags and make it an unsigned int.
5         (APP_CHANGE_FLAG_RESET, APP_CHANGE_FLAG_NULLPIN): New.
6         * app-openpgp.c (do_change_pin): Adjust for that.
8         * command.c (cmd_passwd): Add option --nullpin.
9         * app-nks.c (do_check_pin, do_change_pin): New.
10         (app_select_nks): Register new functions.
12 2008-04-21  Moritz Schulte  <mo@g10code.com>  (wk)
14         * app-openpgp.c (verify_a_chv): Make use of the default CHV flag.
16 2008-03-26  Werner Koch  <wk@g10code.com>
18         * app-openpgp.c (verify_chv3): Support the keypad.
20 2008-02-09  Marcus Brinkmann  <marcus@g10code.de>
22         * scdaemon.c (main): Use CONFIG_FILENAME as filename if it is set
23         in gpgconf-list output.
25 2007-12-10  Werner Koch  <wk@g10code.com>
27         * app-openpgp.c (do_decipher): Take care of cryptograms shorter
28         that 128 bytes.  Fixes bug#851.
30 2007-11-14  Werner Koch  <wk@g10code.com>
32         * scdaemon.c (main): Pass STANDARD_SOCKET flag to
33         create_server_socket.
34         
35 2007-11-13  Werner Koch  <wk@g10code.com>
37         * scdaemon.c (start_connection_thread): Do not call
38         assuan_sock_check_nonce if we are running in --server mode.
40 2007-11-07  Werner Koch  <wk@g10code.com>
42         * scdaemon.h: Remove errors.h.
44 2007-10-02  Werner Koch  <wk@g10code.com>
46         * command.c (cmd_getinfo): Add "pid" subcommand.
48 2007-10-01  Werner Koch  <wk@g10code.com>
50         * scdaemon.c (create_server_socket): Use Assuan socket wrappers
51         and remove Windows specific code.
52         (socket_nonce): New.
53         (start_connection_thread): Check nonce.
55 2007-09-14  Marcus Brinkmann  <marcus@g10code.de>
57         * scdaemon.c (main): New variable STANDARD_SOCKET, which is 1 for
58         W32 targets.  Use it for create_socket_name.
60 2007-08-07  Werner Koch  <wk@g10code.com>
62         * tlv.c, tlv.h:  Move to ../common/.
64 2007-08-02  Werner Koch  <wk@g10code.com>
66         * scdaemon.c: Include gc-opt-flags.h and remove their definition
67         here.
69 2007-08-01  Werner Koch  <wk@g10code.com>
71         * apdu.c (send_le): Implement exact length hack.  Suggested by
72         Sten Lindgren.
74 2007-07-05  Werner Koch  <wk@g10code.com>
76         * command.c (has_option_name, skip_options): New.
77         (cmd_genkey): Add option --timestamp.
78         (cmd_writekey): Enter confidential mode while inquiring the key data.
80         * app.c (app_genkey): Add arg CREATETIME.
81         * app-common.h (app_ctx_s): Likewise
82         * app-openpgp.c (do_genkey): Ditto.  Use it.
85 2007-07-04  Werner Koch  <wk@g10code.com>
87         * command.c (cmd_getinfo): New subcommand "version".
89         * scdaemon.c (TIMERTICK_INTERVAL): New.
90         (handle_connections) [W32]: Enable a dummy sigs event.
91         (handle_connections): Use a proper count for select and not
92         FD_SETSIZE.
93         (fixed_gcry_pth_init, main): Kludge to fix pth initialization.
95 2007-06-21  Werner Koch  <wk@g10code.com>
97         * scdaemon.h (ctrl_t): Remove.  It is now declared in ../common/util.h.
99 2007-06-18  Marcus Brinkmann  <marcus@g10code.de>
101         * scdaemon.c (main): Percent escape output of --gpgconf-list.
103 2007-06-12  Werner Koch  <wk@g10code.com>
105         * scdaemon.c (main): Replace some calls by init_common_subsystems.
107 2007-06-11  Werner Koch  <wk@g10code.com>
109         * Makefile.am (scdaemon_LDADD): Use libcommonpth macro.
111         * command.c (initialize_module_command): New.
112         * scdaemon.c (main) [W32]: Do not use sigpipe code.
113         (main): Call initialize_module_command.
115 2007-06-06  Werner Koch  <wk@g10code.com>
117         * app-openpgp.c (do_sign): Fix arithmetic on void*.
119         * app.c (dump_mutex_state) [W32]: Handle the W32Pth case.
121         * apdu.c: Remove dynload.h.
123         * scdaemon.c (i18n_init): Remove.
125 2007-04-20  Werner Koch  <wk@g10code.com>
127         * sc-copykeys.c (my_gcry_logger): Removed.
128         (main): Call setup_libgcrypt_logging helper.
129         * scdaemon.c (my_gcry_logger): Removed.
130         (main): Call setup_libgcrypt_logging helper.
132 2007-04-03  Werner Koch  <wk@g10code.com>
134         * command.c (cmd_getinfo): New subcommand "reader_list".
135         * ccid-driver.c (scan_or_find_devices): Ignore EBUSY in scan mode
136         for special transports.
138 2007-03-07  Werner Koch  <wk@g10code.com>
140         * app-dinsig.c: Include i18n.h.
141         (verify_pin): Support PIN pads.
142         * app-nks.c (verify_pin): Ditto.
144         * ccid-driver.c (bulk_in): Handle time extension before checking
145         the message type.
146         (ccid_transceive_secure): Support the Cherry XX44 keyboard.
147         Kudos to the nice folks at Cherry for helping with that.
149 2007-02-18  Werner Koch  <wk@g10code.com>
151         * scdaemon.c (DEFAULT_PCSC_DRIVER): Add a default for OS X.
153 2007-01-25  Werner Koch  <wk@g10code.com>
155         * Makefile.am (scdaemon_LDADD): Added LIBICONV.  Noted by Billy
156         Halsey.
158 2006-12-21  Werner Koch  <wk@g10code.com>
160         * app-openpgp.c (verify_chv2): Factored most code out into...
161         (verify_a_chv): ... new.
162         (do_sign): Factored verification code out to new function and
163         take care of a keypad entered PIN.
164         (compare_fingerprint): Print an additional diagnostic.
166 2006-11-28  Werner Koch  <wk@g10code.com>
168         * apdu.c (send_le, apdu_send_direct): Increase RESULTLEN to 258 to
169         allow for full 256 byte and the status word.  This might break
170         some old PC/SC drivers or cards, but we will see.  Suggested by
171         Kenneth Wang.
173 2006-11-23  Werner Koch  <wk@g10code.com>
175         * command.c (scd_command_handler): Fixed use of CTRL.
177 2006-11-21  Werner Koch  <wk@g10code.com>
179         * Makefile.am (libexec_PROGRAMS): Put pscs-wrapper into libexec.
180         Renamed to gnupg-pcsc-wrapper.
181         * apdu.c (open_pcsc_reader): Use GNUPG_LIBEXECDIR to accces the
182         wrapper.  Suggested by Eric Dorland.
184 2006-11-20  Werner Koch  <wk@g10code.com>
186         * app-openpgp.c (verify_chv2): Support for keypads (only CHV2).
188         * ccid-driver.c (ccid_transceive_secure): Made it work for Kaan
189         and SCM.
191 2006-11-17  Werner Koch  <wk@g10code.com>
193         * ccid-driver.c (scan_or_find_devices): Use DEBUGOUT_2 instead of
194         log_debug.  Removed few other log_debug.
196         * iso7816.c (iso7816_check_keypad): Allow for a SW of 0.
198         * command.c (pin_cb): New mode to prompt for a keypad entry.
200         * scdaemon.c (main) <gpgconf-list>: Add disable-keypad.
202 2006-11-15  Werner Koch  <wk@g10code.com>
204         * app-p15.c (read_ef_odf): Cast one printf arg.
206         * scdaemon.h (struct server_control_s): Add field THREAD_STARTUP.
207         * command.c (scd_command_handler): Add new arg CTRL.
208         * scdaemon.c (scd_init_default_ctrl): Made static.
209         (scd_deinit_default_ctrl): New.
210         (start_connection_thread): Call init/deinit of ctrl.
211         (handle_connections): Allocate CTRL.
213         * apdu.c (PCSC_ERR_MASK): New.
214         (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu)
215         (close_pcsc_reader, open_pcsc_reader): Use it after shifting error
216         values.  Reported by Henrik Nordstrom.  Fixes bug #724.
218 2006-10-24  Werner Koch  <wk@g10code.com>
220         * scdaemon.h (GCRY_MD_USER_TLS_MD5SHA1): New.
221         (MAX_DIGEST_LEN): Increased to 36.
222         * app-p15.c (do_sign): Support for TLS_MD5SHA1.
223         (do_auth): Detect TLS_MD5SHA1.
224         (do_sign): Tweaks for that digest.
226 2006-10-23  Werner Koch  <wk@g10code.com>
228         * scdaemon.c (main): New command --gpgconf-test.
230 2006-10-17  Werner Koch  <wk@g10code.com>
232         * Makefile.am (scdaemon_LDADD): Link against libcommonpth.
234 2006-10-12  Werner Koch  <wk@g10code.com>
236         * apdu.c: Include pth.h after unistd.h for the sake of newer Pth
237         versions.
239 2006-10-11  Werner Koch  <wk@g10code.com>
241         * app-openpgp.c (do_sign): Redirect to do_auth for OpenPGP.3.
243 2006-10-06  Werner Koch  <wk@g10code.com>
245         * Makefile.am (AM_CFLAGS): Use PTH version of libassuan.
246         (scdaemon_LDADD): Ditto.
248         * scdaemon.h (send_status_info): Mark with sentinel attribute.
250 2006-10-02  Marcus Brinkmann  <marcus@g10code.de>
252         * command.c (update_reader_status_file): Increase buffer of
253         NUMBUF2 (fixing typo).
255 2006-09-24  Marcus Brinkmann  <marcus@g10code.de>
257         * app-openpgp.c (do_sign): Advance INDATA by the SHA1 resp. RMD160
258         prefix length.
260 2006-09-14  Werner Koch  <wk@g10code.com>
262         Replaced all call gpg_error_from_errno(errno) by
263         gpg_error_from_syserror().
265         * command.c (scd_command_handler): Replaced
266         init_connected_socket_server by init_socket_server_ext.
268 2006-09-07  Werner Koch  <wk@g10code.com>
270         * command.c (update_reader_status_file): Execute an event handler
271         if available.
273 2006-09-06  Werner Koch  <wk@g10code.com>
275         * apdu.c (pcsc_end_transaction): 
276         * pcsc-wrapper.c (pcsc_end_transaction: Fixed dclaration.
277         Reported by Bob Dunlop.
279         * scdaemon.h (CTRL,APP): Removed and changed everywhere to
280         ctrl_t/app_t.
282         Replaced all Assuan error codes by libgpg-error codes.  Removed
283         all map_to_assuan_status and map_assuan_err.
284         
285         * scdaemon.c (main): Call assuan_set_assuan_err_source to have Assuan
286         switch to gpg-error codes.
287         * command.c (set_error): Adjusted.
289 2006-09-02  Marcus Brinkmann  <marcus@g10code.de>
291         * command.c (get_reader_slot): Return the slot_table index, not
292         the APDU slot number.
293         (update_reader_status_file): Use the slot_table index in the
294         update_card_removed invocation.
296 2006-09-01  Marcus Brinkmann  <marcus@g10code.de>
298         * command.c (cmd_getinfo): Handle status command.
300 2006-08-30  Marcus Brinkmann  <marcus@g10code.de>
302         * command.c (do_reset): Delay resetting CTRL->reader_slot until
303         after update_card_removed invocation.
305 2006-08-28  Marcus Brinkmann  <marcus@g10code.de>
307         * app-openpgp.c (do_decipher, do_sign): Allow "OPENPGP.2"
308         resp. "OPENPGP.1" for KEYIDSTR.
310 2006-08-21  Werner Koch  <wk@g10code.com>
312         * pcsc-wrapper.c (handle_open, handle_close): Reset card and
313         protocol on error/close.
314         (handle_status): Don't set the state if the state is unknown.
315         (handle_reset): Ignore an error if already disconnected.  May
316         happen due to system wake-up after hibernation.  Suggested by Bob
317         Dunlop.
319 2006-06-28  Werner Koch  <wk@g10code.com>
321         * app-openpgp.c (do_writekey): Fixed computation of memmove
322         length.  This led to garbled keys if E was larger than one byte.
323         Thanks to Achim Pietig for hinting at the garbled E.
325 2006-06-09  Marcus Brinkmann  <marcus@g10code.de>
327         * Makefile.am (scdaemon_LDADD): Add $(NETLIBS).
329 2006-04-14  Marcus Brinkmann  <marcus@g10code.de>
331         * app.c (select_application): Cover up a slot mismatch error in
332         case it happens (it shouldn't happen).
333         (release_application): Use APP->slot.  Lock the reader.
334         (application_notify_card_removed): Lock the reader.
336 2006-04-11  Werner Koch  <wk@g10code.com>
338         * command.c (hex_to_buffer): New.
339         (cmd_apdu): New.
341 2006-04-03  Werner Koch  <wk@g10code.com>
343         * scdaemon.c [__GLIBC__]: Default to libpcsclite.so.1.
345 2006-03-21  Werner Koch  <wk@g10code.com>
347         * command.c (cmd_pksign): Add --hash option.
349 2006-03-01  Werner Koch  <wk@g10code.com>
351         * command.c (status_file_update_lock): New.
352         (scd_update_reader_status_file): Use lock and factor existing code
353         out to ..
354         (update_reader_status_file): .. this.
355         (do_reset): Use the lock and call update_reader_status_file.
357 2006-02-20  Werner Koch  <wk@g10code.com>
359         * apdu.c (open_pcsc_reader): Fixed double free.  Thanks to Moritz.
361 2006-02-09  Werner Koch  <wk@g10code.com>
363         * command.c (get_reader_slot, do_reset) 
364         (scd_update_reader_status_file): Rewrote.
366         * app.c (release_application): Factored code out to ..
367         (deallocate_app): new function.
368         (select_application): Introduce new saved application stuff.
369         (application_notify_card_removed): New.
370         * command.c (update_card_removed): Call it here.
371         (do_reset): And here.
373         * app.c (check_application_conflict): New.
374         * command.c (open_card): Use it here.
375         (cmd_restart): New command.
377         * command.c (cmd_lock): Fixed --wait option to actually terminate.
379 2006-02-08  Werner Koch  <wk@g10code.com>
381         * ccid-driver.c (ccid_get_atr): Read Parameter and select T=1
382         using these parameters.
383         (scan_or_find_devices): Check for NULL r_fd.
385 2006-02-02  Werner Koch  <wk@g10code.com>
387         * ccid-driver.c (special_transport): New
388         (ccid_open_reader, do_close_reader, ccid_shutdown_reader)
389         (bulk_out, bulk_in): Add support for CardMan 4040 reader.
391         * ccid-driver.c (scan_or_find_devices): Factored most code out to
392         (scan_or_find_usb_device): .. new.
393         (make_reader_id): Fixed vendor mask.
395 2006-01-01  Werner Koch  <wk@g10code.com>
397         * app-openpgp.c (do_sign): Give user error if hash algorithm is
398         not supported by the card.
400 2005-12-06  Werner Koch  <wk@g10code.com>
402         * apdu.c (open_pcsc_reader): Check that pcsc-wrapper is actually
403         installed.
405 2005-11-23  Werner Koch  <wk@g10code.com>
407         * app-nks.c (verify_pin): Give a special error message for a Nullpin.
409 2005-10-29  Werner Koch  <wk@g10code.com>
411         * ccid-driver.c (send_escape_cmd): New args RESULT, RESULTLEN and
412         RESULTMAX.  Changed all callers.
413         (ccid_transceive_escape): New.
415 2005-10-27  Werner Koch  <wk@g10code.com>
417         * apdu.c [__CYGWIN__]: Make cygwin environment similar to _WIN32.
418         Suggested by John P. Clizbe.
419         * scdaemon.c [__CYGWIN__]: Set default PC/SC driver to winscard.dll.
421 2005-10-19  Werner Koch  <wk@g10code.com>
423         * ccid-driver.h (CCID_DRIVER_ERR_NO_KEYPAD): New.
424         * apdu.h (SW_HOST_NO_KEYPAD): New.
425         * iso7816.h (struct iso7816_pininfo_s): New.
426         * iso7816.c (map_sw): Support new code.
427         (iso7816_check_keypad): New.
428         (iso7816_verify_kp, iso7816_change_reference_data_kp) 
429         (iso7816_reset_retry_counter_kp): New.  Extended versions of the
430         original functions.
431         * apdu.c (host_sw_string): Support new code. 
432         (reader_table_s): New field CHECK_KEYPAD.
433         (new_reader_slot, open_ct_reader, open_pcsc_reader) 
434         (open_ccid_reader, open_rapdu_reader): Initialize it.
435         (check_ccid_keypad): New.
436         (apdu_check_keypad): New.
437         (apdu_send_le): Factored all code out to ...
438         (send_le): .. new.  Takes an additional arg; changed all callers
439         of the orginal function to use this one with a NULL for the new
440         arg.
441         (apdu_send_simple_kp): New.
442         (ct_send_apdu, pcsc_send_apdu, my_rapdu_send_apdu) 
443         (send_apdu_ccid): New arg PININFO.
444         (send_apdu_ccid): Use the new arg.
446         * scdaemon.c: New option --disable-keypad.
448 2005-10-08  Marcus Brinkmann  <marcus@g10code.de>
450         * Makefile.am (scdaemon_LDADD): Add ../gl/libgnu.a after
451         ../common/libcommon.a.
453 2005-09-20  Werner Koch  <wk@g10code.com>
455         * app-dinsig.c (verify_pin): Try ISO 9564 BCD encoding.
457         * iso7816.c (iso7816_select_application): Add arg FLAGS.  Changed
458         all callers to pass 0.
459         * app-openpgp.c (app_select_openpgp): But this one requires a
460         special flag.
462         * app-p15.c (app_select_p15): Don't use select application for the
463         BELPIC.
465 2005-09-09  Werner Koch  <wk@g10code.com>
467         * pcsc-wrapper.c (main): Removed bogus free.
469         * app-p15.c (do_auth): New.
470         (do_getattr): New attribs $AUTHKEYID and $DISPSERIALNO.
471         * app-openpgp.c (do_getattr): Ditto.
473 2005-09-08  Werner Koch  <wk@g10code.com>
475         * app-openpgp.c (do_getattr): New key $AUTHKEYID.
477 2005-09-06  Werner Koch  <wk@g10code.com>
479         * app-p15.c (do_sign): Tweaked for BELPIC cards.
480         (read_home_df): New arg R_BELPIC.
481         (app_select_p15): Set card type for BELPIC.
483 2005-09-05  Werner Koch  <wk@g10code.com>
485         * iso7816.c (iso7816_select_path): New.
486         * app-p15.c (select_ef_by_path): Allow for direct path selection.
487         (app_select_p15): Try using the Belgian variant of pkcs#15.
488         (read_home_df): New.
489         (read_ef_odf): Generalized.
490         (read_ef_tokeninfo): New.
491         (read_p15_info): Set serialnumber from TokenInfo.
492         (app_select_p15): Don't munge serialNumber - that must be done
493         only once.
495         * iso7816.c (iso7816_read_binary): Use Le=0 when reading all
496         data.  Handle 6C00 error and take 6B00 as indication for EOF.
497         * apdu.h (SW_EXACT_LENGTH_P): New.
498         * apdu.c (new_reader_slot, reset_pcsc_reader, pcsc_get_status) 
499         (open_pcsc_reader): Set new reader state IS_T0.
500         (apdu_send_le): When doing T=0 make sure not to send Lc and Le.
501         Problem reported by Carl Meijer.
502         (apdu_send_direct): Initialize RESULTLEN.
503         * pcsc-wrapper.c (handle_status): Return the current protocol as
504         a new third word.
506 2005-08-05  Werner Koch  <wk@g10code.com>
508         * apdu.c (open_rapdu_reader): Set the reader number.
510 2005-07-05  Werner Koch  <wk@g10code.com>
512         * app-openpgp.c (do_readkey): Return a mallcoed copy of the key as
513         required by the description.  Thanks to Moritz for tracking this
514         problem down.
516 2005-06-21  Werner Koch  <wk@g10code.com>
518         * scdaemon.c (main): ifdef call to ccid_set_debug_level.
520         * apdu.c (reset_pcsc_reader, open_pcsc_reader): Cast size_t to
521         ulong for printf.
523 2005-06-06  Werner Koch  <wk@g10code.com>
525         * scdaemon.c (main): New option --debug-allow-core-dump. 
527 2005-06-03  Werner Koch  <wk@g10code.com>
529         * scdaemon.c (handle_connections): Make sure that the signals we
530         are handling are not blocked.Block signals while creating new
531         threads.
532         (handle_connections): Include the file descriptor into the name of
533         the thread.
535 2005-06-02  Werner Koch  <wk@g10code.com>
537         * app.c (app_dump_state, dump_mutex_state): New.
538         * scdaemon.c (handle_signal): Print it on SIGUSR1.
540         * app-openpgp.c (do_writekey): Typo fix.
542         * command.c (open_card): Check for locked state even if an
543         application context is available.
545         * app-common.h: Add REF_COUNT field.
546         * app.c (release_application, select_application): Implement
547         reference counting to share the context beween connections.
549         * app.c (lock_reader, unlock_reader): Take SLOT instead of APP as
550         argument.  Changed all callers.
551         (select_application): Unlock the reader on error.  This should fix
552         the hangs I noticed last week.
554         * scdaemon.h: Removed card_ctx_t cruft.
556 2005-06-01  Werner Koch  <wk@g10code.com>
558         * scdaemon.c: Include mkdtemp.h.
560 2005-05-31  Werner Koch  <wk@g10code.com>
562         * tlv.c [GNUPG_MAJOR_VERSION==1]: Define constants instead of
563         including a gnupg 1.4 header.
565 2005-05-30  Werner Koch  <wk@g10code.com>
567         * tlv.c: Add hack to compile without gpg-error.h when used with
568         GnuPG 1.4.
570 2005-05-23  Werner Koch  <wk@g10code.com>
572         * Makefile.am: Do not build sc-copykeys anymore.
574         * app-openpgp.c (app_openpgp_storekey, app_openpgp_readkey)
575         (app_openpgp_cardinfo): Removed.
577         * ccid-driver.c (parse_ccid_descriptor): SCR335 FW version 5.14 is
578         good.
579         (do_close_reader): Never do a reset. The caller should instead
580         make sure that the reader has been closed properly.  The new retry
581         code in ccid_slot_status will make sure that the readersatrts up
582         fine even if the last process didn't closed the USB connection
583         properly.
584         (ccid_get_atr): For certain readers try switching to ISO mode.
585         Thanks to Ludovic Rousseau for this hint and the magic numbers.
586         (print_command_failed): New.
587         (bulk_in): Use it here. Add new arg NO_DEBUG.
588         (ccid_slot_status): Disabled debugging.
590 2005-05-21  Werner Koch  <wk@g10code.com>
592         * scdaemon.c (handle_signal): Print thread info on SIGUSR1.
594 2005-05-20  Werner Koch  <wk@g10code.com>
596         * ccid-driver.c: Replaced macro DEBUG_T1 by a new debug level.
597         (parse_ccid_descriptor): Mark SCR335 firmware version 5.18 good.
598         (ccid_transceive): Arghhh.  The seqno is another bit in the
599         R-block than in the I block, this was wrong at one place.
601         * scdaemon.c: New options --debug-ccid-driver and
602         --debug-disable-ticker.
604         * app-openpgp.c (do_genkey, do_writekey): Factored code to check
605         for existing key out into ..
606         (does_key_exist): .. New function.
608 2005-05-19  Werner Koch  <wk@g10code.com>
610         * tlv.c (parse_sexp): New.
612         * command.c (cmd_writekey): New.
613         * app.c (app_writekey): New.
614         * app-common.c (app_t): Add function ptr WRITEKEY.
615         * app-openpgp.c (do_writekey): New.
617         * app-openpgp.c (do_readkey) [GNUPG_MAJOR_VERSION==1]: Return error.
618         * app-common.h (app_t) [GNUPG_MAJOR_VERSION==1]: Add a field to
619         store the Assuan context.
621 2005-05-17  Werner Koch  <wk@g10code.com>
623         * scdaemon.c: Removed non-pth code paths.
624         (create_socket_name, create_server_socket): New.  Taken from
625         ../agent/gpg-agent.
626         (cleanup): Changed to adjust for SOCKET_NAME now being malloced.
627         (ticker_thread): Always use pth_event_occurred; it is again
628         defined for all decent PTH versions.
629         (handle_connections): New. Based on the gpg-agent code.
630         (start_connection_thread): Ditto.
631         (ticker_thread): Removed.
632         (cleanup_sh): Removed.
633         (main): Run the handler for the pipe server in a separate
634         thread.  This replaces the old ticker thread.
635         (scd_get_socket_name): New.
636         * command.c (cmd_getinfo): New command GETINFO.
637         (scd_command_handler): Renamed argument and changed code to use an
638         already connected FD.
640 2005-05-15  Werner Koch  <wk@g10code.com>
642         * app.c, app-common.h, app-nks.c, app-p15.c, app-dinsig.c
643         * app-openpgp.c: Change most function return types from int to
644         gpg_error_t.
645         * command.c (pin_cb): Ditto.
646         * sc-copykeys.c (pincb): Ditto.
648         * app.c (lock_reader, unlock_reader): New.  Changed call handler
649         wrappers to make use of these functions.
651 2005-05-07  Werner Koch  <wk@g10code.com>
653         * ccid-driver.c (do_close_reader): Don't do a reset before close.
654         Some folks reported that it makes the SCR335 hang less often.
655         Look at the source on how to re-enable it.
657 2005-04-27  Werner Koch  <wk@g10code.com>
659         * app-p15.c (micardo_mse): New.
660         (do_sign): Call it.
661         * iso7816.c (iso7816_manage_security_env): Allow passing DATA as
662         NULL to indicate an empty Lc.
663         * tlv.c (find_tlv): Check that a found object fits into the
664         buffer.
665         (find_tlv_unchecked): New as replacement for the old non-checking
666         variant.
667         * app.c (select_application): Keep on using the non-checking
668         variant.
669         * app-openpgp.c (get_one_do, dump_all_do): Ditto.
671         
672         Removal of the old OpenSC based code.
673         
674         * app-p15.c: New.  Basic support for pkcs15 cards without OpenSC.
675         There are quite a couple of things missing but at least I can use
676         my old TCOS cards from the Aegypten-1 development for signing.
677         * app.c (select_application): Detect pkcs15 applications.
678         * Makefile.am (scdaemon_SOURCES): Removed card.c, card-common.h
679         and card-p15.c because they are now obsolete. Added app-p15.c.
680         Removed all OpenSC stuff.
681         * command.c (do_reset, open_card, cmd_serialno, cmd_learn) 
682         (cmd_readcert, cmd_readkey, cmd_pksign, cmd_pkdecrypt): Removed
683         all special cases for the old card.c based mechanisms.
684         * scdaemon.c, apdu.c: Removed all special cases for OpenSC.
686 2005-04-20  Werner Koch  <wk@g10code.com>
688         * command.c: Use GPG_ERR_LOCKED instead of EBUSY.
690 2005-04-14  Werner Koch  <wk@g10code.com>
692         * app-openpgp.c (retrieve_key_material): Rewritten.  Return a
693         proper error code.
694         (retrieve_next_token): Removed.
695         (retrieve_fpr_from_card): Rewritten to make use of DO caching and
696         to take the KEYNO as arg.
697         (get_public_key): Renamed variable for clarity.
699 2005-04-12  Werner Koch  <wk@g10code.com>
701         Basic support for several sessions.
702         
703         * command.c (scd_command_handler): Replace the primary_connection
704         stuff by a real connection list.  Release the local context on
705         exit.
706         (scd_update_reader_status_file): Update accordingly.  Send signal
707         to all connections who registered an event signal.
708         (cmd_lock, cmd_unlock, register_commands): New commands LOCK and
709         UNLOCK.
710         (cmd_setdata, cmd_pksign, cmd_pkauth, cmd_pkdecrypt, cmd_setattr) 
711         (cmd_genkey, cmd_passwd, cmd_checkpin): Return an error if reader
712         is locked.
713         (do_reset): Handle locking.
714         (open_card): Ditto.  Share the reader slot with other sessions.
715         (get_reader_slot): New.
716         (update_card_removed): New.  Use it in the TEST_CARD_REMOVAL macro.
718 2005-04-07  Werner Koch  <wk@g10code.com>
720         * app-openpgp.c (do_check_pin): Add hack to allow verification of
721         CHV3.
722         (get_public_key): Don't use gcry functions to create S-expressions.
723         (do_deinit, do_readkey, do_genkey, send_keypair_info): Adjust for
724         above change.
726 2005-03-29  Moritz Schulte  <moritz@g10code.com>
728         * app-openpgp.c (retrieve_fpr_from_card): New function.
729         (retrieve_next_token): New function.
730         (retrieve_key_material): New function.
731         (get_public_key): Implement retrival of key through expernal
732         helper (gpg) in case the openpgp card is not cooperative enough.
734 2005-03-16  Werner Koch  <wk@g10code.com>
736         * ccid-driver.c (parse_ccid_descriptor): Make SCM workaround
737         reader type specific.
738         (scan_or_find_devices): Do not check the interface subclass in the
739         SPR532 kludge, as this depends on the firmware version.
740         (ccid_get_atr): Get the Slot status first.  This solves the
741         problem with readers hanging on recent Linux 2.6.x.
742         (bulk_in): Add argument TIMEOUT and changed all callers to pass an
743         appropriate one.  Change the standard timeout from 10 to 5 seconds.
744         (ccid_slot_status): Add a retry code with an initial short timeout.
745         (do_close_reader): Do an usb_reset before closing the reader.
747 2005-02-25  Werner Koch  <wk@g10code.com>
749         * app-openpgp.c (get_public_key): Make sure not to return negative
750         numbers.
751         (do_sign): Allow passing of indata with algorithm prefix.
752         (do_auth): Allow OPENPGP.3 as an alternative ID.
754         * app.c (app_getattr): Return just the S/N but not the timestamp.
756 2005-02-24  Werner Koch  <wk@g10code.com>
758         * app.c (app_getattr): Return APPTYPE or SERIALNO type even if the
759         application does dot support the getattr call.
761         * app-openpgp.c (get_one_do): Never try to get a non cacheable
762         object from the cache.
763         (get_one_do): Add new arg to return an error code.  Changed all
764         callers.
765         (do_getattr): Let it return a proper error code.
767         * app.c (select_application): Return an error code and the
768         application context in an new arg.
769         * command.c (open_card): Adjusted for that.  Don't use the
770         fallback if no card is present.  Return an error if the card has
771         been removed without a reset.
772         (do_reset, cmd_serialno): Clear that error flag.
773         (TEST_CARD_REMOVAL): New. Use it with all command handlers.
774         (scd_update_reader_status_file): Set the error flag on all changes.
776         * scdaemon.c (ticker_thread): Termintate if a shutdown is pending.
778         * apdu.c: Added some PCSC error codes.
779         (pcsc_error_to_sw): New.
780         (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu) 
781         (open_pcsc_reader): Do proper error code mapping.
783 2005-03-16  Werner Koch  <wk@g10code.com>
785         * ccid-driver.c (parse_ccid_descriptor): Make SCM workaround
786         reader type specific.
787         (scan_or_find_devices): Do not check the interface subclass in the
788         SPR532 kludge, as this depends on the firmware version.
789         (ccid_get_atr): Get the Slot status first.  This solves the
790         problem with readers hanging on recent Linux 2.6.x.
792 2005-02-22  Werner Koch  <wk@g10code.com>
794         * app-openpgp.c (app_local_s): New field PK.
795         (do_deinit, do_genkey, app_openpgp_storekey): Clear it.
796         (get_public_key, send_keypair_info): New.
797         (do_learn_status): Send KEYPAIR info
799         * app-common.h (app_ctx_t): Add function pointer READKEY.
800         * app.c (app_readkey): New.
801         * command.c (cmd_readkey): Use READKEY function if possible.
803 2005-01-26  Werner Koch  <wk@g10code.com>
805         * ccid-driver.c (parse_ccid_descriptor): Need the CSM workaround
806         also for newer firmware versions.  Need to get a list of fixed
807         firmware versions and use that.
809 2005-01-25  Werner Koch  <wk@g10code.com>
811         * apdu.c (apdu_send_le, apdu_send_direct): Fix some compiler
812         warnings.
814         * app-openpgp.c (get_cached_data): New arg GET_IMMEDIATE to bypass
815         the cache.  Changed all callers.
816         (get_one_do): Bypass the cache if the value would have been read
817         directly for v1.1 cards.It makes things a bit slower but obnly for
818         1.0 cards and there are not that many cards out in the wild.  This
819         is required to fix a caching bug when generating new keys; as a
820         side effect of the retrieval of the the C4 DO from the 6E DO the
821         cached fingerprint will get updated to the old value and later
822         when signing the generated key the checking of the fingerprint
823         fails because it won't match the new one.  Thanks to Moritz for
824         analyzing this problem.
825         (verify_chv3): Removed the CHV status reread logic because we
826         won't cache the C4 DO anymore.
828 2004-12-28  Werner Koch  <wk@g10code.com>
830         * ccid-driver.c (find_endpoint): New.
831         (scan_or_find_devices): Add new args to return endpoint info and
832         interface number.
833         (ccid_open_reader, ccid_shutdown_reader): Take care of these new
834         args.
835         (bulk_in, bulk_out): Use the correct endpoints.
836         (ccid_transceive_apdu_level): New.
837         (ccid_transceive): Divert to above.
838         (parse_ccid_descriptor): Allow APDU level exchange mode.
839         (do_close_reader): Pass the interface number to usb_release_interface.
841 2004-12-21  Werner Koch  <wk@g10code.com>
843         * scdaemon.c (main): Use default_homedir().
845 2004-12-18  Werner Koch  <wk@g10code.com>
847         * scdaemon.c (main) [W32]: Remove special Pth initialize..
849         * scdaemon.h (map_assuan_err): Define in terms of
850         map_assuan_err_with_source.
852 2004-12-15  Werner Koch  <wk@g10code.com>
854         * scdaemon.c [W32]: Various hacks to make it run under W32.
856         * command.c (scd_update_reader_status_file) [W32]: Don't use kill.
858         * apdu.c [W32]: Disable use of pcsc_wrapper.
860         * Makefile.am (scdaemon_LDADD): Reorder libs.
861         (sc_copykeys_LDADD): Add libassuan because it is needed for W32. 
863 2004-12-06  Werner Koch  <wk@g10code.com>
865         * Makefile.am (pkglib_PROGRAMS): Build only for W32.
867 2004-10-22  Werner Koch  <wk@g10code.com>
869         * app-openpgp.c (verify_chv3): The minium length for CHV3 is
870         8. Changed string to match the other ones.
872 2004-10-21  Werner Koch  <wk@g10code.com>
874         * app-openpgp.c (do_sign): Replace asprintf by direct allocation.
875         This avoids problems with missing vasprintf implementations in
876         gnupg 1.4.
878         * app-common.h (app_openpgp_storekey: Add prototype. 
880 2004-10-20  Werner Koch  <wk@g10code.com>
882         * sc-investigate: Removed.
883         * Makefile.am (sc_investigate): Removed.
884         
885         * pcsc-wrapper.c (load_pcsc_driver): Load get_status_change func.
886         (handle_open): Succeed even without a present card.
887         (handle_status, handle_reset): New.
888         
889         * apdu.c (apdu_open_reader): Load pcsc_get_status_change fucntion.
890         (pcsc_get_status): Implemented.
891         (reset_pcsc_reader): Implemented.
892         (open_pcsc_reader): Succeed even with no card inserted.
893         (open_ccid_reader): Set LAST_STATUS.
895         * iso7816.c (iso7816_select_application): Always use 0 for P1.
897 2004-10-18  Werner Koch  <wk@g10code.com>
899         * ccid-driver.c (ccid_get_atr): Reset T=1 state info.
901 2004-10-14  Werner Koch  <wk@g10code.com>
903         * app-openpgp.c (parse_login_data): New. 
904         (app_select_openpgp): Call it.
905         (do_setattr): Reparse it after change.
907 2004-10-06  Werner Koch  <wk@g10code.de>
909         * ccid-driver.c (ccid_open_reader): Store the vendor ID.
910         (ccid_transceive_secure): New.
911         (parse_ccid_descriptor): Workaround for an SCM reader problem.
913 2004-10-04  Werner Koch  <wk@g10code.de>
915         * ccid-driver.c (send_escape_cmd): New.
917 2004-09-30  Werner Koch  <wk@g10code.com>
919         * Makefile.am: Adjusted for gettext 0.14.
921         * app-openpgp.c (do_sign): Add the error string to the verify
922         failed messages.
924 2004-09-27  Werner Koch  <wk@g10code.com>
926         From gnupg 1.3
928         * app-openpgp.c: Made all strings translatable.
929         (verify_chv3) [GNUPG_MAJOR_VERSION]: Make opt.allow_admin
930         available for use in gnupg 2. 
931         (verify_chv3): Reimplemented countdown showing to use only
932         functions from this module.  Flush the CVH status cache on a
933         successful read.
934         (get_one_do): Hack to bypass the cache for cards versions > 1.0.
935         (store_fpr): Store the creation date for card version > 1.0.
937         * app-openpgp.c (app_openpgp_storekey): Call flush_cache.
938         (get_cached_data): Move local data initialization to ..
939         (app_select_openpgp): .. here. Read some flags for later use.
940         (do_getattr): New read-only attribute EXTCAP.
941         
942         * apdu.c (open_pcsc_reader): Do not print empty reader string.
944         * ccid-driver.c (do_close_reader): Factored some code out from ...
945         (ccid_close_reader): ..here.
946         (ccid_shutdown_reader): New.
948         * apdu.c (apdu_shutdown_reader): New.
949         (shutdown_ccid_reader): New.
951         * apdu.c (open_ccid_reader): New arg PORTSTR.  Pass it to
952         ccid_open_reader.
953         (apdu_open_reader): Pass portstr to open_ccid_reader.
954         (apdu_open_reader): No fallback if a full CCID reader id has been
955         given.
957         * ccid-driver.c (ccid_get_reader_list): New.
958         (ccid_open_reader): Changed API to take a string for the reader.
959         Removed al the cruft for the libusb development vesion which seems
960         not to be maintained anymore and there are no packages anyway.
961         The stable library works just fine.
962         (struct ccid_reader_id_s): Deleted and replaced everywhere by a
963         simple string.
964         (usb_get_string_simple): Removed.
965         (bulk_in): Do valgrind hack here and not just everywhere.
967         * ccid-driver.c (read_device_info): Removed.
968         (make_reader_id, scan_or_find_devices): New.
969         (ccid_open_reader): Simplified by make use of the new functions.
970         (ccid_set_debug_level): New.  Changed the macros to make use of
971         it.  It has turned out that it is often useful to enable debugging
972         at runtime so I added this option.
974         From gnupg 1.3 - David Shaw  <dshaw@jabberwocky.com>
976         * app-openpgp.c (verify_chv3): Show a countdown of how many wrong
977         admin PINs can be entered before the card is locked.
979         * app-openpgp.c (get_cached_data): Avoid mallocing zero since it
980         breaks us when using --enable-m-guard.
982         * ccid-driver.c (usb_get_string_simple): Replacement function to
983         work with older libusb.
985         * ccid-driver.c (read_device_info): Fix segfault when usb device
986         is not accessible.
987         (ccid_open_reader): Allow working with an even older version of
988         libusb (usb_busses global instead of usb_get_busses()).
990 2004-09-11  Werner Koch  <wk@g10code.com>
992         * app-openpgp.c (app_select_openpgp): Its app_munge_serialno and
993         not app_number_serialno.
995 2004-08-20  Werner Koch  <wk@g10code.de>
997         * app.c (select_application): Fixed serial number extraction and
998         added the BMI card workaround.
999         (app_munge_serialno): New.
1000         * app-openpgp.c (app_select_openpgp): Try munging serialno.
1002 2004-08-05  Werner Koch  <wk@g10code.de>
1004         * scdaemon.c (main): New option --disable-application.
1005         * app.c (is_app_allowed): New.
1006         (select_application): Use it to check for disabled applications.
1008         * ccid-driver.h (CCID_DRIVER_ERR_ABORTED): New.
1009         * ccid-driver.c (ccid_open_reader): Support the stable 0.1 version
1010         of libusb.
1011         (ccid_get_atr): Handle short messages.
1013         * apdu.c (my_rapdu_get_status): Implemented.
1015 2004-07-27  Moritz Schulte  <moritz@g10code.com>
1017         * apdu.c: Include <signal.h>.
1019         * Makefile.am: Use @DL_LIBS@ instead of -ldl.
1021 2004-07-22  Werner Koch  <wk@g10code.de>
1023         * Makefile.am: Make OpenSC lib link after libgcrypt. Do not link
1024         to pth.
1025         * apdu.c: Don't use Pth if we use OpenSC.
1026         * sc-investigate.c, scdaemon.c: Disable use of pth if OpenSC is used. 
1028         * scdaemon.c (main): Bumbed thread stack size up to 512k.
1030 2004-07-16  Werner Koch  <wk@gnupg.org>
1032         * apdu.c (reader_table_s):  Add function pointers for the backends.
1033         (apdu_close_reader, apdu_get_status, apdu_activate) 
1034         (send_apdu): Make use of them.
1035         (new_reader_slot): Intialize them to NULL.
1036         (dump_ccid_reader_status, ct_dump_reader_status): New.
1037         (dump_pcsc_reader_status): New.
1038         (open_ct_reader, open_pcsc_reader, open_ccid_reader) 
1039         (open_osc_reader, open_rapdu_reader): Intialize function pointers.
1040         (ct_activate_card, ct_send_apdu, pcsc_send_apdu, osc_send_apdu) 
1041         (error_string): Removed.  Replaced by apdu_strerror.
1042         (get_ccid_error_string): Removed.
1043         (ct_activate_card): Remove the unused loop.
1044         (reset_ct_reader): Implemented.
1045         (ct_send_apdu): Activate the card if not yet done.
1046         (pcsc_send_apdu): Ditto.
1048 2004-07-15  Werner Koch  <wk@gnupg.org>
1050         * ccid-driver.h: Add error codes.
1051         * ccid-driver.c: Implement more or less proper error codes all
1052         over the place.
1054         * apdu.c (apdu_send_direct): New.
1055         (get_ccid_error_string): Add some error code mappings.
1056         (send_apdu): Pass error codes along for drivers already supporting
1057         them.
1058         (host_sw_string): New.
1059         (get_ccid_error_string): Use above.
1060         (send_apdu_ccid): Reset the reader if it has not yet been done.
1061         (open_ccid_reader): Don't care if the ATR can't be read.
1062         (apdu_activate_card): New.
1063         (apdu_strerror): New.
1064         (dump_reader_status): Only enable it with opt.VERBOSE.
1065         * iso7816.c (map_sw): Add mappings for the new error codes.
1067 2004-07-02  Werner Koch  <wk@gnupg.org>
1069         * apdu.c (open_ct_reader, open_pcsc_reader, open_ccid_reader)
1070         (reset_ccid_reader, open_osc_reader): Call dump_reader_status only
1071         in verbose mode.
1073 2004-07-01  Werner Koch  <wk@gnupg.org>
1075         * sc-investigate.c: Initialize Pth which is now required.
1076         (interactive_shell): New command "readpk".
1078         * app-openpgp.c (do_getattr): Fix for sending CA-FPR.
1080 2004-06-30  Werner Koch  <wk@gnupg.org>
1082         * app-openpgp.c (app_openpgp_readkey): Fixed check for valid
1083         exponent.
1085 2004-06-18  Werner Koch  <wk@g10code.com>
1087         * sc-investigate.c (my_read_line): Renamed from read_line.
1089 2004-06-16  Werner Koch  <wk@gnupg.org>
1091         * apdu.c (osc_get_status): Fixed type in function name. Noted by
1092         Axel Thimm.  Yes, I didn't tested it with OpenSC :-(.
1094 2004-04-28  Werner Koch  <wk@gnupg.org>
1096         * app-openpgp.c (do_setattr): Sync FORCE_CHV1.
1098 2004-04-27  Werner Koch  <wk@gnupg.org>
1100         * app-common.h: Do not include ksba.h for gnupg 1.
1102 2004-04-26  Werner Koch  <wk@gnupg.org>
1104         * app-common.h: New members FNC.DEINIT and APP_LOCAL.
1105         * app.c (release_application): Call new deconstructor.
1106         * app-openpgp.c (do_deinit): New.
1107         (get_cached_data, flush_cache_item, flush_cache_after_error)
1108         (flush_cache): New.
1109         (get_one_do): Replaced arg SLOT by APP.  Make used of cached data.
1110         (verify_chv2, verify_chv3): Flush some cache item after error.
1111         (do_change_pin): Ditto.
1112         (do_sign): Ditto.
1113         (do_setattr): Flush cache item.
1114         (do_genkey): Flush the entire cache.
1115         (compare_fingerprint): Use cached data.
1117         * scdaemon.c (main): Do the last change the usual way. This is so
1118         that we can easily test for versioned config files above.
1120 2004-04-26  Marcus Brinkmann  <marcus@g10code.de>
1122         * scdaemon.c (main): For now, always print default filename for
1123         --gpgconf-list, and never /dev/null.
1125 2004-04-21  Werner Koch  <wk@gnupg.org>
1127         * command.c (scd_update_reader_status_file): Send a signal back to
1128         the client.
1129         (option_handler): Parse the new event-signal option.
1131         * scdaemon.c (handle_signal): Do not use SIGUSR{1,2} anymore for
1132         changing the verbosity.
1134 2004-04-20  Werner Koch  <wk@gnupg.org>
1136         * command.c (scd_update_reader_status_file): Write status files.
1138         * app-help.c (app_help_read_length_of_cert): Fixed calculation of
1139         R_CERTOFF.
1141         * pcsc-wrapper.c: New.
1142         * Makefile.am (pkglib_PROGRAMS): Install it here.
1143         * apdu.c (writen, readn): New.
1144         (open_pcsc_reader, pcsc_send_apdu, close_pcsc_reader): Use the
1145         pcsc-wrapper if we are using Pth.
1146         (apdu_send_le): Reinitialize RESULTLEN.  Handle SW_EOF_REACHED
1147         like SW_SUCCESS.
1149 2004-04-19  Werner Koch  <wk@gnupg.org>
1151         * ccid-driver.c (parse_ccid_descriptor): Store some of the reader
1152         features away.  New arg HANDLE
1153         (read_device_info): New arg HANDLE. Changed caller.
1154         (bulk_in): Handle time extension requests.
1155         (ccid_get_atr): Setup parameters and the IFSD.
1156         (compute_edc): New. Factored out code.
1157         (ccid_transceive): Use default NADs when required.
1159 2004-04-14  Werner Koch  <wk@gnupg.org>
1161         * scdaemon.h (server_control_s): Add member READER_SLOT.
1162         * scdaemon.c (scd_init_default_ctrl): Initialize READER_SLOT to -1.
1163         * command.c (open_card): Reuse an open slot.
1164         (reset_notify): Just reset the slot if supported by the reader.
1165         (do_reset): Factored code from above out.
1166         (scd_command_handler): Use it for cleanup.
1168         * apdu.h: New pseudo stati SW_HOST_NOT_SUPPORTED,
1169         SW_HOST_LOCKING_FAILED and SW_HOST_BUSY.
1170         * iso7816.c (map_sw): Map it.
1171         
1172         * ccid-driver.c (ccid_slot_status): Add arg STATUSBITS.
1173         * apdu.c (apdu_get_status): New.
1174         (ct_get_status, pcsc_get_status, ocsc_get_status): New stubs.
1175         (get_status_ccid): New.
1176         (apdu_reset): New.
1177         (reset_ct_reader, reset_pcsc_reader, reset_osc_reader): New stubs.
1178         (reset_ccid_reader): New.
1179         (apdu_enum_reader): New.
1180         
1181         * apdu.c (lock_slot, trylock_slot, unlock_slot): New helpers.
1182         (new_reader_slot) [USE_GNU_PTH]: Init mutex.
1183         (apdu_reset, apdu_get_status, apdu_send_le): Run functions
1184         in locked mode.
1186         * command.c (scd_update_reader_status_file): New.
1187         * scdaemon.c (handle_tick): Call it.
1189 2004-04-13  Werner Koch  <wk@gnupg.org>
1191         * scdaemon.c: Convert to a Pth application.
1192         (handle_signal, ticker_thread, handle_tick): New.
1193         (main): Fire up the ticker thread in server mode.
1195 2004-03-23  Werner Koch  <wk@gnupg.org>
1197         * scdaemon.c (main) <gpgconf_list>: Fixed output for pcsc_driver.
1199 2004-03-17  Werner Koch  <wk@gnupg.org>
1201         * tlv.c (parse_ber_header): Do not check for tag overflow - it
1202         does not make sense.  Simplified the check for length overflow.
1204         * scdaemon.c (main) <gpgconf>: Fixed default value quoting.
1206 2004-03-16  Werner Koch  <wk@gnupg.org>
1208         * app-dinsig.c: Implemented. Based on app-nks.c and card-dinsig.c
1209         * app-nks.c (get_length_of_cert): Removed.
1210         * app-help.c: New.
1211         (app_help_read_length_of_cert): New.  Code taken from above.  New
1212         optional arg R_CERTOFF.
1214         * card-dinsig.c: Removed.
1215         * card.c (card_get_serial_and_stamp): Do not bind to the old and
1216         never finsiged card-dinsig.c.
1218         * iso7816.c (iso7816_read_binary): Allow for an NMAX > 254.
1220 2004-03-11  Werner Koch  <wk@gnupg.org>
1222         * scdaemon.h (out_of_core): Removed.  Replaced callers by standard
1223         gpg_error function.
1225         * apdu.c, iso7816.c, ccid-driver.c [GNUPG_SCD_MAIN_HEADER]: Allow
1226         to include a header defined by the compiler.  This helps us to
1227         reuse the source in other software.
1229 2004-03-10  Werner Koch  <wk@gnupg.org>
1231         * iso7816.c (iso7816_read_record): New arg SHORT_EF.  Changed all
1232         callers.
1234 2004-02-18  Werner Koch  <wk@gnupg.org>
1236         * sc-investigate.c (main): Setup the used character set.
1237         * scdaemon.c (main): Ditto.
1239         * scdaemon.c (set_debug): New.  Add option --debug-level.
1240         (main): Add option --gpgconf-list.
1242 2004-02-12  Werner Koch  <wk@gnupg.org>
1244         * Makefile.am: Include cmacros.am for common flags.
1246 2004-01-29  Werner Koch  <wk@gnupg.org>
1248         * command.c (reset_notify): Release the application context and
1249         close the reader.
1251 2004-01-28  Werner Koch  <wk@gnupg.org>
1253         * iso7816.c (iso7816_manage_security_env): New.
1254         (iso7816_decipher): Add PADIND argument.
1256 2004-01-27  Werner Koch  <wk@gnupg.org>
1258         * command.c (cmd_readcert, cmd_readkey): Work on a copy of LINE.
1260         * app-common.h (app_ctx_s): Added readcert field.
1261         * app.c (app_readcert): New.
1262         * tlv.c (parse_ber_header): Added; taken from libksba.
1264 2004-01-26  Werner Koch  <wk@gnupg.org>
1266         * card.c (map_sc_err): Use SCD as the error source.
1268         * command.c (open_card): ADD arg NAME to allow requesting a
1269         specific application.  Changed all callers.
1270         (cmd_serialno): Allow optional argument to select the desired
1271         application.
1273         * app-nks.c: New. 
1275         * scdaemon.h (opt): Add READER_PORT.
1276         * scdaemon.c (main): Set it here.
1277         * app.c (app_set_default_reader_port): Removed.
1278         (select_application): Add NAME arg and figure out a
1279         default serial number from the GDO. Add SLOT arg and remove all
1280         reader management.
1281         (release_application): New.
1282         (app_write_learn_status): Output an APPTYPE status line.
1283         * command.c (open_card): Adapt for select_application change.
1284         * app-openpgp.c (app_select_openpgp): Removed SN and SNLEN args
1285         and set it directly.  Changed all callers.
1287 2004-01-25  Werner Koch  <wk@gnupg.org>
1289         * iso7816.c (iso7816_select_application): P1 kludge for OpenPGP
1290         card.
1291         * app-openpgp.c (find_tlv): Factor out this function to ..
1292         * tlv.c, tlv.h: .. new.
1294         * scdaemon.h: Introduced app_t and ctrl_t as the new types for APP
1295         and CTRL.
1297 2004-01-21  Werner Koch  <wk@gnupg.org>
1299         * apdu.c (apdu_send_le): Treat SW_EOF_REACHED as a warning.
1301 2004-01-20  Werner Koch  <wk@gnupg.org>
1303         * iso7816.c (iso7816_read_binary): New.
1304         (iso7816_select_file): New.
1305         (iso7816_list_directory): New.
1307         * sc-investigate.c: Add option -i.
1308         (select_app, read_line, interactive_shell): New.
1310 2004-01-16  Werner Koch  <wk@gnupg.org>
1312         * apdu.h: Add SW_FILE_NOT_FOUND.
1313         * iso7816.c (map_sw): Map it to GPG_ERR_ENOENT.
1314         * iso7816.c (iso7816_select_file): New.
1316         * app-dinsig.c: New file w/o any real code yet.
1317         * Makefile.am (scdaemon_SOURCES,sc_investigate_SOURCES): Add file.
1319         * sc-investigate.c: Add option --disable-ccid.
1321 2003-12-19  Werner Koch  <wk@gnupg.org>
1323         * apdu.c (apdu_send_le): Send a get_response with the indicated
1324         length and not the 64 bytes we used for testing.
1326         * app-openpgp.c (verify_chv2, verify_chv3, do_sign): Check the
1327         minimum length of the passphrase, so that we don't need to
1328         decrement the retry counter.
1330 2003-12-17  Werner Koch  <wk@gnupg.org>
1332         * card-p15.c (p15_enum_keypairs): Replaced KRC by RC.
1333         * card-dinsig.c (dinsig_enum_keypairs): Ditto.
1335 2003-12-16  Werner Koch  <wk@gnupg.org>
1337         * scdaemon.c (main): Set the prefixes for assuan logging.
1339 2003-11-17  Werner Koch  <wk@gnupg.org>
1341         * scdaemon.c, scdaemon.h: New options --allow-admin and --deny-admin.
1342         * app-openpgp.c (verify_chv3): Check it here.
1344 2003-11-12  Werner Koch  <wk@gnupg.org>
1346         Adjusted for API changes in Libksba.
1348 2003-10-30  Werner Koch  <wk@gnupg.org>
1350         * apdu.c (close_ct_reader, close_pcsc_reader): Implemented.
1351         (get_ccid_error_string): New.  Not very useful messages, though.
1353 2003-10-25  Werner Koch  <wk@gnupg.org>
1355         * ccid-driver.c (ccid_open_reader): Return an error if no USB
1356         devices are found.
1358         * command.c (cmd_genkey, cmd_passwd): Fixed faulty use of
1359         !spacep().
1361         * apdu.c (apdu_open_reader): Hacks for PC/SC under Windows.
1363 2003-10-20  Werner Koch  <wk@gnupg.org>
1365         * command.c (cmd_checkpin): New.
1366         (register_commands): Add command CHECKPIN.
1367         * app.c (app_check_pin): New.
1368         * app-openpgp.c (check_against_given_fingerprint): New. Factored
1369         out that code elsewhere.
1370         (do_check_pin): New.
1372 2003-10-10  Werner Koch  <wk@gnupg.org>
1374         * ccid-driver.c (ccid_close_reader): New.
1376         * apdu.c (close_ccid_reader, close_ct_reader, close_csc_reader)
1377         (close_osc_reader, apdu_close_reader): New.  Not all are properly
1378         implemented yet.
1380 2003-10-09  Werner Koch  <wk@gnupg.org>
1382         * ccid-driver.c (ccid_transceive): Add T=1 chaining for sending.
1384 2003-10-08  Werner Koch  <wk@gnupg.org>
1386         * app-openpgp.c (do_getattr): Support SERIALNO and AID.
1388 2003-10-01  Werner Koch  <wk@gnupg.org>
1390         * ccid-driver.c: Detect GnuPG 1.3 and include appropriate files.
1391         * apdu.c: Ditto.
1392         * app-openpgp.c: Ditto.
1393         * iso7816.c: Ditto.
1394         (generate_keypair): Renamed to ..
1395         (do_generate_keypair): .. this.
1396         * app-common.h [GNUPG_MAJOR_VERSION]: New.
1397         * iso7816.h [GNUPG_MAJOR_VERSION]: Include cardglue.h
1399 2003-09-30  Werner Koch  <wk@gnupg.org>
1401         * command.c (cmd_getattr): New command GETATTR.
1402         * app.c (app_setattr): New.
1403         (do_getattr): New.
1404         (do_learn_status): Reimplemented in terms of do_getattr.
1406         * app-openpgp.c (do_change_pin): Make sure CVH1 and CHV2 are
1407         always synced.
1408         (verify_chv2, verify_chv3): New. Factored out common code.
1409         (do_setattr, do_sign, do_auth, do_decipher): Change the names of
1410         the prompts to match that we have only 2 different PINs.
1411         (app_select_openpgp): Check whether the card enforced CHV1.
1412         (convert_sig_counter_value): New. Factor out code from
1413         get_sig_counter.
1415 2003-09-28  Werner Koch  <wk@gnupg.org>
1417         * app-openpgp.c (dump_all_do): Use gpg_err_code and not gpg_error.
1419 2003-09-19  Werner Koch  <wk@gnupg.org>
1421         * ccid-driver.c (parse_ccid_descriptor): New.
1422         (read_device_info): New.
1423         (ccid_open_reader): Check that the device has all required features.
1425 2003-09-06  Werner Koch  <wk@gnupg.org>
1427         * scdaemon.c (main): --pcsc-driver again defaults to pcsclite.
1428         David Corcoran was so kind to remove the GPL incompatible
1429         advertisng clause from pcsclite.
1430         * apdu.c (apdu_open_reader): Actually make pcsc-driver option work.
1432 2003-09-05  Werner Koch  <wk@gnupg.org>
1434         * ccid-driver.c: More work, data can now actually be retrieved.
1435         * ccid-driver.c, ccid-driver.h: Alternativley allow use under BSD
1436         conditions.
1438 2003-09-02  Werner Koch  <wk@gnupg.org>
1440         * scdaemon.c, scdaemon.h: New option --pcsc-ccid.
1441         * ccid-driver.c, ccid-driver.h: New but far from being useful.
1442         * Makefile.am: Add above.
1443         * apdu.c: Add support for that ccid driver.
1444         
1445 2003-08-26  Timo Schulz  <twoaday@freakmail.de>
1447         * apdu.c (new_reader_slot): Only set 'is_osc' when OpenSC
1448         is used.
1449         
1450 2003-08-25  Werner Koch  <wk@gnupg.org>
1452         * command.c (cmd_setattr): Use a copy of LINE.
1453         (cmd_genkey): Use a copy of KEYNO.
1454         (cmd_passwd): Use a copy of CHVNOSTR.
1455         (cmd_pksign, cmd_pkauth, cmd_pkdecrypt): s/strdup/xtrystrdup/.
1457 2003-08-19  Werner Koch  <wk@gnupg.org>
1459         * scdaemon.c, scdaemon.h: New option --pcsc-driver.
1460         * apdu.c (apdu_open_reader): Use that option here instead of a
1461         hardcoded one.
1463 2003-08-18  Werner Koch  <wk@gnupg.org>
1465         * Makefile.am: Add OPENSC_LIBS to all programs. 
1467         * scdaemon.c, scdaemon.h: New option --disable-opensc.
1468         * card.c (card_open): Implement it.
1469         * apdu.c (open_osc_reader, osc_send_apdu): New.
1470         (apdu_open_reader) [HAVE_OPENSC]: Use the opensc driver if not
1471         disabled.
1472         (error_string) [HAVE_OPENSC]: Use sc_strerror.
1473         (send_apdu) [HAVE_OPENSC]: Call osc_apdu_send.
1475         * card-p15.c (p15_enum_keypairs, p15_prepare_key): Adjusted for
1476         libgpg-error.
1478 2003-08-14  Timo Schulz  <twoaday@freakmail.de>
1480         * apdu.c (ct_activate_card): Change the code a little to avoid
1481         problems with other readers.
1482         * Always use 'dynload.h' instead of 'dlfcn.h'.
1484 2003-08-05  Werner Koch  <wk@gnupg.org>
1486         * app-openpgp.c (dump_all_do): Don't analyze constructed DOs after
1487         an error.
1489 2003-08-04  Werner Koch  <wk@gnupg.org>
1491         * app.c (app_set_default_reader_port): New.
1492         (select_application): Use it here.
1493         * scdaemon.c (main): and here.
1494         * sc-copykeys.c: --reader-port does now take a string.
1495         * sc-investigate.c, scdaemon.c: Ditto.
1496         * apdu.c (apdu_open_reader): Ditto.  Load pcsclite if no ctapi
1497         driver is configured.  Always include code for ctapi.
1498         (new_reader_slot): Don't test for already used ports and remove
1499         port arg.
1500         (open_pcsc_reader, pcsc_send_apdu, pcsc_error_string): New.
1501         (apdu_send_le): Changed RC to long to cope with PC/SC.
1503         * scdaemon.c, scdaemon.h: New option --ctapi-driver.
1504         * sc-investigate.c, sc-copykeys.c: Ditto.
1505         
1506 2003-07-31  Werner Koch  <wk@gnupg.org>
1508         * Makefile.am (scdaemon_LDADD): Added INTLLIBS.
1510 2003-07-28  Werner Koch  <wk@gnupg.org>
1512         * app-openpgp.c (do_setattr): Change implementation.  Allow all
1513         useful DOs.
1515 2003-07-27  Werner Koch  <wk@gnupg.org>
1517         Adjusted for gcry_mpi_print and gcry_mpi_scan API change.
1519 2003-07-24  Werner Koch  <wk@gnupg.org>
1521         * app-openpgp.c (do_learn_status): Print more status information.
1522         (app_select_openpgp): Store the card version.
1523         (store_fpr): Add argument card_version and fix DOs for old cards.
1524         (app_openpgp_storekey): Likewise.
1526 2003-07-23  Werner Koch  <wk@gnupg.org>
1528         * command.c (cmd_pkauth): New.
1529         (cmd_setdata): Check whether data was given at all to avoid
1530         passing 0 to malloc.
1532         * app.c (app_auth): New.
1533         * app-openpgp.c (do_auth): New.
1535 2003-07-22  Werner Koch  <wk@gnupg.org>
1537         * command.c (cmd_passwd): New.
1538         * app.c (app_change_pin): New.
1539         * app-openpgp.c (do_change_pin): New.
1540         * iso7816.c (iso7816_reset_retry_counter): Implemented.
1542         * sc-investigate.c (main): New option --gen-random.
1543         * iso7816.c (iso7816_get_challenge): Don't create APDUs with a
1544         length larger than 255.
1546 2003-07-17  Werner Koch  <wk@gnupg.org>
1548         * command.c (cmd_random): New command RANDOM.
1550         * iso7816.c (map_sw): New. Use it in this file to return
1551         meaningful error messages.  Changed all public fucntions to return
1552         a gpg_error_t.
1553         (iso7816_change_reference_data): New.
1554         * apdu.c (apdu_open_reader): Use faked status words for soem
1555         system errors.
1557 2003-07-16  Werner Koch  <wk@gnupg.org>
1559         * apdu.c (apdu_send_simple): Use apdu_send_le so that we can
1560         specify not to send Le as it should be.
1562 2003-07-15  Werner Koch  <wk@gnupg.org>
1564         * Makefile.am: Add sc-copykeys program.
1565         * sc-copykeys.c: New.
1566         * app-openpgp.c (app_openpgp_storekey): New.
1567         (app_openpgp_cardinfo): New.
1568         (count_bits): New.
1569         (store_fpr): And use it here to get the actual length in bit.
1571 2003-07-03  Werner Koch  <wk@gnupg.org>
1573         * app-openpgp.c (do_setattr): Add setting of the URL.
1574         (app_select_openpgp): Dump card data only in very verbose mode.
1575         (do_decipher): New.
1577 2003-07-02  Werner Koch  <wk@gnupg.org>
1579         * app-openpgp.c (get_sig_counter): New.
1580         (do_sign): Print the signature counter and enable the PIN callback.
1581         (do_genkey): Implement the PIN callback. 
1583 2003-07-01  Werner Koch  <wk@gnupg.org>
1585         * app-openpgp.c (store_fpr): Fixed fingerprint calculation.
1587 2003-06-26  Werner Koch  <wk@gnupg.org>
1589         * app-openpgp.c (find_tlv): Fixed length header parsing.
1591         * app.c (app_genkey): New.
1592         * command.c (cmd_genkey): New.
1594 2003-06-25  Werner Koch  <wk@gnupg.org>
1596         * command.c (percent_plus_unescape): New.
1597         (cmd_setattr): New.
1599 2003-06-24  Werner Koch  <wk@gnupg.org>
1601         * command.c (send_status_info): New.
1603         * app-openpgp.c (app_select_openpgp): Replace SLOT arg by APP arg
1604         and setup the function pointers in APP on success. Changed callers.
1605         * app.c: New.
1606         * app-common.h: New.
1607         * scdaemon.h (APP): New type to handle applications.
1608         (server_control_s): Add an APP context field.
1610         * command.c (cmd_serialno): Handle applications.
1611         (cmd_pksign): Ditto.
1612         (cmd_pkdecrypt): Ditto.
1613         (reset_notify): Ditto.
1614         (cmd_learn): For now return error for application contexts.
1615         (cmd_readcert): Ditto.
1616         (cmd_readkey): Ditto.
1618 2003-06-04  Werner Koch  <wk@gnupg.org>
1620         * card.c (map_sc_err): Renamed gpg_make_err to gpg_err_make.
1622         Renamed error codes from INVALID to INV and removed _ERROR suffixes.
1624 2003-06-03  Werner Koch  <wk@gnupg.org>
1626         Changed all error codes in all files to the new libgpg-error scheme.
1628         * scdaemon.h: Include gpg-error.h and errno.h
1629         * card.c (map_sc_err): Use unknown for the error source.
1630         * Makefile.am: Link with libgpg-error
1632 2003-05-14  Werner Koch  <wk@gnupg.org>
1634         * atr.c, atr.h: New.
1635         * sc-investigate.c: Dump the ATR in a human readable format.
1637 2003-05-08  Werner Koch  <wk@gnupg.org>
1639         * scdaemon.h (DBG_CARD_IO_VALUE): New.
1641         * sc-investigate.c: New.
1642         * scdaemon.c (main): Removed --print-atr option.
1644         * iso7816.c, iso7816.h, app-openpgp.c: New.
1646 2003-04-29  Werner Koch  <wk@gnupg.org>
1648         * scdaemon.c: New options --print-atr and --reader-port
1649         * apdu.c, apdu.h: New
1651         * card.c, card-p15.c, card-dinsig.c: Allow build without OpenSC.
1652         
1653         * Makefile.am (LDFLAGS): Removed.
1655         * command.c (register_commands): Adjusted for new Assuan semantics.
1657 2002-08-21  Werner Koch  <wk@gnupg.org>
1659         * scdaemon.c (main): New option --daemon so that the program is
1660         not accidently started in the background.
1662 2002-08-16  Werner Koch  <wk@gnupg.org>
1664         * scdaemon.c: Include i18n.h.
1666         * card-common.h (struct p15_private_s): Forward declaration.  Add
1667         it to card_ctx_s.
1668         * card.c (card_close): Make sure private data is released.
1669         (card_enum_certs): New.
1670         * card-p15.c (p15_release_private_data): New.
1671         (init_private_data): New to work around an OpenSC weirdness.
1672         (p15_enum_keypairs): Do an OpenSC get_objects only once.
1673         (p15_enum_certs): New.
1674         (card_p15_bind): Bind new function.
1675         * command.c (cmd_learn): Return information about the certificates.
1677 2002-08-09  Werner Koch  <wk@gnupg.org>
1679         * card.c (card_get_serial_and_stamp): Use the tokeinfo serial
1680         number as a fallback. Add a special prefix for serial numbers.
1682 2002-07-30  Werner Koch  <wk@gnupg.org>
1684         Changes to cope with OpenSC 0.7.0:
1685         
1686         * card.c: Removed the check for the packed opensc version.
1687         Changed include file names of opensc.
1688         (map_sc_err): Adjusted error codes for new opensc version.
1689         * card-p15.c: Changed include filename of opensc.
1690         * card-dinsig.c: Ditto.
1692         * card-p15.c (p15_decipher): Add flags argument to OpenSC call.
1693         
1694 2002-07-24  Werner Koch  <wk@gnupg.org>
1696         * card.c (find_simple_tlv, find_iccsn): New.
1697         (card_get_serial_and_stamp): Improved serial number parser.
1699 2002-06-27  Werner Koch  <wk@gnupg.org>
1701         * scdaemon.c (main): Use GNUPG_DEFAULT_HOMEDIR constant.
1703 2002-06-15  Werner Koch  <wk@gnupg.org>
1705         * card-dinsig.c: Documented some stuff from the DIN norm.
1707 2002-04-15  Werner Koch  <wk@gnupg.org>
1709         * command.c (cmd_pksign, cmd_pkdecrypt): Use a copy of the key ID.
1711 2002-04-12  Werner Koch  <wk@gnupg.org>
1713         * scdaemon.c: New option --debug-sc N.
1714         * card.c (card_open): set it here.
1716         * card-p15.c (p15_prepare_key): Factored out common code from ...
1717         (p15_sign, p15_decipher): here and made the decryption work the
1718         regular way.
1720 2002-04-10  Werner Koch  <wk@gnupg.org>
1722         * card.c (card_open): Return immediately when no reader is available.
1724 2002-03-27  Werner Koch  <wk@gnupg.org>
1726         * card.c (card_open, card_close): Adjusted for changes in OpenSC.
1728 2002-03-10  Werner Koch  <wk@gnupg.org>
1730         * card-p15.c, card-dinsig.c, card-common.h: New.
1731         * card.c: Factored most code out to the new modules, so that we
1732         can better support different types of card applications.
1734 2002-01-26  Werner Koch  <wk@gnupg.org>
1736         * scdaemon.c scdaemon.h, command.c: New. Based on the code from
1737         the gpg-agent.
1739         
1740  Copyright 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
1742  This file is free software; as a special exception the author gives
1743  unlimited permission to copy and/or distribute it, with or without
1744  modifications, as long as this notice is preserved.
1746  This file is distributed in the hope that it will be useful, but
1747  WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
1748  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.